4 * Copyright 1993-1998 Lucent Technologies, Inc.
6 * Permission to use, copy, modify, and distribute this software and
7 * its documentation for any purpose and without fee is hereby
8 * granted, provided that the above copyright notice appear in all
9 * copies and that both that the copyright notice and warranty
10 * disclaimer appear in supporting documentation, and that the names
11 * of Lucent Technologies any of their entities not be used in
12 * advertising or publicity pertaining to distribution of the software
13 * without specific, written prior permission.
15 * Lucent Technologies disclaims all warranties with regard to this
16 * software, including all implied warranties of merchantability and
17 * fitness. In no event shall Lucent Technologies be liable for any
18 * special, indirect or consequential damages or any damages
19 * whatsoever resulting from loss of use, data or profits, whether in
20 * an action of contract, negligence or other tortuous action, arising
21 * out of or in connection with the use or performance of this
28 #ifdef HAVE_WAITFLAGS_H
29 # include <waitflags.h>
31 #ifdef HAVE_SYS_WAIT_H
32 # include <sys/wait.h>
39 * Define EINPROGRESS in terms of WSAEINPROGRESS.
43 #define EINPROGRESS WSAEINPROGRESS
47 * If ENOTSUP is not defined, define it to a value that will never occur.
51 #define ENOTSUP -1030507
55 * The following defines redefine the Windows Socket errors as
56 * BSD errors so Tcl_PosixError can do the right thing.
60 #define EWOULDBLOCK EAGAIN
63 #define EALREADY 149 /* operation already in progress */
66 #define ENOTSOCK 95 /* Socket operation on non-socket */
69 #define EDESTADDRREQ 96 /* Destination address required */
72 #define EMSGSIZE 97 /* Message too long */
75 #define EPROTOTYPE 98 /* Protocol wrong type for socket */
78 #define ENOPROTOOPT 99 /* Protocol not available */
80 #ifndef EPROTONOSUPPORT
81 #define EPROTONOSUPPORT 120 /* Protocol not supported */
83 #ifndef ESOCKTNOSUPPORT
84 #define ESOCKTNOSUPPORT 121 /* Socket type not supported */
87 #define EOPNOTSUPP 122 /* Operation not supported on socket */
90 #define EPFNOSUPPORT 123 /* Protocol family not supported */
93 #define EAFNOSUPPORT 124 /* Address family not supported */
96 #define EADDRINUSE 125 /* Address already in use */
99 #define EADDRNOTAVAIL 126 /* Can't assign requested address */
102 #define ENETDOWN 127 /* Network is down */
105 #define ENETUNREACH 128 /* Network is unreachable */
108 #define ENETRESET 129 /* Network dropped connection on reset */
111 #define ECONNABORTED 130 /* Software caused connection abort */
114 #define ECONNRESET 131 /* Connection reset by peer */
117 #define ENOBUFS 132 /* No buffer space available */
120 #define EISCONN 133 /* Socket is already connected */
123 #define ENOTCONN 134 /* Socket is not connected */
126 #define ESHUTDOWN 143 /* Can't send after socket shutdown */
129 #define ETOOMANYREFS 144 /* Too many references: can't splice */
132 #define ETIMEDOUT 145 /* Connection timed out */
135 #define ECONNREFUSED 146 /* Connection refused */
138 #define ELOOP 90 /* Symbolic link loop */
141 #define EHOSTDOWN 147 /* Host is down */
144 #define EHOSTUNREACH 148 /* No route to host */
147 #define ENOTEMPTY 93 /* directory not empty */
150 #define EUSERS 94 /* Too many users (for UFS) */
153 #define EDQUOT 49 /* Disc quota exceeded */
156 #define ESTALE 151 /* Stale NFS file handle */
159 #define EREMOTE 66 /* The object is remote */
163 # define WIFEXITED(stat) (((*((int *) &(stat))) & 0xff) == 0)
167 # define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)
171 # define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0x00ff)))
175 # define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7f)
179 # define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xff) == 0177)
183 # define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xff)
187 * Define constants for waitpid() system call if they aren't defined
188 * by a system header file.
199 * The type of the status returned by wait varies from UNIX system
200 * to UNIX system. The macro below defines it:
204 # define WAIT_STATUS_TYPE pid_t
206 #ifdef HAVE_UNION_WAIT
207 # define WAIT_STATUS_TYPE union wait
209 # define WAIT_STATUS_TYPE int
214 * Supply definitions for macros to query wait status, if not already
215 * defined in header files above.
219 # define WIFEXITED(stat) (((*((int *) &(stat))) & 0xff) == 0)
223 # define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)
227 # define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0x00ff)))
231 # define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7f)
235 # define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xff) == 0177)
239 # define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xff)
242 #endif /* _BLT_WAIT_H */