X-Received: by 10.182.110.197 with SMTP id ic5mr2634727obb.5.1459510947460; Fri, 01 Apr 2016 04:42:27 -0700 (PDT) X-Received: by 10.50.43.234 with SMTP id z10mr43014igl.4.1459510943253; Fri, 01 Apr 2016 04:42:23 -0700 (PDT) Path: csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!nt3no6622021igb.0!news-out.google.com!ha2ni318igb.0!nntp.google.com!nt3no6622012igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.unix.programmer Date: Fri, 1 Apr 2016 04:42:22 -0700 (PDT) In-Reply-To: <6hudsc-q2f.ln1@wilbur.25thandClement.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=80.15.162.25; posting-account=2RofhQoAAAAWE8Ss1-uaVs7Vksv_Mj0I NNTP-Posting-Host: 80.15.162.25 References: <6hudsc-q2f.ln1@wilbur.25thandClement.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <02167dc4-c010-48b0-ad2e-059794456005@googlegroups.com> Subject: Re: Getting the saved set uid From: boon Injection-Date: Fri, 01 Apr 2016 11:42:27 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.unix.programmer:8291 On Thursday, March 24, 2016 at 9:30:07 PM UTC+1, wil...@wilbur.25thandclement.com wrote: > spud@potato.field wrote: > > On Wed, 23 Mar 2016 10:01:14 -0700 (PDT) > > Philip Guenther wrote: > >>On Wednesday, March 23, 2016 at 8:21:55 AM UTC-7, sp...@potato.field wrote: > >>> Is there a way in C of getting the current saved set user id (as set by > >>> seteuid()) ? > >> > >>Does your system have useful manpages? If so, "man -k" (also called > >>"apropos") can be a quick start to these questions: > > > > $ man getresgid > > No manual entry for getresgid > > $ man getresuid > > No manual entry for getresuid > > > > So, hows that sarcasm working out for you? > > > > Turns out those functions are non standard. Supported on Linux and hp-ux > > but thats about it. Not OS/X as you can see above. > > > > Are there posix functions that do the same? And yes I have googled already > > otherwise I wouldn't asking. > > You can download the POSIX specification for free from > > https://www2.opengroup.org/ogsys/catalog/c138 > > or just visit it online at > > http://pubs.opengroup.org/onlinepubs/9699919799/ > > The index of system interfaces is incomparably useful. Select "System > Interfaces" from the top-left frame, then "System Interfaces" in the > bottom-left frame. That gives you the full list of system interfaces (aka > syscalls and libc routines), and AFAICT there's nothing like getreuid > available. > > The history and rationale sections of related interface definitions often > provide useful information. As do other chapters in the Base Definitions and > System Interfaces volumes. For example, section 3.331 Saved Set-User-ID > directs you to the setuid and exec-family definitions for more information, > and indeed the rationale section of setuid contains much information about > the semantics of uids. > > If you're serious about C or Unix programming it would be prudent to have > local copies of the POSIX and C standards.[1] Once you become familiar with > them I think you'll find them much more convenient and reliable in general > than either man pages (especially the inconsistent Linux man pages), > Googling, or technical forums. Only once I know or suspect I'm dealing with > vendor extensions do I bother with anything else, and by then the standards > have framed things such that I'm much more productive when searching and > analyzing other sources. > > > [1] The draft C99 and C11 standards are freely available, and but for > inconsequential typos identical to the published standards. See > > http://www.open-std.org/jtc1/sc22/wg14/www/standards According to my manual page, sendto() conforms to POSIX.1-2001. Is this normal?