summaryrefslogtreecommitdiff
path: root/lib/libc/grp/getgrgid.c
blob: 66ccaff1176c5245227267c861da95590e647be5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <grp.h>
#include <stddef.h>
#include <limits.h>

struct group *getgrgid(gid_t gid)
{
	static struct group grp;
	static char buf[LINE_MAX * 2];
	struct group *res;

	if (getgrgid_r(gid, &grp, buf, sizeof(buf), &res) != 0)
		return NULL;

	return res;
}