summaryrefslogtreecommitdiff
path: root/PACE/pace/pwd.h
blob: b8d7b1c46d07942100ced55d7ed455905bc98ff2 (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
/* $Id$

 * ============================================================================
 *
 * = LIBRARY
 *    pace
 *
 * = FILENAME
 *    pwd.h
 *
 * = AUTHOR
 *    Luther Baker
 *
 * ============================================================================ */


#ifndef PACE_PWD_H
#define PACE_PWD_H


#include "pace/defines.h"
#include <pwd.h>

/* Linux wants to use sys/types.h to define uid_t.
 * Sun is happy with pwd.h.
 */
# if defined (linux)
# include "pace/sys/types.h"
# endif /* linux */


# if defined (PACE_HAS_CPLUSPLUS)
extern "C" {
# endif /* PACE_HAS_CPLUSPLUS */

  PACE_INLINE struct passwd * pace_getpwuid (uid_t uid);

  PACE_INLINE int pace_getpwuid_r (uid_t uid,
                                   struct passwd * pwd,
                                   char * buffer,
                                   size_t bufsize,
                                   struct passwd ** result);
  /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */

  PACE_INLINE struct passwd * pace_getpwnam (const char * name);

  PACE_INLINE int pace_getpwnam_r (const char * name,
                                   struct passwd * pwd,
                                   char * buffer,
                                   size_t bufsize,
                                   struct passwd ** result);
  /* Requires PACE_HAS_POSIX_PTHREAD_SEMANTICS. */

# if defined (PACE_HAS_CPLUSPLUS)
}
# endif /* PACE_HAS_CPLUSPLUS */

# if defined (PACE_HAS_INLINE)
# include "pwd.inl"
# endif /* PACE_HAS_INLINE */


#endif /* PACE_PWD_H */