diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2000-01-08 02:39:47 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2000-01-08 02:39:47 +0000 |
commit | 196f6ac3d9ddf4915705f9a5b9187c7078285737 (patch) | |
tree | 66ccf80f2b4873788cf46da981d1a943f401ab03 /ace/OS.i | |
parent | a03625406292cf226978bdb1132f8e27013e8b81 (diff) | |
download | ATCD-196f6ac3d9ddf4915705f9a5b9187c7078285737.tar.gz |
ChangeLogTag:Fri Jan 7 20:01:48 2000 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
Diffstat (limited to 'ace/OS.i')
-rw-r--r-- | ace/OS.i | 49 |
1 files changed, 46 insertions, 3 deletions
@@ -1,7 +1,6 @@ // -*- C++ -*- // $Id$ - #if !defined (ACE_HAS_INLINED_OSCALLS) # undef ACE_INLINE # define ACE_INLINE @@ -50,6 +49,14 @@ typedef char *ACE_SOCKOPT_TYPE1; typedef const char *ACE_SOCKOPT_TYPE1; #endif /* ACE_HAS_VOIDPTR_SOCKOPT */ +#if defined (ACE_LACKS_SETREUID_PROTOTYPE) +extern int setreuid (uid_t ruid, uid_t euid); +#endif /* ACE_LACKS_SETREUID_PROTOTYPE */ + +#if defined (ACE_LACKS_SETREGID_PROTOTYPE) +extern int setregid (gid_t rgid, gid_t egid); +#endif /* ACE_LACKS_SETREGID_PROTOTYPE */ + #if defined (ACE_LACKS_WRITEV) extern "C" ACE_Export int writev (ACE_HANDLE handle, ACE_WRITEV_TYPE *iov, int iovcnt); #endif /* ACE_LACKS_WRITEV */ @@ -10471,12 +10478,48 @@ ACE_OS::setpgid (pid_t pid, pid_t pgid) ACE_UNUSED_ARG (pgid); ACE_NOTSUP_RETURN (-1); #elif defined (VXWORKS) || defined (ACE_PSOS) - // setpgid() is not supported, only one process anyway. + // <setpgid> is not supported, only one process anyway. ACE_UNUSED_ARG (pid); ACE_UNUSED_ARG (pgid); return 0; #else - ACE_OSCALL_RETURN (::setpgid (pid, pgid), pid_t, -1); + ACE_OSCALL_RETURN (::setpgid (pid, pgid), int, -1); +#endif /* ACE_WIN32 */ +} + +ACE_INLINE int +ACE_OS::setreuid (uid_t ruid, uid_t euid) +{ + ACE_TRACE ("ACE_OS::setreuid"); +#if defined (ACE_LACKS_SETREUID) + ACE_UNUSED_ARG (ruid); + ACE_UNUSED_ARG (euid); + ACE_NOTSUP_RETURN (-1); +#elif defined (VXWORKS) || defined (ACE_PSOS) + // <setpgid> is not supported, only one process anyway. + ACE_UNUSED_ARG (ruid); + ACE_UNUSED_ARG (euid); + return 0; +#else + ACE_OSCALL_RETURN (::setreuid (ruid, euid), int, -1); +#endif /* ACE_WIN32 */ +} + +ACE_INLINE int +ACE_OS::setregid (gid_t rgid, gid_t egid) +{ + ACE_TRACE ("ACE_OS::setregid"); +#if defined (ACE_LACKS_SETREGID) + ACE_UNUSED_ARG (rgid); + ACE_UNUSED_ARG (egid); + ACE_NOTSUP_RETURN (-1); +#elif defined (VXWORKS) || defined (ACE_PSOS) + // <setregid> is not supported, only one process anyway. + ACE_UNUSED_ARG (rgid); + ACE_UNUSED_ARG (egid); + return 0; +#else + ACE_OSCALL_RETURN (::setregid (rgid, egid), int, -1); #endif /* ACE_WIN32 */ } |