Files
oldlinux-files/Minix/2.0.0/wwwman/man2/setuid.2.html
2024-02-19 00:21:39 -05:00

74 lines
1.7 KiB
HTML

<HTML>
<HEAD>
<TITLE>setuid(2)</TITLE>
</HEAD>
<BODY>
<H1>setuid(2)</H1>
<HR>
<PRE>
</PRE>
<H2>NAME</H2><PRE>
setuid, setgid - set user or group ID's
</PRE>
<H2>SYNOPSIS</H2><PRE>
<STRONG>#include</STRONG> <STRONG>&lt;sys/types.h&gt;</STRONG>
<STRONG>int</STRONG> <STRONG>setuid(uid_t</STRONG> <EM>uid</EM><STRONG>)</STRONG>
<STRONG>int</STRONG> <STRONG>setgid(gid_t</STRONG> <EM>gid</EM><STRONG>)</STRONG>
</PRE>
<H2>DESCRIPTION</H2><PRE>
<STRONG>Setuid</STRONG> sets the real and effective user ID's of the current process to
<EM>uid</EM>. Unprivileged users may only change both user ID's to the real user
ID; only the super-user may make other changes. <STRONG>Setgid</STRONG> does the same for
the real and effective group ID's.
Minix-vmd allows an unprivileged user to change ID's to the original real
or effective ID as they were at the time the process was executed.
<STRONG>Setgid</STRONG> may also set the group ID's to any of the additional group ID's.
If one of the remembered user ID's was 0 then any user or group ID may be
chosen.
</PRE>
<H2>RETURN VALUE</H2><PRE>
Upon successful completion, a value of 0 is returned. Otherwise, a value
of -1 is returned and <STRONG>errno</STRONG> is set to indicate the error.
</PRE>
<H2>ERRORS</H2><PRE>
[EPERM] The current process is not the super-user and a change
other than one of the allowed changes was attempted.
</PRE>
<H2>SEE ALSO</H2><PRE>
<STRONG><A HREF="../man2/getuid.2.html">getuid(2)</A></STRONG>, <STRONG><A HREF="../man2/getgid.2.html">getgid(2)</A></STRONG>.
</PRE>
</BODY>
</HTML>