struct group *getgrgid(gid_t gid);
int getgrgid_r(gid_t gid, struct group *grp, char *buffer, size_t bufsize, struct group **result);
struct group *getgrnam(const char *name);
int getgrnam_r(const char *name, struct group *grp, char *buffer, size_t bufsize, struct group **result);
The correct size for the buffer for
size = sysconf(_SC_GETGR_R_SIZE_MAX);
Is the group ID of the group to look up in the group database.
getgrgid()and getgrgid_r()fill in the group structure with data about the group.
Is the he name of the group to look up in the group database.
getgrnam()and getgrnam_r()fill in the group structure with data about the group.
Points to a group structure to be filled in.
Points to a buffer into which the data needed for the group structure members is to be placed.
Is the size of the buffer being passed.
Is the pointer where the address of grp is to be placed on success, or NULL is to be placed on error.
If an error occurs or if the requested entry is not found,
The name, grp, buf, or result parameter is not a valid pointer.
The gid parameter is not a valid group ID, or the name parameter is not a valid group name.
Insufficient storage was supplied via buffer and bufsize to contain the data to be referenced by the resulting structure.
POSIX.1 (1996), with exceptions.
2012/8.1/2012R2/10/2016/2019 security allows only administrators and members of a group to enumerate the members of a group. Therefore, the gr_mem field of the group structure may be empty on a successful return.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
- struct group
PTC MKS Toolkit 10.3 Documentation Build 39.