/* * Sample program for getpgrp system call - No.65 * * Name * getpgid, getpgrp - get process group * * Synopsis * #include * * pid_t getpgid(pid_t pid) * pid_t getpgrp(void); * * Description * getpgid returns the process group ID of the precess speci- * fied by pid. If pid is zero, the process ID of the cur- * rent process is used. * * getpgrp is equivalent to getpgid(0). Eeach process group * is a member of a session and each process is a member of * the session of whitch its process group is a member. * */ #include #include #include main() { printf("the process group ID = %d\n", getpgrp()); exit(0); }