* getpgid() returns the PGID of the process specified by pid. * If pid is zero, the process ID of the calling process is used. (Retrieving the PGID of a process other * than the caller is rarely necessary, and the POSIX.1 getpgrp() is preferred for that task.) */
| 483 | * than the caller is rarely necessary, and the POSIX.1 getpgrp() is preferred for that task.) |
| 484 | */ |
| 485 | sysret_t sys_getpgid(pid_t pid) |
| 486 | { |
| 487 | rt_lwp_t process; |
| 488 | |
| 489 | lwp_pid_lock_take(); |
| 490 | process = lwp_from_pid_locked(pid); |
| 491 | lwp_pid_lock_release(); |
| 492 | |
| 493 | if (process == RT_NULL) |
| 494 | { |
| 495 | return -ESRCH; |
| 496 | } |
| 497 | |
| 498 | return lwp_pgid_get_byprocess(process); |
| 499 | } |
| 500 | |
| 501 | #ifdef RT_USING_FINSH |
| 502 |
nothing calls this directly
no test coverage detected