pwd.h 817 字节
Newer Older
R
Rich Felker 已提交
1 2 3 4 5 6 7
#ifndef _PWD_H
#define _PWD_H

#ifdef __cplusplus
extern "C" {
#endif

8 9
#include <features.h>

R
Rich Felker 已提交
10 11 12 13
#define __NEED_size_t
#define __NEED_uid_t
#define __NEED_gid_t

14 15 16 17
#ifdef _GNU_SOURCE
#define __NEED_FILE
#endif

R
Rich Felker 已提交
18 19
#include <bits/alltypes.h>

20
struct passwd {
R
Rich Felker 已提交
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
	char *pw_name;
	char *pw_passwd;
	uid_t pw_uid;
	gid_t pw_gid;
	char *pw_gecos;
	char *pw_dir;
	char *pw_shell;
};

void setpwent (void);
void endpwent (void);
struct passwd *getpwent (void);

struct passwd *getpwuid (uid_t);
struct passwd *getpwnam (const char *);
int getpwuid_r (uid_t, struct passwd *, char *, size_t, struct passwd **);
int getpwnam_r (const char *, struct passwd *, char *, size_t, struct passwd **);

R
Rich Felker 已提交
39
#ifdef _GNU_SOURCE
40
struct passwd *fgetpwent(FILE *);
41
int putpwent(const struct passwd *, FILE *);
R
Rich Felker 已提交
42 43
#endif

R
Rich Felker 已提交
44 45 46 47 48
#ifdef __cplusplus
}
#endif

#endif