shithub: riscv

ref: 3d5dca521797b5a91ebc4281fbaf58211bb4f40f
dir: /sys/src/ape/lib/ap/plan9/getgid.c/

View raw version
#include <sys/types.h>
#include <grp.h>
#include <unistd.h>

/*
 * BUG: assumes group that is same as user name
 * is the one wanted (plan 9 has no "current group")
 */
gid_t
getgid(void)
{
	struct group *g;
	g = getgrnam(getlogin());
	return g? g->gr_gid : 1;
}

gid_t
getegid(void)
{
	return getgid();
}