1explain_getgrouplist_or_die(L3i)brary Functions Manueaxlplain_getgrouplist_or_die(3)
2
3
4

NAME

6       explain_getgrouplist_or_die - get list of groups and report errors
7

SYNOPSIS

9       #include <libexplain/getgrouplist.h>
10       void  explain_getgrouplist_or_die(const  char *user, gid_t group, gid_t
11       *groups, int *ngroups);
12       int explain_getgrouplist_on_error(const char *user, gid_t group,  gid_t
13       *groups, int *ngroups);
14

DESCRIPTION

16       The  explain_getgrouplist_or_die  function is used to call the getgrou‐
17       plist(3) system call. On failure an  explanation  will  be  printed  to
18       stderr,  obtained  from  the explain_getgrouplist(3) function, and then
19       the process terminates by calling exit(EXIT_FAILURE).
20
21       The explain_getgrouplist_on_error function is used to call the getgrou‐
22       plist(3)  system  call.  On  failure  an explanation will be printed to
23       stderr, obtained from the explain_getgrouplist(3) function,  but  still
24       returns to the caller.
25
26       user    The user, exactly as to be passed to the getgrouplist(3) system
27               call.
28
29       group   The group, exactly as to be passed to the getgrouplist(3)  sys‐
30               tem call.
31
32       groups  The groups, exactly as to be passed to the getgrouplist(3) sys‐
33               tem call.
34
35       ngroups The ngroups, exactly as to be  passed  to  the  getgrouplist(3)
36               system call.
37

RETURN VALUE

39       The  explain_getgrouplist_or_die  function only returns on success, see
40       getgrouplist(3) for more information. On failure, prints an explanation
41       and exits, it does not return.
42
43       The  explain_getgrouplist_on_error  function  always  returns the value
44       return by the wrapped getgrouplist(3) system call.
45

EXAMPLE

47       The explain_getgrouplist_or_die function is intended to be  used  in  a
48       fashion similar to the following example:
49              explain_getgrouplist_or_die(user, group, groups, ngroups);
50

SEE ALSO

52       getgrouplist(3)
53               get list of groups to which a user belongs
54
55       explain_getgrouplist(3)
56               explain getgrouplist(3) errors
57
58       exit(2) terminate the calling process
59
61       libexplain version 1.4
62       Copyright (C) 2013 Peter Miller
63
64
65
66                                                explain_getgrouplist_or_die(3)
Impressum