00001
00002
00003
00004
00005 #include "ace/OS_NS_errno.h"
00006
00007 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00008
00009
00010
00011 ACE_INLINE void
00012 ACE_OS::endpwent (void)
00013 {
00014 #if !defined (ACE_LACKS_PWD_FUNCTIONS)
00015 ::endpwent ();
00016 #endif
00017 }
00018
00019 ACE_INLINE struct passwd *
00020 ACE_OS::getpwent (void)
00021 {
00022 #if !defined (ACE_LACKS_PWD_FUNCTIONS)
00023 return ::getpwent ();
00024 #else
00025 ACE_NOTSUP_RETURN (0);
00026 #endif
00027 }
00028
00029 ACE_INLINE struct passwd *
00030 ACE_OS::getpwnam (const char *name)
00031 {
00032 #if !defined (ACE_LACKS_PWD_FUNCTIONS)
00033 return ::getpwnam (name);
00034 # else
00035 ACE_UNUSED_ARG (name);
00036 ACE_NOTSUP_RETURN (0);
00037 #endif
00038 }
00039
00040 ACE_INLINE struct passwd *
00041 ACE_OS::getpwnam_r (const char *name, struct passwd *pwent,
00042 char *buffer, int buflen)
00043 {
00044 #if defined (ACE_HAS_POSIX_GETPWNAM_R)
00045 struct passwd *result = 0;
00046
00047 int const status = ::getpwnam_r (name, pwent, buffer, buflen, &result);
00048
00049 if (status != 0)
00050 {
00051 errno = status;
00052 result = 0;
00053 }
00054 return result;
00055 #elif !defined (ACE_LACKS_PWD_FUNCTIONS)
00056 # if defined (ACE_HAS_REENTRANT_FUNCTIONS)
00057 # if !defined (ACE_LACKS_PWD_REENTRANT_FUNCTIONS)
00058 # if defined (ACE_HAS_PTHREADS_STD) && \
00059 !defined (ACE_HAS_STHREADS) || \
00060 defined (HPUX_11) || \
00061 defined (__USLC__) // Added by Roland Gigler for SCO UnixWare 7.
00062 struct passwd *result;
00063 int status;
00064 # if defined (DIGITAL_UNIX)
00065 ::_Pgetpwnam_r (name, pwent, buffer, buflen, &result);
00066 # else
00067
00068
00069 # if defined (__IBMCPP__) && (__IBMCPP__ >= 400)
00070 status = _posix_getpwnam_r (name, pwent, buffer, buflen, &result);
00071 # else
00072 status = ::getpwnam_r (name, pwent, buffer, buflen, &result);
00073 # endif
00074 if (status != 0)
00075 {
00076 errno = status;
00077 result = 0;
00078 }
00079 # endif
00080 return result;
00081 # elif defined (AIX)
00082 if (::getpwnam_r (name, pwent, buffer, buflen) == -1)
00083 return 0;
00084 else
00085 return pwent;
00086 # else
00087 return ::getpwnam_r (name, pwent, buffer, buflen);
00088 # endif
00089 # else
00090 ACE_UNUSED_ARG (name);
00091 ACE_UNUSED_ARG (pwent);
00092 ACE_UNUSED_ARG (buffer);
00093 ACE_UNUSED_ARG (buflen);
00094 ACE_NOTSUP_RETURN (0);
00095 # endif
00096 # else
00097 ACE_UNUSED_ARG (name);
00098 ACE_UNUSED_ARG (pwent);
00099 ACE_UNUSED_ARG (buffer);
00100 ACE_UNUSED_ARG (buflen);
00101 ACE_NOTSUP_RETURN (0);
00102 # endif
00103 #else
00104 ACE_UNUSED_ARG (name);
00105 ACE_UNUSED_ARG (pwent);
00106 ACE_UNUSED_ARG (buffer);
00107 ACE_UNUSED_ARG (buflen);
00108 ACE_NOTSUP_RETURN (0);
00109 #endif
00110 }
00111
00112 ACE_INLINE void
00113 ACE_OS::setpwent (void)
00114 {
00115 #if !defined (ACE_LACKS_PWD_FUNCTIONS)
00116 ::setpwent ();
00117 #endif
00118 }
00119
00120 ACE_END_VERSIONED_NAMESPACE_DECL