[Previous]
[Contents]
[Next]

getgid()

get the group ID

Synopsis:

#include <sys/types.h>
#include <unistd.h>
gid_t getgid( void );

Description:

The getgid() function allows the calling process to find out its group ID.

Returns:

The calling process's group ID. This function cannot fail.

Examples:

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

void main()
  {
     printf( "I belong to group ID %d\n", getgid() );
  }

Classification:

POSIX 1003.1

Safety:
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

getuid(), geteuid(), getegid()


[Previous]
[Contents]
[Next]