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

Function sys_waitpid

components/lwp/lwp_syscall.c:6982–7002  ·  view source on GitHub ↗

* @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

Source from the content-addressed store, hash-verified

6980 * @see sys_wait(), sys_waitid()
6981 */
6982sysret_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)
7005struct musl_addrinfo

Callers

nothing calls this directly

Calls 3

lwp_user_accessableFunction · 0.85
lwp_waitpidFunction · 0.85
waitpidFunction · 0.85

Tested by

no test coverage detected