* @brief Waits for the termination of a child process. * * This function makes the calling process wait until one of its child processes terminates or until a * specified condition is met. The function retrieves information about the terminated child process, * including its exit status, and can also handle other process-related events, such as stopping or * continuing execution. * * @param
| 6980 | * @see sys_wait(), sys_waitid() |
| 6981 | */ |
| 6982 | sysret_t sys_waitpid(int32_t pid, int *status, int options) |
| 6983 | { |
| 6984 | int ret = -1; |
| 6985 | #ifdef ARCH_MM_MMU |
| 6986 | if (!lwp_user_accessable((void *)status, sizeof(int))) |
| 6987 | { |
| 6988 | return -EFAULT; |
| 6989 | } |
| 6990 | else |
| 6991 | { |
| 6992 | ret = lwp_waitpid(pid, status, options, RT_NULL); |
| 6993 | } |
| 6994 | #else |
| 6995 | if (!lwp_user_accessable((void *)status, sizeof(int))) |
| 6996 | { |
| 6997 | return -EFAULT; |
| 6998 | } |
| 6999 | ret = waitpid(pid, status, options); |
| 7000 | #endif |
| 7001 | return ret; |
| 7002 | } |
| 7003 | |
| 7004 | #if defined(RT_USING_SAL) && defined(SAL_USING_POSIX) |
| 7005 | struct musl_addrinfo |
nothing calls this directly
no test coverage detected