2020-06-15 14:18:57 +00:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_PASSWD_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_PASSWD_H_
|
2023-12-29 06:58:17 +00:00
|
|
|
#include "libc/stdio/stdio.h"
|
2020-06-15 14:18:57 +00:00
|
|
|
#include "libc/calls/weirdtypes.h"
|
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
|
|
|
struct passwd {
|
|
|
|
char *pw_name;
|
|
|
|
char *pw_passwd;
|
2023-12-09 02:27:41 +00:00
|
|
|
uid_t pw_uid;
|
|
|
|
gid_t pw_gid;
|
2020-06-15 14:18:57 +00:00
|
|
|
char *pw_gecos;
|
|
|
|
char *pw_dir;
|
|
|
|
char *pw_shell;
|
|
|
|
};
|
|
|
|
|
|
|
|
void setpwent(void);
|
|
|
|
void endpwent(void);
|
|
|
|
struct passwd *getpwent(void);
|
2023-12-09 02:27:41 +00:00
|
|
|
struct passwd *getpwuid(uid_t);
|
2020-06-15 14:18:57 +00:00
|
|
|
struct passwd *getpwnam(const char *);
|
2023-12-09 02:27:41 +00:00
|
|
|
int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
|
2020-06-15 14:18:57 +00:00
|
|
|
int getpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **);
|
2023-12-29 06:58:17 +00:00
|
|
|
struct passwd *fgetpwent(FILE *);
|
|
|
|
int putpwent(const struct passwd *, FILE *);
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
struct group {
|
|
|
|
char *gr_name;
|
|
|
|
char *gr_passwd;
|
2023-12-09 02:27:41 +00:00
|
|
|
gid_t gr_gid;
|
2020-06-15 14:18:57 +00:00
|
|
|
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 **);
|
|
|
|
struct group *getgrent(void);
|
|
|
|
void endgrent(void);
|
|
|
|
void setgrent(void);
|
2023-12-29 06:58:17 +00:00
|
|
|
struct group *fgetgrent(FILE *);
|
|
|
|
int putgrent(const struct group *, FILE *);
|
2020-06-15 14:18:57 +00:00
|
|
|
int getgrouplist(const char *, gid_t, gid_t *, int *);
|
2023-09-22 06:51:55 +00:00
|
|
|
int initgroups(const char *, gid_t);
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* COSMOPOLITAN_LIBC_PASSWD_H_ */
|