Fortran Library Reference

getuid, getgid: Get User or Group ID of Process

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

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  

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).