MentOS  0.8.0
The Mentoring Operating System
pwd.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "stddef.h"
9 
11 typedef struct passwd_t {
12  char *pw_name;
13  char *pw_passwd;
16  char *pw_gecos;
17  char *pw_dir;
18  char *pw_shell;
20 
24 passwd_t *getpwnam(const char *name);
25 
29 passwd_t *getpwuid(uid_t uid);
30 
42 int getpwnam_r(const char *name, passwd_t *pwd, char *buf, size_t buflen, passwd_t **result);
43 
55 int getpwuid_r(uid_t uid, passwd_t *pwd, char *buf, size_t buflen, passwd_t **result);
passwd_t * getpwnam(const char *name)
Provides access to the password database entry for name.
Definition: pwd.c:111
struct passwd_t passwd_t
Stores user account information.
passwd_t * getpwuid(uid_t uid)
Provides access to the password database entry for uid.
Definition: pwd.c:125
int getpwnam_r(const char *name, passwd_t *pwd, char *buf, size_t buflen, passwd_t **result)
Provides the same information as getpwnam but it stores the results inside pwd, and the string inform...
Definition: pwd.c:136
int getpwuid_r(uid_t uid, passwd_t *pwd, char *buf, size_t buflen, passwd_t **result)
Provides the same information as getpwuid but it stores the results inside pwd, and the string inform...
Definition: pwd.c:164
Define basic data types.
int gid_t
The type of group-id.
Definition: stddef.h:43
int uid_t
The type of user-id.
Definition: stddef.h:40
Stores user account information.
Definition: pwd.h:11
char * pw_passwd
Encrypted password (not currently).
Definition: pwd.h:13
char * pw_name
User's login name.
Definition: pwd.h:12
gid_t pw_gid
Group ID.
Definition: pwd.h:15
char * pw_shell
User's login shell.
Definition: pwd.h:18
char * pw_dir
User's login directory.
Definition: pwd.h:17
char * pw_gecos
User's full name.
Definition: pwd.h:16
uid_t pw_uid
User ID.
Definition: pwd.h:14