libs/libc/getpgid: add getpgid implementation

1. the getpgid function can help to pass the
ltp/open_posix_testsuite/killpg related testcases
2. NuttX do not support process group, so we use the process id as
process group id
3. the implementation are referred to: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getpgid.html

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
guoshichao
2023-07-08 16:49:26 +08:00
committed by Xiang Xiao
parent 1b1ac6f3b7
commit 79af1cdfe6
3 changed files with 75 additions and 1 deletions

View File

@@ -310,6 +310,7 @@ extern "C"
pid_t fork(void);
pid_t vfork(void);
pid_t getpid(void);
pid_t getpgid(pid_t pid);
pid_t getpgrp(void);
pid_t gettid(void);
pid_t getppid(void);