.\" Updated 2010-04-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.24
.\" Updated 2012-04-30, Akihiro MOTOKI <amotoki@gmail.com>
.\"
-.TH SETUID 2 2010\-11\-22 Linux "Linux Programmer's Manual"
+.TH SETUID 2 2014\-09\-21 Linux "Linux Programmer's Manual"
.SH 名前
setuid \- ユーザー識別 (identity) を設定する
.SH 書式
\fBseteuid\fP(2) を使う必要がある。
.SH 返り値
成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
+
+\fINote\fP: there are cases where \fBsetuid\fP() can fail even when the caller is
+UID 0; it is a grave security error to omit checking for a failure return
+from \fBsetuid\fP().
.SH エラー
.TP
\fBEAGAIN\fP
-\fIuid\fP が現在のユーザー ID とマッチせず、この \fIuid\fP によってプロセスがリソース上限 \fBRLIMIT_NPROC\fP を超えた。
+The call would change the caller's real UID (i.e., \fIuid\fP does not match the
+caller's real UID), but there was a temporary failure allocating the
+necessary kernel data structures.
+.TP
+\fBEAGAIN\fP
+\fIuid\fP does not match the real user ID of the caller and this call would
+bring the number of processes belonging to the real user ID \fIuid\fP over the
+caller's \fBRLIMIT_NPROC\fP resource limit. Since Linux 3.1, this error case
+no longer occurs (but robust applications should check for this error); see
+the description of \fBEAGAIN\fP in \fBexecve\fP(2).
+.TP
+\fBEINVAL\fP
+The user ID specified in \fIuid\fP is not valid in this user namespace.
.TP
\fBEPERM\fP
ユーザーが特権を持たず (Linux では \fBCAP_SETUID\fP ケーパビリティ (capability) を持たず)、 \fIuid\fP
カーネルバージョンによるこの違いを吸収している。
.SH 関連項目
\fBgetuid\fP(2), \fBseteuid\fP(2), \fBsetfsuid\fP(2), \fBsetreuid\fP(2),
-\fBcapabilities\fP(7), \fBcredentials\fP(7)
+\fBcapabilities\fP(7), \fBcredentials\fP(7), \fBuser_namespaces\fP(7)
.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.68 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.75 の一部
である。プロジェクトの説明とバグ報告に関する情報は
http://www.kernel.org/doc/man\-pages/ に書かれている。