getgrouplist(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

getgrouplist(3c)

Standard C Library Functions                                  getgrouplist(3C)



NAME
       getgrouplist - obtain a list of group memberships of a user

SYNOPSIS
       #include <grp.h>

       int getgrouplist(const char *user, gid_t group,
            gid_t *groups, int *ngroups);

DESCRIPTION
       The  getgrouplist()  function  takes user and group as arguments, along
       with groups and ngroups. user and group are taken from the user's pass‐
       word  entry. group is a pointer to an array of gid_ts, and ngroups is a
       pointer to an integer holding the number of gid_ts in groups.


       The getgrouplist() function fills in the given  array  group  with  the
       group  IDs  of  all  the  groups to which the user belongs. *ngroups of
       these group IDs will be returned in the  array  groups.  The  resulting
       value of *ngroups will include group in the count. The overall value of
       ngroups can be greater than the number of group IDs stored in groups.


       Before returning, the getgrouplist() function sets the integer variable
       pointed  by ngroups to the number of group IDs found for the user. This
       is true even when the getgrouplist() function returns an error.

RETURN VALUES
       The getgrouplist() function returns the new value  *ngroups  if  it  is
       less than or equal to the original value of *ngroups.


       The  getgrouplist() function returns -1 if the new value of *ngroups is
       greater than the original value. In other words, if the  getgrouplist()
       function  returns  -1, there were more groups than the buffer at *group
       could hold. In this case, *ngroups retains its new value,  and  can  be
       checked  by  the caller to facilitate a subsequent call to the getgrou‐
       plist() function with an appropriately sized array at *groups.

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelSafe


SEE ALSO
       Intro(2), initgroups(3C), getgrnam(3C), getpwnam(3C), standards(7).

NOTES
       The  getgroupslist() function is not specified by any standard, so will
       not be declared if a  standard  conformance  macro  is  defined  unless
       __EXTENSIONS__ is also defined. See standards(7) for details.

HISTORY
       The getgrouplist() function was added to Oracle Solaris in the 11.2 SRU
       10 release.



Oracle Solaris 11.4               9 Jul 2018                  getgrouplist(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3