modernc.org/cc@v1.0.1/v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/sys/wait.h (about) 1 /* Copyright (C) 1991-2016 Free Software Foundation, Inc. 2 This file is part of the GNU C Library. 3 4 The GNU C Library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 2.1 of the License, or (at your option) any later version. 8 9 The GNU C Library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public 15 License along with the GNU C Library; if not, see 16 <http://www.gnu.org/licenses/>. */ 17 18 /* 19 * POSIX Standard: 3.2.1 Wait for Process Termination <sys/wait.h> 20 */ 21 22 #ifndef _SYS_WAIT_H 23 #define _SYS_WAIT_H 1 24 25 #include <features.h> 26 27 __BEGIN_DECLS 28 #include <signal.h> 29 /* These macros could also be defined in <stdlib.h>. */ 30 #if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8) 31 /* This will define the `W*' macros for the flag 32 bits to `waitpid', `wait3', and `wait4'. */ 33 #include <bits/waitflags.h> 34 /* This will define all the `__W*' macros. */ 35 #include <bits/waitstatus.h> 36 #define WEXITSTATUS(status) __WEXITSTATUS (status) 37 #define WTERMSIG(status) __WTERMSIG (status) 38 #define WSTOPSIG(status) __WSTOPSIG (status) 39 #define WIFEXITED(status) __WIFEXITED (status) 40 #define WIFSIGNALED(status) __WIFSIGNALED (status) 41 #define WIFSTOPPED(status) __WIFSTOPPED (status) 42 #ifdef __WIFCONTINUED 43 #define WIFCONTINUED(status) __WIFCONTINUED (status) 44 #endif 45 #endif /* <stdlib.h> not included. */ 46 #ifdef __USE_MISC 47 #define WCOREFLAG __WCOREFLAG 48 #define WCOREDUMP(status) __WCOREDUMP (status) 49 #define W_EXITCODE(ret, sig) __W_EXITCODE (ret, sig) 50 #define W_STOPCODE(sig) __W_STOPCODE (sig) 51 #endif 52 /* Wait for a child to die. When one does, put its status in *STAT_LOC 53 and return its process ID. For errors, return (pid_t) -1. 54 55 This function is a cancellation point and therefore not marked with 56 __THROW. */ 57 extern __pid_t wait(int *__stat_loc); 58 59 #ifdef __USE_MISC 60 /* Special values for the PID argument to `waitpid' and `wait4'. */ 61 #define WAIT_ANY (-1) /* Any process. */ 62 #define WAIT_MYPGRP 0 /* Any process in my process group. */ 63 #endif 64 65 /* Wait for a child matching PID to die. 66 If PID is greater than 0, match any process whose process ID is PID. 67 If PID is (pid_t) -1, match any process. 68 If PID is (pid_t) 0, match any process with the 69 same process group as the current process. 70 If PID is less than -1, match any process whose 71 process group is the absolute value of PID. 72 If the WNOHANG bit is set in OPTIONS, and that child 73 is not already dead, return (pid_t) 0. If successful, 74 return PID and store the dead child's status in STAT_LOC. 75 Return (pid_t) -1 for errors. If the WUNTRACED bit is 76 set in OPTIONS, return status for stopped children; otherwise don't. 77 78 This function is a cancellation point and therefore not marked with 79 __THROW. */ 80 extern __pid_t waitpid(__pid_t __pid, int *__stat_loc, int __options); 81 82 #if defined __USE_XOPEN || defined __USE_XOPEN2K8 83 #ifndef __id_t_defined 84 #include <bits/types.h> 85 typedef __id_t id_t; 86 #define __id_t_defined 87 #endif 88 89 #define __need_siginfo_t 90 #include <bits/siginfo.h> 91 92 /* Wait for a childing matching IDTYPE and ID to change the status and 93 place appropriate information in *INFOP. 94 If IDTYPE is P_PID, match any process whose process ID is ID. 95 If IDTYPE is P_PGID, match any process whose process group is ID. 96 If IDTYPE is P_ALL, match any process. 97 If the WNOHANG bit is set in OPTIONS, and that child 98 is not already dead, clear *INFOP and return 0. If successful, store 99 exit code and status in *INFOP. 100 101 This function is a cancellation point and therefore not marked with 102 __THROW. */ 103 extern int waitid(idtype_t __idtype, __id_t __id, siginfo_t * __infop, int __options); 104 #endif 105 106 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED 107 /* This being here makes the prototypes valid whether or not 108 we have already included <sys/resource.h> to define `struct rusage'. */ 109 struct rusage; 110 111 /* Wait for a child to exit. When one does, put its status in *STAT_LOC and 112 return its process ID. For errors return (pid_t) -1. If USAGE is not 113 nil, store information about the child's resource usage there. If the 114 WUNTRACED bit is set in OPTIONS, return status for stopped children; 115 otherwise don't. */ 116 extern __pid_t wait3(int *__stat_loc, int __options, struct rusage *__usage) __THROWNL; 117 #endif 118 119 #ifdef __USE_MISC 120 /* PID is like waitpid. Other args are like wait3. */ 121 extern __pid_t wait4(__pid_t __pid, int *__stat_loc, int __options, struct rusage *__usage) __THROWNL; 122 #endif /* Use misc. */ 123 124 __END_DECLS 125 #endif /* sys/wait.h */