CSc 422 Assignment 1

Process Attributes

Assigned
Due

Sep 11
25 pts
Sep 18

This is a very simple get-started assignment. Create a Unix or Linux (or Mac, presumably) program that runs and prints out its process id, its parent process id, its owner user id and its owner group id. Like this:

[bennet@m-mcc-csc-01456 asst]$ ./procstuff My process ID: 4143 My parent process ID: 3696 My owner's user id: 1000 My owner's group id: 1000
Each of these data are supplied by library calls (that ultimately perform system calls). In order, getpid, getppid, getuid, and getgid. They are documented by running the man command on a Unix system (Sandbox works fine). Googling them works pretty well, too. You may compile your program as plain C or C++, as you like.

You are welcome to install Linux or BSD on your own equipment, or use the Sandbox server. If you need Sandbox credentials or a password change, drop by or email me.

If you're working on Sandbox, you can use the very simple nano, the traditional vi, or the rococo emacs. If you use emacs, I recommend first running the local command emacscust, which makes some customations, including enabling the mouse and adding key sequences (control-x, control-e and control-x control-n) for compiling and moving through any errors. You can also use WinSCP to edit your Sandbox files remotely from a Windows desktop.

When your program works correctly and looks nice, submit it here.