Back to index

glibc  2.9
Functions
waitpid.c File Reference
#include <errno.h>
#include <sysdep-cancel.h>
#include <stdlib.h>
#include <sys/wait.h>

Go to the source code of this file.

Functions

__pid_t __libc_waitpid (__pid_t pid, int *stat_loc, int options)

Function Documentation

__pid_t __libc_waitpid ( __pid_t  pid,
int stat_loc,
int  options 
)

Definition at line 25 of file waitpid.c.

{
  if (SINGLE_THREAD_P)
    {
#ifdef __NR_waitpid
      return INLINE_SYSCALL (waitpid, 3, pid, stat_loc, options);
#else
      return INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);
#endif
    }

  int oldtype = LIBC_CANCEL_ASYNC ();

#ifdef __NR_waitpid
  int result = INLINE_SYSCALL (waitpid, 3, pid, stat_loc, options);
#else
  int result = INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);
#endif

  LIBC_CANCEL_RESET (oldtype);

  return result;
}

Here is the call graph for this function: