Fix getgroups / setgroups tests across platforms

See #619
This commit is contained in:
Justine Tunney 2022-09-18 03:17:06 -07:00
parent 97bb5a3a80
commit 40991ec992
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3 changed files with 17 additions and 27 deletions

View file

@ -25,10 +25,16 @@
#include "libc/sysv/errfuns.h"
/**
* Set list of supplementary group IDs
* Sets list of supplementary group IDs.
*
* @param size - number of items in list
* @param list - input set of gid_t to set
* On recent versions of Linux only, it's possible to say:
*
* setgroups(0, NULL);
*
* Which will cause subsequent calls to `EPERM`.
*
* @param size number of items in list
* @param list input set of gid_t to set
* @return -1 w/ EFAULT
*/
int setgroups(size_t size, const uint32_t list[]) {