#include #include #include int main() { #if defined (_POSIX_JOB_CONTROL) printf("job control is supported\n"); printf("before setpgid, pid = %d, pgid = %d\n", getpid(), getpgrp()); setpgid(0,getppid()); printf("after setpgid, pid = %d, pgid = %d\n", getpid(), getpgrp()); while (1) { pause(); } exit(EXIT_SUCCESS); #else printf("job control is not supported\n"); exit(EXIT_SUCCESS); #endif }