Copyright Digital Equipment Corp. All rights reserved.

Return_Values

   x                  The process group ID of the session leader of
                      the specified process.
   (pid_t)-1          Indicates an error. The function sets errno to
                      one of the following values:

                      o  EPERM - The process specified by pid is
                         not in the same session as the calling
                         process, and the implementation does not
                         allow access to the process group ID of
                         the session leader of that process from the
                         calling process.

                      o  ESRCH - There is no process with a process
                         ID of pid.