+++ /dev/null
-/* $NetBSD: wait.h,v 1.24 2005/12/11 12:25:21 christos Exp $ */\r
-\r
-/*\r
- * Copyright (c) 1982, 1986, 1989, 1993, 1994\r
- * The Regents of the University of California. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- * 3. Neither the name of the University nor the names of its contributors\r
- * may be used to endorse or promote products derived from this software\r
- * without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
- * SUCH DAMAGE.\r
- *\r
- * @(#)wait.h 8.2 (Berkeley) 7/10/94\r
- */\r
-#ifndef _SYS_WAIT_H_\r
-#define _SYS_WAIT_H_\r
-\r
-#include <sys/featuretest.h>\r
-#include <sys/types.h>\r
-\r
-/*\r
- * This file holds definitions relevent to the wait4 system call\r
- * and the alternate interfaces that use it (wait, wait3, waitpid).\r
- */\r
-\r
-/*\r
- * Macros to test the exit status returned by wait\r
- * and extract the relevant values.\r
- */\r
-#define _W_INT(w) (*(int *)(void *)&(w)) /* convert union wait to int */\r
-\r
-#define _WSTATUS(x) (_W_INT(x) & 0177)\r
-#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */\r
-#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)\r
-#define WSTOPSIG(x) ((int)(((unsigned int)_W_INT(x)) >> 8) & 0xff)\r
-#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)\r
-#define WTERMSIG(x) (_WSTATUS(x))\r
-#define WIFEXITED(x) (_WSTATUS(x) == 0)\r
-#define WEXITSTATUS(x) ((int)(((unsigned int)_W_INT(x)) >> 8) & 0xff)\r
-#define WCOREFLAG 0200\r
-#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)\r
-\r
-#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))\r
-#define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED)\r
-\r
-/*\r
- * Option bits for the third argument of wait4. WNOHANG causes the\r
- * wait to not hang if there are no stopped or terminated processes, rather\r
- * returning an error indication in this case (pid==0). WUNTRACED\r
- * indicates that the caller should receive status about untraced children\r
- * which stop due to signals. If children are stopped and a wait without\r
- * this option is done, it is as though they were still running... nothing\r
- * about them is returned.\r
- */\r
-#define WNOHANG 0x00000001 /* don't hang in wait */\r
-#define WUNTRACED 0x00000002 /* tell about stopped,\r
- untraced children */\r
-#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)\r
-#define WALTSIG 0x00000004 /* wait for processes that exit\r
- with an alternate signal (i.e.\r
- not SIGCHLD) */\r
-#define WALLSIG 0x00000008 /* wait for processes that exit\r
- with any signal, i.e. SIGCHLD\r
- and alternates */\r
-\r
-/*\r
- * These are the Linux names of some of the above flags, for compatibility\r
- * with Linux's clone(2) API.\r
- */\r
-#define __WCLONE WALTSIG\r
-#define __WALL WALLSIG\r
-\r
-/*\r
- * These bits are used in order to support SVR4 (etc) functionality\r
- * without replicating sys_wait4 5 times.\r
- */\r
-#define WNOWAIT 0x00010000 /* Don't mark child 'P_WAITED' */\r
-#define WNOZOMBIE 0x00020000 /* Ignore zombies */\r
-#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */\r
-\r
-/* POSIX extensions and 4.2/4.3 compatibility: */\r
-\r
-/*\r
- * Tokens for special values of the "pid" parameter to wait4.\r
- */\r
-#define WAIT_ANY (-1) /* any process */\r
-#define WAIT_MYPGRP 0 /* any process in my process group */\r
-\r
-/*\r
- * Deprecated:\r
- * Structure of the information in the status word returned by wait4.\r
- * If w_stopval==WSTOPPED, then the second structure describes\r
- * the information returned, else the first.\r
- */\r
-union wait {\r
- int w_status; /* used in syscall */\r
- /*\r
- * Terminated process status.\r
- */\r
- struct {\r
-#if BYTE_ORDER == LITTLE_ENDIAN\r
- unsigned int w_Termsig:7, /* termination signal */\r
- w_Coredump:1, /* core dump indicator */\r
- w_Retcode:8, /* exit code if w_termsig==0 */\r
- w_Filler:16; /* upper bits filler */\r
-#endif\r
-#if BYTE_ORDER == BIG_ENDIAN\r
- unsigned int w_Filler:16, /* upper bits filler */\r
- w_Retcode:8, /* exit code if w_termsig==0 */\r
- w_Coredump:1, /* core dump indicator */\r
- w_Termsig:7; /* termination signal */\r
-#endif\r
- } w_T;\r
- /*\r
- * Stopped process status. Returned\r
- * only for traced children unless requested\r
- * with the WUNTRACED option bit.\r
- */\r
- struct {\r
-#if BYTE_ORDER == LITTLE_ENDIAN\r
- unsigned int w_Stopval:8, /* == W_STOPPED if stopped */\r
- w_Stopsig:8, /* signal that stopped us */\r
- w_Filler:16; /* upper bits filler */\r
-#endif\r
-#if BYTE_ORDER == BIG_ENDIAN\r
- unsigned int w_Filler:16, /* upper bits filler */\r
- w_Stopsig:8, /* signal that stopped us */\r
- w_Stopval:8; /* == W_STOPPED if stopped */\r
-#endif\r
- } w_S;\r
-};\r
-#define w_termsig w_T.w_Termsig\r
-#define w_coredump w_T.w_Coredump\r
-#define w_retcode w_T.w_Retcode\r
-#define w_stopval w_S.w_Stopval\r
-#define w_stopsig w_S.w_Stopsig\r
-\r
-#define WSTOPPED _WSTOPPED\r
-\r
-__BEGIN_DECLS\r
-pid_t wait(int *);\r
-\r
-#if 0 /* Normally declared here but not implemented for UEFI. */\r
-struct rusage; /* forward declaration */\r
-\r
-pid_t waitpid(pid_t, int *, int);\r
-pid_t wait3(int *, int, struct rusage *);\r
-pid_t wait4(pid_t, int *, int, struct rusage *);\r
-#endif\r
-__END_DECLS\r
-\r
-#endif /* !_SYS_WAIT_H_ */\r