File: getgroups.c

package info (click to toggle)
mlton 20041109-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,212 kB
  • ctags: 58,085
  • sloc: ansic: 10,386; makefile: 1,178; sh: 1,139; pascal: 256; asm: 97
file content (20 lines) | stat: -rw-r--r-- 554 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "platform.h"

/* It's easier to let the basis library deal with an array of known-size
 * words than to deal with a gid_t size that varies from platform to platform.
 * So, this code copies the array of gid_t's to the array of words passed by the
 * basis.
 */

Int Posix_ProcEnv_getgroups (Pointer groups) {
	int             i;
	int 		result;
	gid_t           groupList[Posix_ProcEnv_numgroups];

	result = getgroups (Posix_ProcEnv_numgroups, groupList);

	for (i = 0; i < result; i++)
		((Word *) groups)[i] = groupList[i];

	return result;
}