MentOS  0.8.0
The Mentoring Operating System
grp.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "stddef.h"
9 
11 #define MAX_MEMBERS_PER_GROUP 64
12 
14 typedef struct group {
16  char *gr_name;
18  char *gr_passwd;
24 
28 group_t *getgrgid(gid_t gid);
29 
33 group_t *getgrnam(const char *name);
34 
45 int getgrgid_r(gid_t gid, group_t *group, char *buf, size_t buflen, group_t **result);
46 
57 int getgrnam_r(const char *name, group_t *group, char *buf, size_t buflen, group_t **result);
58 
66 group_t *getgrent(void);
67 
69 void endgrent(void);
70 
72 void setgrent(void);
#define MAX_MEMBERS_PER_GROUP
Maximum number of users per group.
Definition: grp.h:11
int getgrnam_r(const char *name, group_t *group, char *buf, size_t buflen, group_t **result)
Provides the same information as getgrnam but it stores the results inside group, and the string info...
Definition: grp.c:167
group_t * getgrgid(gid_t gid)
Provides access to the group database entry for uid.
Definition: grp.c:113
struct group group_t
Contains user group informations.
group_t * getgrent(void)
Returns a pointer to a structure containing the broken-out fields of an entry in the group database.
Definition: grp.c:191
void setgrent(void)
May be called to close the group database when processing is complete.
Definition: grp.c:253
int getgrgid_r(gid_t gid, group_t *group, char *buf, size_t buflen, group_t **result)
Provides the same information as getgrgid but it stores the results inside group, and the string info...
Definition: grp.c:143
void endgrent(void)
Rewinds the group database to allow repeated searches.
Definition: grp.c:246
group_t * getgrnam(const char *name)
Provides access to the group database entry for name.
Definition: grp.c:126
Define basic data types.
int gid_t
The type of group-id.
Definition: stddef.h:43
Contains user group informations.
Definition: grp.h:14
gid_t gr_gid
Group ID.
Definition: grp.h:20
char * gr_mem[MAX_MEMBERS_PER_GROUP+1]
List of group members.
Definition: grp.h:22
char * gr_passwd
Encrypted password.
Definition: grp.h:18
char * gr_name
The name of the group.
Definition: grp.h:16