grp.h (b4203d757c7c247e39c94c09a94021a3a8121062) grp.h (f2c438c5058c64b7373448f239156bf60009abcb)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 14 unchanged lines hidden (view full) ---

23/* All Rights Reserved */
24
25
26/*
27 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 *
29 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
30 * Use is subject to license terms.
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 14 unchanged lines hidden (view full) ---

23/* All Rights Reserved */
24
25
26/*
27 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 *
29 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
30 * Use is subject to license terms.
31 *
32 * Copyright 2020 Joyent, Inc.
31 */
32
33#ifndef _GRP_H
34#define _GRP_H
35
36#include <sys/feature_tests.h>
37
38#include <sys/types.h>

--- 18 unchanged lines hidden (view full) ---

57
58#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
59extern struct group *getgrent_r(struct group *, char *, int);
60extern struct group *fgetgrent_r(FILE *, struct group *, char *, int);
61
62
63extern struct group *fgetgrent(FILE *); /* MT-unsafe */
64extern int initgroups(const char *, gid_t);
33 */
34
35#ifndef _GRP_H
36#define _GRP_H
37
38#include <sys/feature_tests.h>
39
40#include <sys/types.h>

--- 18 unchanged lines hidden (view full) ---

59
60#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
61extern struct group *getgrent_r(struct group *, char *, int);
62extern struct group *fgetgrent_r(FILE *, struct group *, char *, int);
63
64
65extern struct group *fgetgrent(FILE *); /* MT-unsafe */
66extern int initgroups(const char *, gid_t);
67extern int getgrouplist(const char *, gid_t, gid_t *, int *);
65#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) */
66
67#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)
68extern void endgrent(void);
69extern void setgrent(void);
70extern struct group *getgrent(void); /* MT-unsafe */
71#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)... */
72

--- 47 unchanged lines hidden (view full) ---

120 size_t, struct group **);
121#else /* __PRAGMA_REDEFINE_EXTNAME */
122
123extern int __posix_getgrgid_r(gid_t, struct group *, char *, size_t,
124 struct group **);
125extern int __posix_getgrnam_r(const char *, struct group *, char *, size_t,
126 struct group **);
127
68#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) */
69
70#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)
71extern void endgrent(void);
72extern void setgrent(void);
73extern struct group *getgrent(void); /* MT-unsafe */
74#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)... */
75

--- 47 unchanged lines hidden (view full) ---

123 size_t, struct group **);
124#else /* __PRAGMA_REDEFINE_EXTNAME */
125
126extern int __posix_getgrgid_r(gid_t, struct group *, char *, size_t,
127 struct group **);
128extern int __posix_getgrnam_r(const char *, struct group *, char *, size_t,
129 struct group **);
130
128#ifdef __lint
129
130#define getgrgid_r __posix_getgrgid_r
131#define getgrnam_r __posix_getgrnam_r
132
133#else /* !__lint */
134
135static int
136getgrgid_r(gid_t __gid, struct group *__grp, char *__buf, size_t __len,
137 struct group **__res)
138{
139 return (__posix_getgrgid_r(__gid, __grp, __buf, __len, __res));
140}
141static int
142getgrnam_r(const char *__cb, struct group *__grp, char *__buf, size_t __len,
143 struct group **__res)
144{
145 return (__posix_getgrnam_r(__cb, __grp, __buf, __len, __res));
146}
147
131static int
132getgrgid_r(gid_t __gid, struct group *__grp, char *__buf, size_t __len,
133 struct group **__res)
134{
135 return (__posix_getgrgid_r(__gid, __grp, __buf, __len, __res));
136}
137static int
138getgrnam_r(const char *__cb, struct group *__grp, char *__buf, size_t __len,
139 struct group **__res)
140{
141 return (__posix_getgrnam_r(__cb, __grp, __buf, __len, __res));
142}
143
148#endif /* !__lint */
149#endif /* __PRAGMA_REDEFINE_EXTNAME */
150
151#else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
152
153extern struct group *getgrgid_r(gid_t, struct group *, char *, int);
154extern struct group *getgrnam_r(const char *, struct group *, char *, int);
155
156#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
157
158#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)... */
159
160#ifdef __cplusplus
161}
162#endif
163
164#endif /* _GRP_H */
144#endif /* __PRAGMA_REDEFINE_EXTNAME */
145
146#else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
147
148extern struct group *getgrgid_r(gid_t, struct group *, char *, int);
149extern struct group *getgrnam_r(const char *, struct group *, char *, int);
150
151#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
152
153#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)... */
154
155#ifdef __cplusplus
156}
157#endif
158
159#endif /* _GRP_H */