syscalls_69.html

来自「Linux系统调用」· HTML 代码 · 共 31 行

HTML
31
字号
<!-- This HTML file has been created by texi2html 1.29
     from syscalls.texi on 4 June 1994 -->

<TITLE>Syscall specifications of Linux - setuid</TITLE>
<P>Go to the <A HREF="syscalls_68.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_68.html">previous</A>, <A HREF="syscalls_70.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_70.html">next</A> section.<P>
<H2><A NAME="SEC69" HREF="syscalls_toc.html#SEC69" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_toc.html#SEC69">setuid</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int setuid(gid_t <VAR>uid</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>uid</VAR>: [in] the new uid.
<P>
<H3>DESCRIPTION</H3>
<P>
If the calling task does not have superuser privileges, it may use
<CODE>setuid</CODE> to sets its effective uid to its saved uid or its real uid
(other values are illegal). If the calling task has superuser
privileges, the real, effective and saved uids are set to <VAR>uid</VAR>.
<P>
<H3>RETURN VALUE</H3>
<P>
On success, returns 0. On error, returns -1 and <CODE>errno</CODE> is set
to one of the following values: <CODE>EPERM</CODE>: the <VAR>uid</VAR> is not the
real uid or the saved uid of the task and the task does not have
superuser privileges.
<P>
<P>Go to the <A HREF="syscalls_68.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_68.html">previous</A>, <A HREF="syscalls_70.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_70.html">next</A> section.<P>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?