github.com/lovishpuri/go-40569/src@v0.0.0-20230519171745-f8623e7c56cf/os/user/getgrouplist_unix.go (about)

     1  // Copyright 2016 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build cgo && !osusergo && (dragonfly || freebsd || (!android && linux) || netbsd || openbsd || (solaris && !illumos))
     6  
     7  package user
     8  
     9  /*
    10  #include <unistd.h>
    11  #include <sys/types.h>
    12  #include <grp.h>
    13  
    14  static int mygetgrouplist(const char* user, gid_t group, gid_t* groups, int* ngroups) {
    15  	return getgrouplist(user, group, groups, ngroups);
    16  }
    17  */
    18  import "C"
    19  
    20  func getGroupList(name *_C_char, userGID _C_gid_t, gids *_C_gid_t, n *_C_int) _C_int {
    21  	return C.mygetgrouplist(name, userGID, gids, n)
    22  }