[libc] Add <unistd.h> functions for process group management. (#220044)
* Add POSIX functions `getpgid`, `getpgrp`, and `setpgid` that get/set
process group IDs. Define them in `<unistd.h>`
header and add entrypoints on Linux platforms;
* Implement these functions on Linux as `getpgid`/`setpgid` syscall
wrappers.
* Add unit test to sanity-check returned values and validate the
expected `errno` values for invalid arguments. Given the
simplicity of implementation, don't write fork-based tests to validate
that the process group management works as
expected on Linux machines.
Assisted by automated tooling, human-verified.
GitOrigin-RevId: 875b2139bf261dc5a226c3eb6f4f3a822e541575
20 files changed