File: getgroups.c

package info (click to toggle)
mlton 20061107-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 27,828 kB
  • ctags: 61,118
  • sloc: ansic: 11,446; makefile: 1,339; sh: 1,160; lisp: 900; pascal: 256; asm: 97
file content (20 lines) | stat: -rw-r--r-- 620 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;
}