MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / sys_getpgid

Function sys_getpgid

components/lwp/lwp_pgrp.c:485–499  ·  view source on GitHub ↗

* 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.) */

Source from the content-addressed store, hash-verified

483 * than the caller is rarely necessary, and the POSIX.1 getpgrp() is preferred for that task.)
484 */
485sysret_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

Callers

nothing calls this directly

Calls 4

lwp_pid_lock_takeFunction · 0.85
lwp_from_pid_lockedFunction · 0.85
lwp_pid_lock_releaseFunction · 0.85
lwp_pgid_get_byprocessFunction · 0.85

Tested by

no test coverage detected