xiaoxiang781216 opened a new pull request, #19182:
URL: https://github.com/apache/nuttx/pull/19182
## Summary
Add `getgroups()` to the C library. POSIX requires `getgroups()` to
return the supplementary group IDs of the calling process. NuttX has no
notion of supplementary group IDs, so the calling process is treated as
belonging to a single group: its effective group ID.
Behavior:
- gidsetsize == 0: return the number of group IDs (1) without writing to
grouplist, per POSIX.
- gidsetsize < 0: fail with EINVAL.
- otherwise: store the effective group ID (getegid()) in grouplist[0]
and return 1.
It is declared in <unistd.h> and always built, since it only depends on
the public getegid().
## Impact
New public POSIX API. No change to existing behavior or build for code
that does not call getgroups(). Helps porting third-party software that
expects getgroups() to be available.
## Testing
Built the sim:nsh configuration on Linux (x86_64, GCC) with
CONFIG_LIBC_GROUP_FILE both enabled and disabled. checkpatch.sh passes
on the changed files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]