getuid

Section: System Calls (2)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

getuid, geteuid - ユーザー ID を得る  

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#include <unistd.h>

uid_t getuid(void);
uid_t geteuid(void);
 

説明

getuid() は呼び出し元のプロセスの実ユーザー ID を返す。

geteuid() は呼び出し元のプロセスの実効ユーザー ID を返す。  

エラー

These functions are always successful and never modify errno.  

標準規格

POSIX.1-2024.  

歴史

4.3BSD, POSIX.1-1988.

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.  

関連項目

getresuid(2), setreuid(2), setuid(2), credentials(7)


 

Index

名前
ライブラリ
書式
説明
エラー
標準規格
歴史
関連項目

This document was created by man2html, using the manual pages.