[Previous]
[Contents]
[Next]

getuid()

get the user ID

Synopsis:

#include <sys/types.h>
#include <unistd.h>
uid_t getuid( void );

Description:

The getuid() function allows the calling process to find out its user ID.

Returns:

The user ID for the calling process.

Examples:

/*
 * Print the user ID of this process.
 */
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

void main()
  {
    printf( "My userid is %d\n", getuid() );
  }

Classification:

POSIX 1003.1

Safety:
Interrupt handler No
Signal handler Yes
Thread No

See also:

geteuid(), getgid(), getegid()


[Previous]
[Contents]
[Next]