154 lines
3.6 KiB
HTML
154 lines
3.6 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of GETRESUID</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>GETRESUID</H1>
|
|
Section: Linux Programmer's Manual (2)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
getresuid, getresgid - get real, effective and saved user/group IDs
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>#define _GNU_SOURCE</B> /* See <A HREF="/cgi-bin/man/man2html?7+feature_test_macros">feature_test_macros</A>(7) */
|
|
|
|
<BR>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/unistd.h">unistd.h</A>></B>
|
|
|
|
<P>
|
|
|
|
<B>int getresuid(uid_t *</B><I>ruid</I><B>, uid_t *</B><I>euid</I><B>, uid_t *</B><I>suid</I><B>);</B>
|
|
|
|
<BR>
|
|
|
|
<B>int getresgid(gid_t *</B><I>rgid</I><B>, gid_t *</B><I>egid</I><B>, gid_t *</B><I>sgid</I><B>);</B>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>getresuid</B>()
|
|
|
|
returns the real UID, the effective UID, and the saved set-user-ID
|
|
of the calling process, in the arguments
|
|
<I>ruid</I>,
|
|
|
|
<I>euid</I>,
|
|
|
|
and
|
|
<I>suid</I>,
|
|
|
|
respectively.
|
|
<B>getresgid</B>()
|
|
|
|
performs the analogous task for the process's group IDs.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
On success, zero is returned.
|
|
On error, -1 is returned, and
|
|
<I>errno</I>
|
|
|
|
is set appropriately.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>ERRORS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>EFAULT</B>
|
|
|
|
<DD>
|
|
One of the arguments specified an address outside the calling program's
|
|
address space.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>VERSIONS</H2>
|
|
|
|
These system calls appeared on Linux starting with kernel 2.1.44.
|
|
<P>
|
|
|
|
The prototypes are given by glibc since version 2.3.2,
|
|
provided
|
|
<B>_GNU_SOURCE</B>
|
|
|
|
is defined.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
These calls are nonstandard;
|
|
they also appear on HP-UX and some of the BSDs.
|
|
<A NAME="lbAI"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
The original Linux
|
|
<B>getresuid</B>()
|
|
|
|
and
|
|
<B>getresgid</B>()
|
|
|
|
system calls supported only 16-bit user and group IDs.
|
|
Subsequently, Linux 2.4 added
|
|
<B>getresuid32</B>()
|
|
|
|
and
|
|
<B>getresgid32</B>(),
|
|
|
|
supporting 32-bit IDs.
|
|
The glibc
|
|
<B>getresuid</B>()
|
|
|
|
and
|
|
<B>getresgid</B>()
|
|
|
|
wrapper functions transparently deal with the variations across kernel versions.
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+getuid">getuid</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+setresuid">setresuid</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+setreuid">setreuid</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+setuid">setuid</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+credentials">credentials</A></B>(7)
|
|
|
|
<A NAME="lbAK"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="2"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="3"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="4"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="5"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="6"><A HREF="#lbAF">ERRORS</A><DD>
|
|
<DT id="7"><A HREF="#lbAG">VERSIONS</A><DD>
|
|
<DT id="8"><A HREF="#lbAH">CONFORMING TO</A><DD>
|
|
<DT id="9"><A HREF="#lbAI">NOTES</A><DD>
|
|
<DT id="10"><A HREF="#lbAJ">SEE ALSO</A><DD>
|
|
<DT id="11"><A HREF="#lbAK">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:32 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|