* @brief Retrieves the parent process ID of the calling process. * * This system call returns the process ID (PID) of the parent process of the calling process. * The parent process is the process that created the calling process, typically through a * system call like `fork()`. This information can be useful for process management and * for determining the hierarchy of processes. * * @retu
| 1525 | * @see getpid(), getuid(), getgid() |
| 1526 | */ |
| 1527 | sysret_t sys_getppid(void) |
| 1528 | { |
| 1529 | rt_lwp_t process; |
| 1530 | |
| 1531 | process = lwp_self(); |
| 1532 | if (process->parent == RT_NULL) |
| 1533 | { |
| 1534 | LOG_E("%s: process %d has no parent process", __func__, lwp_to_pid(process)); |
| 1535 | return 0; |
| 1536 | } |
| 1537 | else |
| 1538 | { |
| 1539 | return lwp_to_pid(process->parent); |
| 1540 | } |
| 1541 | } |
| 1542 | |
| 1543 | /** |
| 1544 | * @brief Retrieves the priority of a process or process group. |
nothing calls this directly
no test coverage detected