xref: /plan9-contrib/sys/src/ape/lib/ap/plan9/getgid.c (revision ec59a3ddbfceee0efe34584c2c9981a5e5ff1ec4)
1 #include <sys/types.h>
2 #include <grp.h>
3 #include <unistd.h>
4 
5 /*
6  * BUG: assumes group that is same as user name
7  * is the one wanted (plan 9 has no "current group")
8  */
9 gid_t
10 getgid(void)
11 {
12 	struct group *g;
13 	g = getgrnam(getlogin());
14 	return g? g->gr_gid : 1;
15 }
16 
17 gid_t
18 getegid(void)
19 {
20 	return getgid();
21 }
22