Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Process Groups

Each process has a numeric process group ID that defines the process group to which it belongs. A new process inherits its parent’s process group ID. A process can obtain its process group ID using getpgrp().

#include <unistd.h>

pid_t getpgrp(void)

Note

Always successfully returns process group ID of calling process

If the value returned by getpgrp() matches the caller’s process ID, this process is the leader of its process group.

The setpgid() system call changes the process group of the process whose process ID is pid to the value specified in pgid.

#include <unistd.h>

int setpgid(pid_t pid, pid_t pgid);

Note

Returns 0 on success, or -1 on error


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint