[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

getgid, getegid or gegidx Subroutine

Purpose

Gets the process group IDs.

Library

Standard C Library (libc.a)

Syntax

#include <unistd.h>
#include <sys/types.h>

gid_t getgid (void);

gid_t getegid (void);
#include <id.h>
gid_t getgidx (int type);

Description

The getgid subroutine returns the real group ID of the calling process.

The getegid subroutine returns the effective group ID of the calling process.

The getgidx subroutine returns the group ID indicated by the type parameter of the calling process.

These subroutines are part of Base Operating System (BOS) Runtime.

Return Values

The getgid, getegidand getgidx subroutines return the requested group ID. The getgid and getegid subroutines are always successful.

The getgidx subroutine will return -1 and set the global errno variable to EINVAL if the type parameter is not one of ID_REAL, ID_EFFECTIVE or ID_SAVED.

Parameters

type Specifies the group ID to get. Must be one of ID_REAL (real group ID), ID_EFFECTIVE (effective group ID) or ID_SAVED (saved set-group ID).

Error Codes

If the getgidx subroutine fails the following is returned:

EINVAL Indicates the value of the type parameter is invalid.

Related Information

The getgroups subroutine, initgroups subroutine, setgid subroutine, setgroups subroutine.

The groups command, setgroups command.

List of Security and Auditing Subroutines and Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]