getresuid
Section: System Calls (2)
Updated: 2026-02-08
Index
JM Home Page
roff page
名前
getresuid, getresgid - 実、実効、保存、ユーザー ID / グループ ID を取得する
ライブラリ
標準 C ライブラリ (libc,~-lc)
書式
#define _GNU_SOURCE /* feature_test_macros(7) 参照 */
#include <unistd.h>
int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
説明
getresuid() は、呼び出したプロセスの実 (real) UID、実効 (effective) UID、 保存 (saved)
set-user-ID (getresgid の場合はグループ ID) を、 それぞれ引数 ruid, euid, suid
に格納して返す。 getresgid() は、呼び出したプロセスのグループ ID について同様の処理を行う。
返り値
On success, zero is returned. On error, -1 is returned, and errno is set
to indicate the error.
エラー
- EFAULT
-
指定した引数のどれかが、呼び出したプログラムのアドレス空間の外の アドレスである。
標準規格
POSIX.1-2024 XSI.
歴史
Linux 2.1.44, glibc 2.3.2, POSIX.1-2024 XSI.
元々の Linux の getresuid() と getresgid() システムコールは
16 ビットのグループ ID だけに対応していた。
その後、Linux 2.4 で、32 ビットの ID に対応した
getresuid32() と getresgid32() が追加された。
glibc の getresuid() と getresgid() のラッパー関数は
カーネルバージョンによるこの違いを吸収している。
関連項目
getuid(2), setresuid(2), setreuid(2), setuid(2),
credentials(7)
Index
- 名前
-
- ライブラリ
-
- 書式
-
- 説明
-
- 返り値
-
- エラー
-
- 標準規格
-
- 歴史
-
- 関連項目
-
This document was created by
man2html,
using the manual pages.