First page Back Continue Last page Summary Graphics
The setpgrp problem
Program pid.c
- #include <stdio.h>
- #include <unistd.h>
- int main(int argc,char* argv[])
- {
- fprintf(stderr,"PID=%d\n",getpid());
- fprintf(stderr,"PGRP=%d\n",getpgrp());
- fprintf(stderr,"setpgrp return=%d: ",setpgrp());
- perror("");
- return 0;
- }
pid
- PID=22581
- PGRP=22581
- setpgrp return=0: Success
bpsh 0 pid
- PID=22583
- PGRP=22582
- setpgrp return=-1: No such process
Notes: