aboutsummaryrefslogtreecommitdiff
path: root/include/pwd_.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/pwd_.h')
-rw-r--r--include/pwd_.h53
1 files changed, 7 insertions, 46 deletions
diff --git a/include/pwd_.h b/include/pwd_.h
index 625b6f5a2..17348298a 100644
--- a/include/pwd_.h
+++ b/include/pwd_.h
@@ -34,69 +34,30 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
34#define setpwent bb_internal_setpwent 34#define setpwent bb_internal_setpwent
35#define endpwent bb_internal_endpwent 35#define endpwent bb_internal_endpwent
36#define getpwent bb_internal_getpwent 36#define getpwent bb_internal_getpwent
37#define fgetpwent bb_internal_fgetpwent
38#define putpwent bb_internal_putpwent
39#define getpwuid bb_internal_getpwuid 37#define getpwuid bb_internal_getpwuid
40#define getpwnam bb_internal_getpwnam 38#define getpwnam bb_internal_getpwnam
41#define getpwent_r bb_internal_getpwent_r
42#define getpwuid_r bb_internal_getpwuid_r
43#define getpwnam_r bb_internal_getpwnam_r 39#define getpwnam_r bb_internal_getpwnam_r
44#define fgetpwent_r bb_internal_fgetpwent_r
45
46 40
47/* All function names below should be remapped by #defines above 41/* All function names below should be remapped by #defines above
48 * in order to not collide with libc names. */ 42 * in order to not collide with libc names. */
49 43
50
51/* Rewind the password-file stream. */ 44/* Rewind the password-file stream. */
52extern void setpwent(void); 45void FAST_FUNC setpwent(void);
53 46
54/* Close the password-file stream. */ 47/* Close the password-file stream. */
55extern void endpwent(void); 48void FAST_FUNC endpwent(void);
56 49
57#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS
58/* Read an entry from the password-file stream, opening it if necessary. */ 50/* Read an entry from the password-file stream, opening it if necessary. */
59extern struct passwd *getpwent(void); 51struct passwd* FAST_FUNC getpwent(void);
60
61/* Read an entry from STREAM. */
62extern struct passwd *fgetpwent(FILE *__stream);
63
64/* Write the given entry onto the given stream. */
65extern int putpwent(const struct passwd *__restrict __p,
66 FILE *__restrict __f);
67#endif
68 52
69/* Search for an entry with a matching user ID. */ 53/* Search for an entry with a matching user ID. */
70extern struct passwd *getpwuid(uid_t __uid); 54struct passwd* FAST_FUNC getpwuid(uid_t __uid);
71 55
72/* Search for an entry with a matching username. */ 56/* Search for an entry with a matching username. */
73extern struct passwd *getpwnam(const char *__name); 57struct passwd* FAST_FUNC getpwnam(const char *__name);
74
75/* Reentrant versions of some of the functions above.
76
77 PLEASE NOTE: the `getpwent_r' function is not (yet) standardized.
78 The interface may change in later versions of this library. But
79 the interface is designed following the principals used for the
80 other reentrant functions so the chances are good this is what the
81 POSIX people would choose. */
82
83extern int getpwent_r(struct passwd *__restrict __resultbuf,
84 char *__restrict __buffer, size_t __buflen,
85 struct passwd **__restrict __result);
86
87extern int getpwuid_r(uid_t __uid,
88 struct passwd *__restrict __resultbuf,
89 char *__restrict __buffer, size_t __buflen,
90 struct passwd **__restrict __result);
91
92extern int getpwnam_r(const char *__restrict __name,
93 struct passwd *__restrict __resultbuf,
94 char *__restrict __buffer, size_t __buflen,
95 struct passwd **__restrict __result);
96 58
97/* Read an entry from STREAM. This function is not standardized and 59/* Reentrant versions of some of the functions above. */
98 probably never will. */ 60int FAST_FUNC getpwnam_r(const char *__restrict __name,
99extern int fgetpwent_r(FILE *__restrict __stream,
100 struct passwd *__restrict __resultbuf, 61 struct passwd *__restrict __resultbuf,
101 char *__restrict __buffer, size_t __buflen, 62 char *__restrict __buffer, size_t __buflen,
102 struct passwd **__restrict __result); 63 struct passwd **__restrict __result);