pxfgetgroups(3F)

PXFGETGROUPS - Gets supplementary group IDs

As shipped in IRIX 6.5.5. Last changed in IRIX 6.5.5.

NAME
     PXFGETGROUPS - Gets supplementary group IDs

SYNOPSIS
     SUBROUTINE PXFGETGROUPS (igidsetsize, igrouplist, ngroups, ierror)
     INTEGER igidsetsize, igrouplist(igidsetsize), ngroups, ierror

IMPLEMENTATION
     UNICOS, UNICOS/mk, and IRIX systems

STANDARDS
     IEEE standard interface for FORTRAN 77

DESCRIPTION
     On IRIX systems, 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 PXFGETGROUPS subroutine uses the getgroups(2) system call to fill
     igrouplist with a supplemental group list for the calling process.

     As a special case, when igidsetsize is zero, PXFGETGROUPS will return
     the number of supplemental group IDs for the calling process in the
     ngroups variable, leaving the igrouplist variable unchanged.

     When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
     UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
     kind unless documented otherwise.  On UNICOS and UNICOS/mk, default
     kind is KIND=8 for integer, real, complex, and logical arguments; on
     IRIX, the default kind is KIND=4.

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

     igidsetsize
                An input integer variable containing the size of the
                igrouplist integer array.

     igrouplist An output integer variable or array element that will
                contain a set of supplemental group IDs for the calling
                process. NGROUPS_MAX, found in <sys/param.h> for the UNICOS
                operating system and <unistd.h> for IRIX systems, defines
                the maximum number of supplemental group IDs for a process.

     ngroups    An output integer variable that will contain the number of
                supplemental group IDs for the calling process.

     ierror     An output integer variable that contains zero if the
                variable was changed or nonzero if PXFGETGROUPS was not
                successful.

     The PXFGETGROUPS routine may return the EINVAL error value if
     igidsetsize is not equal to zero and is less than the number of
     supplementary group IDs.

EXAMPLES
     This example finds the number of supplemental group IDs for its
     process, prints out the number, and then retrieves the supplemental
     group IDs and prints each group ID.

              program pxftest
              integer igidgrouplist, igrouplist(64), ngroups, ierror, i

        c     find out the number of groups
              igidgrouplist = 0
              CALL PXFGETGROUPS(igidgrouplist, igrouplist, ngroups, ierror)
              print *,'groups for process = ',ngroups,' error = ',ierror

        c     call pxfgetgroups
              igidgrouplist = 64
              CALL PXFGETGROUPS(igidgrouplist, igrouplist, ngroups, ierror)
              print *,'groups for process = ',ngroups,' error = ',ierror

        c     print out all groups for the process
              do i=1,ngroups
                 print *,' gid = ', igrouplist(i)
              enddo

              end

     This example may return the following results:

           groups for process =  2  error =  0
           groups for process =  2  error =  0
           gid =  1013
           gid =  10533

SEE ALSO
     getgroups(2)

     Application Programmer's Library Reference Manual for the printed
     version of this man page.