pxfsetgid(3F)

PXFSETGID - Sets group ID

Showing IRIX 6.5.30 (default release). Last changed in IRIX 6.5.19.

NAME
     PXFSETGID - Sets group ID

SYNOPSIS
     SUBROUTINE PXFSETGID (igid, ierror)
     INTEGER igid, ierror

STANDARDS
     IEEE standard interface for FORTRAN 77

DESCRIPTION
     This routine is in libfortran.so which is linked by default when
     compiling programs with the MIPSpro 7 Fortran 90 compiler or when
     compiling programs with the -craylibs option to the MIPSpro F77
     compiler.

     The PXFSETGID routine uses the setgid(2) function to set the real
     group ID, effective group ID, and saved-set group IDs of the calling
     process.  The following conditions determine the setting of an ID.
     They are checked in the following order, and the first condition that
     is true is applied:

     * If the process has appropriate privilege, the real, effective, and
       saved-set group IDs are all set to igid.

     * If ID is equal to either the real group ID, the effective group ID,
       or the saved-set, group ID is set to igid.

     All arguments must be of default kind unless documented otherwise.  On
     IRIX systems, the default kind is KIND=4.

     The following is a list of valid arguments for this routine:

     igid      An input integer variable used to replace the current group
               ID for the calling process.

     ierror    An output integer variable that contains zero if PXFSETGID
               was successful.  or nonzero if PXFSETGID was not successful.

     PXFSETGID may return EINVAL if the value of the igid argument is out
     of range or EPERM if the process does not have the appropriate
     privileges and igid does not match the real user ID.

NOTES
     The PXF_DEFINITIONS module can be used by Fortran 90 users to enable
     caller-callee interface checking.

EXAMPLES
     In this example, the current user ID for the current process will be
     obtained by calling PXFGETGID and then setting the group ID for the
     current process by using the group ID returned by PXFGETGID.

          program pxftest
          integer igid, ierror

          CALL PXFGETGID(igid, ierror)
             if (ierror .eq. 0) then
                CALL PXFSETGID(igid, ierror)
                if (ierror .eq. 0) then
                   print *,'group id set to ',igid
                else
                   print *,'group id not set to ',igid,' because of error'
                endif
             else
                print *,'could not obtain user ID  error = ',ierror
             endif
          end

SEE ALSO
     setgid(2)