Sun Studio 12: Fortran Library Reference

1.4.23 getuid, getgid: Get User or Group ID of Process

getuid and getgid get the user or group ID of the process, respectively.

1.4.23.1 getuid: Get User ID of the Process

The function is called by:

INTEGER*4 getuid

uid = getuid()

Return value 

INTEGER*4

Output 

User ID of the process 

1.4.23.2 getgid: Get Group ID of the Process

The function is called by:

INTEGER*4 getgid

gid = getgid()

Return value 

INTEGER*4

Output 

Group ID of the process 

Example: getuid() and getpid():


       INTEGER*4 getuid, getgid, gid, uid
       uid = getuid()
       gid = getgid()
       write(*,*) uid, gid
       end

See also: getuid(2).