#include <unistd.h> uid_t getuid(void); uid_t geteuid(void);
geteuid() は呼び出し元のプロセスの実効ユーザー ID を返す。
UNIX V6 では getuid() コールは (euid << 8) + uid を返していた。 UNIX V7 では getuid() と geteuid() という別々のコールが導入された。
元々の Linux の getuid() と geteuid() システムコールは 16 ビットのグループ ID だけに対応していた。 その後、Linux 2.4 で、32 ビットの ID に対応した getuid32() と geteuid32() が追加された。 glibc の getuid() と geteuid() のラッパー関数は カーネルバージョンによるこの違いを吸収している。
On Alpha, instead of a pair of getuid() and geteuid() system calls, a single getxuid() system call is provided, which returns a pair of real and effective UIDs. The glibc getuid() and geteuid() wrapper functions transparently deal with this. See syscall(2) for details regarding register mapping.