2 Copyright (C) 1995 Free Software Foundation, Inc.
4 This file is part of XEmacs.
6 XEmacs is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* Synched up with: Not really in FSF. */
23 #ifndef INCLUDED_sysproc_h_
24 #define INCLUDED_sysproc_h_
30 #include "systime.h" /* necessary for sys/resource.h; also gets the
31 FD_* defines on some systems. */
33 #include <sys/resource.h>
36 #if !defined (NO_SUBPROCESSES)
38 #ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */
39 # include <sys/types.h> /* AJK */
41 # include <sys/socket.h>
43 # include <netinet/in.h>
44 # include <arpa/inet.h>
46 # ifdef NEED_NET_ERRNO_H
47 # include <net/errno.h>
48 # endif /* NEED_NET_ERRNO_H */
49 #elif defined (SKTPAIR)
50 # include <sys/socket.h>
51 #endif /* HAVE_SOCKETS */
54 /* Note: winsock.h already included in systime.h above */
55 /* map winsock error codes to standard names */
56 #define EWOULDBLOCK WSAEWOULDBLOCK
57 #define EINPROGRESS WSAEINPROGRESS
58 #define EALREADY WSAEALREADY
59 #define ENOTSOCK WSAENOTSOCK
60 #define EDESTADDRREQ WSAEDESTADDRREQ
61 #define EMSGSIZE WSAEMSGSIZE
62 #define EPROTOTYPE WSAEPROTOTYPE
63 #define ENOPROTOOPT WSAENOPROTOOPT
64 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
65 #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
66 #define EOPNOTSUPP WSAEOPNOTSUPP
67 #define EPFNOSUPPORT WSAEPFNOSUPPORT
68 #define EAFNOSUPPORT WSAEAFNOSUPPORT
69 #define EADDRINUSE WSAEADDRINUSE
70 #define EADDRNOTAVAIL WSAEADDRNOTAVAIL
71 #define ENETDOWN WSAENETDOWN
72 #define ENETUNREACH WSAENETUNREACH
73 #define ENETRESET WSAENETRESET
74 #define ECONNABORTED WSAECONNABORTED
75 #define ECONNRESET WSAECONNRESET
76 #define ENOBUFS WSAENOBUFS
77 #define EISCONN WSAEISCONN
78 #define ENOTCONN WSAENOTCONN
79 #define ESHUTDOWN WSAESHUTDOWN
80 #define ETOOMANYREFS WSAETOOMANYREFS
81 #define ETIMEDOUT WSAETIMEDOUT
82 #define ECONNREFUSED WSAECONNREFUSED
83 #define ELOOP WSAELOOP
84 /* #define ENAMETOOLONG WSAENAMETOOLONG */
85 #define EHOSTDOWN WSAEHOSTDOWN
86 #define EHOSTUNREACH WSAEHOSTUNREACH
87 /* #define ENOTEMPTY WSAENOTEMPTY */
88 #define EPROCLIM WSAEPROCLIM
89 #define EUSERS WSAEUSERS
90 #define EDQUOT WSAEDQUOT
91 #define ESTALE WSAESTALE
92 #define EREMOTE WSAEREMOTE
93 #endif /* WIN32_NATIVE */
95 /* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */
96 #ifdef HAVE_BROKEN_INET_ADDR
97 # define IN_ADDR struct in_addr
98 # define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1)
101 # define IN_ADDR unsigned int
103 # define IN_ADDR unsigned long
105 # define NUMERIC_ADDR_ERROR (numeric_addr == (IN_ADDR) -1)
108 /* Define first descriptor number available for subprocesses. */
109 #define FIRST_PROC_DESC 3
112 # include <sys/sysmacros.h> /* for "minor" */
113 #endif /* not IRIS */
115 #endif /* !NO_SUBPROCESSES */
118 #include <sys/select.h>
121 #ifdef HAVE_STROPTS_H
122 #include <stropts.h> /* isastream(), I_PUSH */
126 #include <strtio.h> /* TIOCSIGNAL */
130 #include <pty.h> /* openpty() on Tru64, Linux */
133 #ifdef HAVE_LIBUTIL_H
134 #include <libutil.h> /* openpty() on FreeBSD */
138 #include <util.h> /* openpty() on NetBSD */
143 /* We could get this from param.h, but better not to depend on finding that.
144 And better not to risk that it might define other symbols used in this
147 # define MAXDESC FD_SETSIZE
150 # endif /* FD_SETSIZE */
151 # define SELECT_TYPE fd_set
153 #else /* no FD_SET */
156 # define SELECT_TYPE int
158 /* Define the macros to access a single-int bitmap of descriptors. */
159 # define FD_SET(n, p) (*(p) |= (1 << (n)))
160 # define FD_CLR(n, p) (*(p) &= ~(1 << (n)))
161 # define FD_ISSET(n, p) (*(p) & (1 << (n)))
162 # define FD_ZERO(p) (*(p) = 0)
164 #endif /* no FD_SET */
166 int poll_fds_for_input (SELECT_TYPE mask);
168 #endif /* INCLUDED_sysproc_h_ */