syscalls_66.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 - setgid</TITLE>
<P>Go to the <A HREF="syscalls_65.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_65.html">previous</A>, <A HREF="syscalls_67.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_67.html">next</A> section.<P>
<H2><A NAME="SEC66" HREF="syscalls_toc.html#SEC66" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_toc.html#SEC66">setgid</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int setgid(gid_t <VAR>gid</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>gid</VAR>: [in] the new gid.
<P>
<H3>DESCRIPTION</H3>
<P>
If the calling task does not have superuser privileges, it may use
<CODE>setgid</CODE> to sets its effective gid to its saved gid or its real gid
(other values are illegal). If the calling task has superuser
privileges, the real, effective and saved gids are set to <VAR>gid</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>gid</VAR> is not the
real gid or the saved gid of the task and the task does not have
superuser privileges.
<P>
<P>Go to the <A HREF="syscalls_65.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_65.html">previous</A>, <A HREF="syscalls_67.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_67.html">next</A> section.<P>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?