2011-02-12 08:22:29 +03:00
|
|
|
#ifndef _GRP_H
|
|
|
|
#define _GRP_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-09-08 07:13:55 +04:00
|
|
|
#include <features.h>
|
|
|
|
|
2011-02-12 08:22:29 +03:00
|
|
|
#define __NEED_size_t
|
|
|
|
#define __NEED_gid_t
|
|
|
|
|
2013-03-06 18:32:52 +04:00
|
|
|
#ifdef _GNU_SOURCE
|
|
|
|
#define __NEED_FILE
|
|
|
|
#endif
|
|
|
|
|
2011-02-12 08:22:29 +03:00
|
|
|
#include <bits/alltypes.h>
|
|
|
|
|
2016-07-03 21:40:11 +03:00
|
|
|
struct group {
|
2011-02-12 08:22:29 +03:00
|
|
|
char *gr_name;
|
|
|
|
char *gr_passwd;
|
|
|
|
gid_t gr_gid;
|
|
|
|
char **gr_mem;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct group *getgrgid(gid_t);
|
|
|
|
struct group *getgrnam(const char *);
|
|
|
|
|
|
|
|
int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
|
|
|
|
int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
|
|
|
|
|
2016-10-21 00:20:01 +03:00
|
|
|
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
2011-02-12 08:22:29 +03:00
|
|
|
struct group *getgrent(void);
|
|
|
|
void endgrent(void);
|
|
|
|
void setgrent(void);
|
2016-10-21 00:20:01 +03:00
|
|
|
#endif
|
2011-02-12 08:22:29 +03:00
|
|
|
|
2013-02-17 22:21:56 +04:00
|
|
|
#ifdef _GNU_SOURCE
|
2016-10-21 00:04:37 +03:00
|
|
|
struct group *fgetgrent(FILE *);
|
2013-04-05 03:23:47 +04:00
|
|
|
int putgrent(const struct group *, FILE *);
|
2013-02-17 22:21:56 +04:00
|
|
|
#endif
|
|
|
|
|
2012-05-23 05:52:08 +04:00
|
|
|
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
2011-04-13 17:03:22 +04:00
|
|
|
int getgrouplist(const char *, gid_t, gid_t *, int *);
|
|
|
|
int setgroups(size_t, const gid_t *);
|
|
|
|
int initgroups(const char *, gid_t);
|
|
|
|
#endif
|
|
|
|
|
2011-02-12 08:22:29 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|