Process’ Properties

Process’ Properties - Process Properties A...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Process’ Properties A process has the following properties: PID: Index in process table Command and Arguments Environment Variables Current Dir Owner (User ID) Stdin/Stdout/Stderr
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Process ID Uniquely identifies the processes among all live processes. The initial process (init process) has ID of 0. The OS assigns the numbers in ascending order. The numbers wrap around when they reach the maximum and then are reused as long as there is no live process with the same processID. You can programmatically get the process id with
Background image of page 2
Command and Arguments Every process also has a command that is executing (the program file or script) and 0 or more arguments. The arguments are passed to main. int main(int argc, char **argv); Argc contains the number of arguments including the command name. Argv[0] contains the name of the command
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
printargs.c: int main(int argc, char **argv) { int i; for (i=0; i<argc; i++) { printf(“argv[%d]=\”%s\”\n”, i, argv[i]);
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2012 for the course CS 252 taught by Professor Gustavorodriguez during the Fall '11 term at Purdue University-West Lafayette.

Page1 / 13

Process&acirc;€™ Properties - Process Properties A...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online