summaryrefslogtreecommitdiff
path: root/ACE/ace/OS_NS_pwd.inl
blob: 3353f649469cb9c1d588823b9447d478ffe29d44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// -*- C++ -*-
#include "ace/OS_NS_errno.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

// Accessors to PWD file.

ACE_INLINE void
ACE_OS::endpwent ()
{
#if !defined (ACE_LACKS_PWD_FUNCTIONS)
  ::endpwent ();
#endif /* ! ACE_LACKS_PWD_FUNCTIONS */
}

ACE_INLINE struct passwd *
ACE_OS::getpwent ()
{
#if !defined (ACE_LACKS_PWD_FUNCTIONS)
  return ::getpwent ();
#else
  ACE_NOTSUP_RETURN (0);
#endif /* ! ACE_LACKS_PWD_FUNCTIONS */
}

ACE_INLINE struct passwd *
ACE_OS::getpwnam (const char *name)
{
#if !defined (ACE_LACKS_PWD_FUNCTIONS)
  return ::getpwnam (name);
# else
  ACE_UNUSED_ARG (name);
  ACE_NOTSUP_RETURN (0);
#endif /* ACE_LACKS_PWD_FUNCTIONS */
}

ACE_INLINE int
ACE_OS::getpwnam_r (const char *name,
                    struct passwd *pwd,
                    char *buffer,
                    size_t bufsize,
                    struct passwd **result)
{
#if defined (ACE_LACKS_PWD_FUNCTIONS)
  ACE_UNUSED_ARG (name);
  ACE_UNUSED_ARG (pwd);
  ACE_UNUSED_ARG (buffer);
  ACE_UNUSED_ARG (bufsize);
  ACE_UNUSED_ARG (result);
  ACE_NOTSUP_RETURN (0);
#elif defined (ACE_HAS_STHREADS)
  if (::getpwnam_r (name, pwd, buffer, bufsize) != 0)
    {
      *result = 0;
      return -1;
    }
  *result = pwd;
  return 0;
#else
  return ::getpwnam_r (name, pwd, buffer, bufsize, result);
#endif /* ACE_LACKS_PWD_FUNCTIONS */
}

ACE_INLINE void
ACE_OS::setpwent ()
{
#if !defined (ACE_LACKS_PWD_FUNCTIONS)
  ::setpwent ();
#endif /* ! ACE_LACKS_PWD_FUNCTIONS */
}

ACE_END_VERSIONED_NAMESPACE_DECL