aboutsummaryrefslogtreecommitdiff
path: root/include/grp_.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/grp_.h')
-rw-r--r--include/grp_.h65
1 files changed, 6 insertions, 59 deletions
diff --git a/include/grp_.h b/include/grp_.h
index e5075e5a0..db13ce3b4 100644
--- a/include/grp_.h
+++ b/include/grp_.h
@@ -30,89 +30,36 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
30 * so that function calls are directed to bb_internal_XXX replacements 30 * so that function calls are directed to bb_internal_XXX replacements
31 */ 31 */
32#undef endgrent 32#undef endgrent
33#define setgrent bb_internal_setgrent
34#define endgrent bb_internal_endgrent 33#define endgrent bb_internal_endgrent
35#define getgrent bb_internal_getgrent
36#define fgetgrent bb_internal_fgetgrent
37#define putgrent bb_internal_putgrent
38#define getgrgid bb_internal_getgrgid 34#define getgrgid bb_internal_getgrgid
39#define getgrnam bb_internal_getgrnam 35#define getgrnam bb_internal_getgrnam
40#define getgrent_r bb_internal_getgrent_r
41#define getgrgid_r bb_internal_getgrgid_r
42#define getgrnam_r bb_internal_getgrnam_r
43#define fgetgrent_r bb_internal_fgetgrent_r
44#define getgrouplist bb_internal_getgrouplist 36#define getgrouplist bb_internal_getgrouplist
45#define initgroups bb_internal_initgroups 37#define initgroups bb_internal_initgroups
46 38
47
48/* All function names below should be remapped by #defines above 39/* All function names below should be remapped by #defines above
49 * in order to not collide with libc names. */ 40 * in order to not collide with libc names. */
50 41
51
52/* Rewind the group-file stream. */
53extern void setgrent(void);
54
55/* Close the group-file stream. */ 42/* Close the group-file stream. */
56extern void endgrent(void); 43void FAST_FUNC endgrent(void);
57
58#ifdef UNUSED_SINCE_WE_AVOID_STATIC_BUFS
59/* Read an entry from the group-file stream, opening it if necessary. */
60extern struct group *getgrent(void);
61
62/* Read a group entry from STREAM. */
63extern struct group *fgetgrent(FILE *__stream);
64
65/* Write the given entry onto the given stream. */
66extern int putgrent(const struct group *__restrict __p,
67 FILE *__restrict __f);
68#endif
69
70/* Search for an entry with a matching group ID. */
71extern struct group *getgrgid(gid_t __gid);
72
73/* Search for an entry with a matching group name. */
74extern struct group *getgrnam(const char *__name);
75
76/* Reentrant versions of some of the functions above.
77
78 PLEASE NOTE: the `getgrent_r' function is not (yet) standardized.
79 The interface may change in later versions of this library. But
80 the interface is designed following the principals used for the
81 other reentrant functions so the chances are good this is what the
82 POSIX people would choose. */
83
84extern int getgrent_r(struct group *__restrict __resultbuf,
85 char *__restrict __buffer, size_t __buflen,
86 struct group **__restrict __result);
87 44
88/* Search for an entry with a matching group ID. */ 45/* Search for an entry with a matching group ID. */
89extern int getgrgid_r(gid_t __gid, struct group *__restrict __resultbuf, 46struct group* FAST_FUNC getgrgid(gid_t __gid);
90 char *__restrict __buffer, size_t __buflen,
91 struct group **__restrict __result);
92 47
93/* Search for an entry with a matching group name. */ 48/* Search for an entry with a matching group name. */
94extern int getgrnam_r(const char *__restrict __name, 49struct group* FAST_FUNC getgrnam(const char *__name);
95 struct group *__restrict __resultbuf,
96 char *__restrict __buffer, size_t __buflen,
97 struct group **__restrict __result);
98 50
99/* Read a group entry from STREAM. This function is not standardized 51/* Reentrant versions of some of the functions above. */
100 an probably never will. */
101extern int fgetgrent_r(FILE *__restrict __stream,
102 struct group *__restrict __resultbuf,
103 char *__restrict __buffer, size_t __buflen,
104 struct group **__restrict __result);
105 52
106/* Store at most *NGROUPS members of the group set for USER into 53/* Store at most *NGROUPS members of the group set for USER into
107 *GROUPS. Also include GROUP. The actual number of groups found is 54 *GROUPS. Also include GROUP. The actual number of groups found is
108 returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. */ 55 returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. */
109extern int getgrouplist(const char *__user, gid_t __group, 56int FAST_FUNC getgrouplist(const char *__user, gid_t __group,
110 gid_t *__groups, int *__ngroups); 57 gid_t *__groups, int *__ngroups);
111 58
112/* Initialize the group set for the current user 59/* Initialize the group set for the current user
113 by reading the group database and using all groups 60 by reading the group database and using all groups
114 of which USER is a member. Also include GROUP. */ 61 of which USER is a member. Also include GROUP. */
115extern int initgroups(const char *__user, gid_t __group); 62int FAST_FUNC initgroups(const char *__user, gid_t __group);
116 63
117POP_SAVED_FUNCTION_VISIBILITY 64POP_SAVED_FUNCTION_VISIBILITY
118 65