mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
sched/waitpid: rename nx_waitpid() to nxsched_waitpid()
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
+44
-2
@@ -1359,11 +1359,53 @@ int nxsched_set_affinity(pid_t pid, size_t cpusetsize,
|
||||
int nxsched_get_stackinfo(pid_t pid, FAR struct stackinfo_s *stackinfo);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nx_wait/nx_waitid/nx_waitpid
|
||||
* Name: nxsched_waitpid
|
||||
*
|
||||
* Description:
|
||||
* This functions will obtain status information pertaining to one
|
||||
* of the caller's child processes. This function will suspend
|
||||
* execution of the calling thread until status information for one of the
|
||||
* terminated child processes of the calling process is available, or until
|
||||
* delivery of a signal whose action is either to execute a signal-catching
|
||||
* function or to terminate the process. If more than one thread is
|
||||
* suspended in nxsched_waitpid() awaiting termination of the same process,
|
||||
* exactly one thread will return the process status at the time of the
|
||||
* target process termination. If status information is available prior to
|
||||
* the call to nxsched_waitpid(), return will be immediate.
|
||||
*
|
||||
* Input Parameters:
|
||||
* pid - The task ID of the thread to waid for
|
||||
* stat_loc - The location to return the exit status
|
||||
* options - ignored
|
||||
*
|
||||
* Returned Value:
|
||||
* If nxsched_waitpid() returns because the status of a child process is
|
||||
* available, it will return a value equal to the process ID of the child
|
||||
* process for which status is reported.
|
||||
*
|
||||
* If nxsched_waitpid() returns due to the delivery of a signal to the
|
||||
* calling process, -1 will be returned and errno set to EINTR.
|
||||
*
|
||||
* If nxsched_waitpid() was invoked with WNOHANG set in options, it has
|
||||
* at least one child process specified by pid for which status is not
|
||||
* available, and status is not available for any process specified by
|
||||
* pid, 0 is returned.
|
||||
*
|
||||
* Otherwise, (pid_t)-1 will be returned, and errno set to indicate the
|
||||
* error:
|
||||
*
|
||||
* ECHILD - The process specified by pid does not exist or is not a child
|
||||
* of the calling process, or the process group specified by pid
|
||||
* does not exist does not have any member process that is a child
|
||||
* of the calling process.
|
||||
* EINTR - The function was interrupted by a signal. The value of the
|
||||
* location pointed to by stat_loc is undefined.
|
||||
* EINVAL - The options argument is not valid.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_WAITPID
|
||||
pid_t nx_waitpid(pid_t pid, FAR int *stat_loc, int options);
|
||||
pid_t nxsched_waitpid(pid_t pid, FAR int *stat_loc, int options);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
||||
Reference in New Issue
Block a user