diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-01-09 14:37:25 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2006-01-09 14:37:25 +0000 |
commit | a9c1fdc3381cc408c6be8d3466fa9354ddf0e6d1 (patch) | |
tree | 8e07444a2d0e349ea5640e05a853a6693622fb7e | |
parent | f9a697506f53e06183c8d67f51cab1b8830097f8 (diff) | |
download | ATCD-a9c1fdc3381cc408c6be8d3466fa9354ddf0e6d1.tar.gz |
ChangeLogTag: Mon Jan 9 14:14:12 UTC UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | ace/OS_NS_stdio.inl | 2 | ||||
-rw-r--r-- | ace/OS_NS_unistd.h | 12 | ||||
-rw-r--r-- | ace/OS_NS_unistd.inl | 102 | ||||
-rw-r--r-- | ace/config-integritySCA.h | 2 | ||||
-rw-r--r-- | ace/config-psos-diab-mips.h | 2 | ||||
-rw-r--r-- | ace/config-psos-diab-ppc.h | 2 | ||||
-rw-r--r-- | ace/config-psos-diab.h | 2 | ||||
-rw-r--r-- | ace/config-psos-tm.h | 2 | ||||
-rw-r--r-- | ace/config-vxworks5.x.h | 4 | ||||
-rw-r--r-- | ace/config-vxworks6.1.h | 4 | ||||
-rw-r--r-- | ace/config-vxworks6.2.h | 2 | ||||
-rw-r--r-- | ace/config-win32-common.h | 2 |
12 files changed, 114 insertions, 24 deletions
diff --git a/ace/OS_NS_stdio.inl b/ace/OS_NS_stdio.inl index 5bfb131b22e..952d9ce5560 100644 --- a/ace/OS_NS_stdio.inl +++ b/ace/OS_NS_stdio.inl @@ -495,7 +495,7 @@ ACE_INLINE char * ACE_OS::cuserid (char *user, size_t maxlen) { ACE_OS_TRACE ("ACE_OS::cuserid"); -#if defined (VXWORKS) +#if defined (ACE_VXWORKS) ACE_UNUSED_ARG (maxlen); if (user == 0) { diff --git a/ace/OS_NS_unistd.h b/ace/OS_NS_unistd.h index 43157b80266..680c97b7aed 100644 --- a/ace/OS_NS_unistd.h +++ b/ace/OS_NS_unistd.h @@ -153,6 +153,9 @@ namespace ACE_OS gid_t getgid (void); ACE_NAMESPACE_INLINE_FUNCTION + gid_t getegid (void); + + ACE_NAMESPACE_INLINE_FUNCTION int getopt (int argc, char *const *argv, const char *optstring); @@ -172,6 +175,9 @@ namespace ACE_OS ACE_NAMESPACE_INLINE_FUNCTION uid_t getuid (void); + ACE_NAMESPACE_INLINE_FUNCTION + uid_t geteuid (void); + // should call gethostname() ACE_NAMESPACE_INLINE_FUNCTION int hostname (char *name, @@ -261,6 +267,9 @@ namespace ACE_OS int setgid (gid_t); ACE_NAMESPACE_INLINE_FUNCTION + int setegid (gid_t); + + ACE_NAMESPACE_INLINE_FUNCTION int setpgid (pid_t pid, pid_t pgid); ACE_NAMESPACE_INLINE_FUNCTION @@ -276,6 +285,9 @@ namespace ACE_OS int setuid (uid_t); ACE_NAMESPACE_INLINE_FUNCTION + int seteuid (uid_t); + + ACE_NAMESPACE_INLINE_FUNCTION int sleep (u_int seconds); ACE_NAMESPACE_INLINE_FUNCTION diff --git a/ace/OS_NS_unistd.inl b/ace/OS_NS_unistd.inl index ec9ab8d1830..a5826bee83c 100644 --- a/ace/OS_NS_unistd.inl +++ b/ace/OS_NS_unistd.inl @@ -265,7 +265,7 @@ ACE_OS::dup (ACE_HANDLE handle) else ACE_FAIL_RETURN (ACE_INVALID_HANDLE); /* NOTREACHED */ -#elif defined (VXWORKS) || defined (ACE_PSOS) +#elif defined (ACE_VXWORKS) || defined (ACE_PSOS) ACE_UNUSED_ARG (handle); ACE_NOTSUP_RETURN (-1); #elif defined (ACE_HAS_WINCE) @@ -551,13 +551,27 @@ ACE_INLINE gid_t ACE_OS::getgid (void) { ACE_OS_TRACE ("ACE_OS::getgid"); -#if defined (VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) +#if defined (ACE_VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) // getgid() is not supported: just one user anyways return 0; # elif defined (ACE_WIN32) || defined (CHORUS) ACE_NOTSUP_RETURN (static_cast<gid_t> (-1)); # else - ACE_OSCALL_RETURN (::getgid (), gid_t, (gid_t) -1); + ACE_OSCALL_RETURN (::getgid (), gid_t, static_cast<gid_t> (-1)); +# endif /* VXWORKS || ACE_PSOS */ +} + +ACE_INLINE gid_t +ACE_OS::getegid (void) +{ + ACE_OS_TRACE ("ACE_OS::getegid"); +#if defined (ACE_VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) + // getegid() is not supported: just one user anyways + return 0; +# elif defined (ACE_WIN32) || defined (CHORUS) + ACE_NOTSUP_RETURN (static_cast<gid_t> (-1)); +# else + ACE_OSCALL_RETURN (::getegid (), gid_t, static_cast<gid_t> (-1)); # endif /* VXWORKS || ACE_PSOS */ } @@ -565,7 +579,7 @@ ACE_INLINE int ACE_OS::getopt (int argc, char *const *argv, const char *optstring) { ACE_OS_TRACE ("ACE_OS::getopt"); -#if defined (VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) || defined (ACE_WIN32) +#if defined (ACE_LACKS_GETOPT) ACE_UNUSED_ARG (argc); ACE_UNUSED_ARG (argv); ACE_UNUSED_ARG (optstring); @@ -582,7 +596,7 @@ ACE_OS::getpgid (pid_t pid) #if defined (ACE_LACKS_GETPGID) ACE_UNUSED_ARG (pid); ACE_NOTSUP_RETURN (-1); -#elif defined (VXWORKS) || defined (ACE_PSOS) +#elif defined (ACE_VXWORKS) || defined (ACE_PSOS) // getpgid() is not supported, only one process anyway. ACE_UNUSED_ARG (pid); return 0; @@ -603,9 +617,8 @@ ACE_OS::getpid (void) // ACE_OS_TRACE ("ACE_OS::getpid"); #if defined (ACE_WIN32) return ::GetCurrentProcessId (); -#elif defined (VXWORKS) || defined (ACE_PSOS) - // getpid() is not supported: just one process anyways - return 0; +#elif defined (ACE_LACKS_GETPID) + ACE_NOTSUP_RETURN (-1); #elif defined (CHORUS) return (pid_t) (::agetId ()); #else @@ -619,9 +632,6 @@ ACE_OS::getppid (void) ACE_OS_TRACE ("ACE_OS::getppid"); #if defined (ACE_LACKS_GETPPID) ACE_NOTSUP_RETURN (-1); -#elif defined (VXWORKS) || defined (ACE_PSOS) - // getppid() is not supported, only one process anyway. - return 0; #else ACE_OSCALL_RETURN (::getppid (), pid_t, -1); #endif /* ACE_LACKS_GETPPID */ @@ -631,13 +641,27 @@ ACE_INLINE uid_t ACE_OS::getuid (void) { ACE_OS_TRACE ("ACE_OS::getuid"); -#if defined (VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) +#if defined (ACE_VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) // getuid() is not supported: just one user anyways return 0; # elif defined (ACE_WIN32) || defined (CHORUS) ACE_NOTSUP_RETURN (static_cast<uid_t> (-1)); # else - ACE_OSCALL_RETURN (::getuid (), uid_t, (uid_t) -1); + ACE_OSCALL_RETURN (::getuid (), uid_t, static_cast<uid_t> (-1)); +# endif /* VXWORKS || ACE_PSOS */ +} + +ACE_INLINE uid_t +ACE_OS::geteuid (void) +{ + ACE_OS_TRACE ("ACE_OS::geteuid"); +#if defined (ACE_VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) + // geteuid() is not supported: just one user anyways + return 0; +# elif defined (ACE_WIN32) || defined (CHORUS) + ACE_NOTSUP_RETURN (static_cast<uid_t> (-1)); +# else + ACE_OSCALL_RETURN (::geteuid (), uid_t, (uid_t) -1); # endif /* VXWORKS || ACE_PSOS */ } @@ -657,7 +681,7 @@ ACE_OS::hostname (char name[], size_t maxnamelen) ACE_UNUSED_ARG (maxnamelen); ACE_NOTSUP_RETURN (-1); # endif /* ACE_HAS_PHARLAP_RT */ -#elif defined (VXWORKS) || defined (ACE_HAS_WINCE) +#elif defined (ACE_VXWORKS) || defined (ACE_HAS_WINCE) ACE_OSCALL_RETURN (::gethostname (name, maxnamelen), int, -1); #elif defined (ACE_WIN32) if (::gethostname (name, maxnamelen) == 0) @@ -939,7 +963,7 @@ ACE_INLINE int ACE_OS::pipe (ACE_HANDLE fds[]) { ACE_OS_TRACE ("ACE_OS::pipe"); -# if defined (VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) +# if defined (ACE_VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) ACE_UNUSED_ARG (fds); ACE_NOTSUP_RETURN (-1); # else @@ -979,7 +1003,7 @@ ACE_INLINE int ACE_OS::setgid (gid_t gid) { ACE_OS_TRACE ("ACE_OS::setgid"); -#if defined (VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) +#if defined (ACE_VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) // setgid() is not supported: just one user anyways ACE_UNUSED_ARG (gid); return 0; @@ -992,6 +1016,22 @@ ACE_OS::setgid (gid_t gid) } ACE_INLINE int +ACE_OS::setegid (gid_t gid) +{ + ACE_OS_TRACE ("ACE_OS::setegid"); +#if defined (ACE_VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) + // setegid() is not supported: just one user anyways + ACE_UNUSED_ARG (gid); + return 0; +# elif defined (ACE_WIN32) || defined (CHORUS) + ACE_UNUSED_ARG (gid); + ACE_NOTSUP_RETURN (-1); +# else + ACE_OSCALL_RETURN (::setegid (gid), int, -1); +# endif /* VXWORKS || ACE_PSOS */ +} + +ACE_INLINE int ACE_OS::setpgid (pid_t pid, pid_t pgid) { ACE_OS_TRACE ("ACE_OS::setpgid"); @@ -999,7 +1039,7 @@ ACE_OS::setpgid (pid_t pid, pid_t pgid) ACE_UNUSED_ARG (pid); ACE_UNUSED_ARG (pgid); ACE_NOTSUP_RETURN (-1); -#elif defined (VXWORKS) || defined (ACE_PSOS) +#elif defined (ACE_VXWORKS) || defined (ACE_PSOS) // <setpgid> is not supported, only one process anyway. ACE_UNUSED_ARG (pid); ACE_UNUSED_ARG (pgid); @@ -1017,7 +1057,7 @@ ACE_OS::setregid (gid_t rgid, gid_t egid) ACE_UNUSED_ARG (rgid); ACE_UNUSED_ARG (egid); ACE_NOTSUP_RETURN (-1); -#elif defined (VXWORKS) || defined (ACE_PSOS) +#elif defined (ACE_VXWORKS) || defined (ACE_PSOS) // <setregid> is not supported, only one process anyway. ACE_UNUSED_ARG (rgid); ACE_UNUSED_ARG (egid); @@ -1035,7 +1075,7 @@ ACE_OS::setreuid (uid_t ruid, uid_t euid) ACE_UNUSED_ARG (ruid); ACE_UNUSED_ARG (euid); ACE_NOTSUP_RETURN (-1); -#elif defined (VXWORKS) || defined (ACE_PSOS) +#elif defined (ACE_VXWORKS) || defined (ACE_PSOS) // <setpgid> is not supported, only one process anyway. ACE_UNUSED_ARG (ruid); ACE_UNUSED_ARG (euid); @@ -1051,7 +1091,7 @@ ACE_OS::setsid (void) ACE_OS_TRACE ("ACE_OS::setsid"); #if defined (ACE_LACKS_SETSID) ACE_NOTSUP_RETURN (-1); -#elif defined (VXWORKS) || defined (ACE_PSOS) +#elif defined (ACE_VXWORKS) || defined (ACE_PSOS) // <setsid> is not supported, only one process anyway. return 0; #else @@ -1063,7 +1103,7 @@ ACE_INLINE int ACE_OS::setuid (uid_t uid) { ACE_OS_TRACE ("ACE_OS::setuid"); -#if defined (VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) +#if defined (ACE_VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) // setuid() is not supported: just one user anyways ACE_UNUSED_ARG (uid); return 0; @@ -1076,6 +1116,22 @@ ACE_OS::setuid (uid_t uid) } ACE_INLINE int +ACE_OS::seteuid (uid_t uid) +{ + ACE_OS_TRACE ("ACE_OS::seteuid"); +#if defined (ACE_VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) + // seteuid() is not supported: just one user anyways + ACE_UNUSED_ARG (uid); + return 0; +# elif defined (ACE_WIN32) || defined(CHORUS) + ACE_UNUSED_ARG (uid); + ACE_NOTSUP_RETURN (-1); +# else + ACE_OSCALL_RETURN (::seteuid (uid), int, -1); +# endif /* VXWORKS || ACE_PSOS */ +} + +ACE_INLINE int ACE_OS::sleep (u_int seconds) { ACE_OS_TRACE ("ACE_OS::sleep"); @@ -1162,12 +1218,12 @@ ACE_INLINE long ACE_OS::sysconf (int name) { ACE_OS_TRACE ("ACE_OS::sysconf"); -#if defined (ACE_WIN32) || defined (VXWORKS) || defined (ACE_PSOS) || defined (INTEGRITY) +#if defined (ACE_LACKS_SYSCONF) ACE_UNUSED_ARG (name); ACE_NOTSUP_RETURN (-1); #else ACE_OSCALL_RETURN (::sysconf (name), long, -1); -#endif /* ACE_WIN32 || VXWORKS || ACE_PSOS */ +#endif /* ACE_LACKS_SYSCONF */ } ACE_INLINE long diff --git a/ace/config-integritySCA.h b/ace/config-integritySCA.h index 9882845af62..26011cfbea0 100644 --- a/ace/config-integritySCA.h +++ b/ace/config-integritySCA.h @@ -131,6 +131,8 @@ #define ACE_LACKS_STRRECVFD #define ACE_LACKS_WRITEV #define ACE_LACKS_READV +#define ACE_LACKS_SYSCONF +#define ACE_LACKS_GETOPT /* below refers to fcntl style locking */ #define ACE_LACKS_FILELOCKS diff --git a/ace/config-psos-diab-mips.h b/ace/config-psos-diab-mips.h index da4f190ad13..37c50cc59d4 100644 --- a/ace/config-psos-diab-mips.h +++ b/ace/config-psos-diab-mips.h @@ -36,6 +36,8 @@ #define ACE_LACKS_ASSERT_MACRO +#define ACE_LACKS_GETOPT +#define ACE_LACKS_SYSCONF #define ACE_LACKS_WAIT #define ACE_LACKS_WAITPID #define ACE_LACKS_SIGSET diff --git a/ace/config-psos-diab-ppc.h b/ace/config-psos-diab-ppc.h index 38842dae1bf..bc972d6324f 100644 --- a/ace/config-psos-diab-ppc.h +++ b/ace/config-psos-diab-ppc.h @@ -41,6 +41,8 @@ # define ACE_HAS_EXCEPTIONS #endif /* __GNUG__ */ +#define ACE_LACKS_GETOPT +#define ACE_LACKS_SYSCONF #define ACE_LACKS_WAIT #define ACE_LACKS_WAITPID #define ACE_PSOS_LACKS_PREPC diff --git a/ace/config-psos-diab.h b/ace/config-psos-diab.h index 92fe1130d7e..95df04efdd7 100644 --- a/ace/config-psos-diab.h +++ b/ace/config-psos-diab.h @@ -38,6 +38,7 @@ #endif /* __GNUG__ */ #define ACE_PSOS_LACKS_PREPC +#define ACE_LACKS_SYSCONF #define ACE_PSOS_HAS_TIME @@ -160,6 +161,7 @@ #define ACE_LACKS_LONGLONG_T +#define ACE_LACKS_GETOPT #define ACE_LACKS_LSTAT #define ACE_LACKS_MADVISE diff --git a/ace/config-psos-tm.h b/ace/config-psos-tm.h index bd788c49791..3eb547e3466 100644 --- a/ace/config-psos-tm.h +++ b/ace/config-psos-tm.h @@ -173,6 +173,8 @@ #define ACE_LACKS_UCONTEXT_H #define ACE_LACKS_UNIX_SIGNALS +#define ACE_LACKS_SYSCONF +#define ACE_LACKS_GETOPT #define ACE_PAGE_SIZE 4096 diff --git a/ace/config-vxworks5.x.h b/ace/config-vxworks5.x.h index 8a97a080bfa..8fdd23878e5 100644 --- a/ace/config-vxworks5.x.h +++ b/ace/config-vxworks5.x.h @@ -146,6 +146,9 @@ #define ACE_LACKS_FORK #define ACE_LACKS_FSYNC #define ACE_LACKS_GETHOSTENT +#define ACE_LACKS_GETOPT +#define ACE_LACKS_GETPID +#define ACE_LACKS_GETPPID #define ACE_LACKS_GETSERVBYNAME #define ACE_LACKS_KEY_T #define ACE_LACKS_LSTAT @@ -176,6 +179,7 @@ #define ACE_LACKS_STRCASECMP #define ACE_LACKS_STRRECVFD #define ACE_LACKS_SYSCALL +#define ACE_LACKS_SYSCONF #define ACE_LACKS_SYSV_SHMEM #define ACE_LACKS_TELLDIR #define ACE_LACKS_TEMPNAM diff --git a/ace/config-vxworks6.1.h b/ace/config-vxworks6.1.h index 1394429ff3a..4168fc9d80b 100644 --- a/ace/config-vxworks6.1.h +++ b/ace/config-vxworks6.1.h @@ -125,6 +125,9 @@ #define ACE_LACKS_FORK #define ACE_LACKS_FSYNC #define ACE_LACKS_GETHOSTENT +#define ACE_LACKS_GETOPT +#define ACE_LACKS_GETPID +#define ACE_LACKS_GETPPID #define ACE_LACKS_GETSERVBYNAME #define ACE_LACKS_KEY_T #define ACE_LACKS_LSTAT @@ -154,6 +157,7 @@ #define ACE_LACKS_STRRECVFD #define ACE_LACKS_SYSCALL #define ACE_LACKS_SYSV_SHMEM +#define ACE_LACKS_SYSCONF #define ACE_LACKS_TELLDIR #define ACE_LACKS_TEMPNAM #define ACE_LACKS_TIMESPEC_T diff --git a/ace/config-vxworks6.2.h b/ace/config-vxworks6.2.h index 618b6d8d97f..a63ab74e616 100644 --- a/ace/config-vxworks6.2.h +++ b/ace/config-vxworks6.2.h @@ -224,6 +224,8 @@ #define ACE_MKDIR_LACKS_MODE #define ACE_HAS_SIZET_PTR_ASCTIME_R_AND_CTIME_R #define ACE_LACKS_SEARCH_H + #define ACE_LACKS_SYSCONF + #define ACE_LACKS_GETPID #endif // It is possible to enable pthread support with VxWorks, when the user decides diff --git a/ace/config-win32-common.h b/ace/config-win32-common.h index f0f2f9f5746..a31f385562c 100644 --- a/ace/config-win32-common.h +++ b/ace/config-win32-common.h @@ -239,6 +239,7 @@ #define ACE_LACKS_DUP2 #define ACE_LACKS_FORK #define ACE_LACKS_GETHOSTENT +#define ACE_LACKS_GETOPT #define ACE_LACKS_INET_ATON #define ACE_LACKS_MADVISE #define ACE_LACKS_MKFIFO @@ -254,6 +255,7 @@ #define ACE_LACKS_SIGSET #define ACE_LACKS_SOCKETPAIR #define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_SYSCONF #define ACE_LACKS_SYSV_SHMEM #define ACE_LACKS_UNISTD_H #define ACE_LACKS_UNIX_SIGNALS |