xref: /plan9-contrib/sys/src/ape/lib/ap/plan9/getgid.c (revision 219b2ee8daee37f4aad58d63f21287faa8e4ffdc)
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