getegid(2)

getegid2

Get group identity

Part of getgid(2).

Usage

#include <unistd.h>

gid_t getgid(void); gid_t getegid(void);

Library

Standard C library (libc, -lc)

Overview

getgid() returns the real group ID of the calling process.

getegid() returns the effective group ID of the calling process.

Errors

These functions are always successful and never modify errno.

Versions

On Alpha, instead of a pair of getgid() and getegid() system calls, a single getxgid() system call is provided, which returns a pair of real and effective GIDs. The glibc getgid() and getegid() wrapper functions transparently deal with this. See syscall(2) for details regarding register mapping.

Releases

19 releases since Debian 1.1 (Buzz); the text changed 15 times.

  1. 1.1–2.0
  2. 2.1
  3. 2.2
  4. 3.0
  5. 3.1
  6. 4.0
  7. 5.0
  8. 6.0
  9. 7
  10. 8
  11. 9
  12. 10
  13. 11
  14. 12
  15. 13
  16. Arch

Standards

POSIX.1-2024.

History

4.3BSD, POSIX.1-1988.

The original Linux getgid() and getegid() system calls supported only 16-bit group IDs. Subsequently, Linux 2.4 added getgid32() and getegid32(), supporting 32-bit IDs. The glibc getgid() and getegid() wrapper functions transparently deal with the variations across kernel versions.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.