064-04 Process
064-04 Process
Process
A operation that runs on a Unix system is a
process.
Process is a program in execution.
ps-command
top – command
kill – command
Other IDs:
* Parent process ID - getppid()
* Group ID - getgid()
* User ID - getuid()
#include <unistd.h>
pid_t fork(void);
return value :
> 0 -> parent context
= 0 -> Child context
< 0 -> Child not created
Wait() and Zombies
* If wait not called by the parent then child exists after parent
exits => Child works for none and occupies unwanted
memory space and runtime - > ZOMBIE processes.
* Wait function suspends the parent until the child exits thus
avoiding Zombies.