2 Copyright (C) 1995 Free Software Foundation, Inc.
4 This file is part of SXEmacs
6 SXEmacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 SXEmacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* Synched up with: Not really in FSF. */
22 #ifndef INCLUDED_sysproc_h_
23 #define INCLUDED_sysproc_h_
29 #include "systime.h" /* necessary for sys/resource.h; also gets the
30 FD_* defines on some systems. */
31 #include <sys/resource.h>
33 #if !defined (NO_SUBPROCESSES)
35 #ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */
36 # include <sys/types.h> /* AJK */
37 # include <sys/socket.h>
39 # include <netinet/in.h>
40 # include <arpa/inet.h>
41 # ifdef NEED_NET_ERRNO_H
42 # include <net/errno.h>
43 # endif /* NEED_NET_ERRNO_H */
44 #elif defined (SKTPAIR)
45 # include <sys/socket.h>
46 #endif /* HAVE_SOCKETS */
49 /* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */
50 #ifdef HAVE_BROKEN_INET_ADDR
51 # define IN_ADDR struct in_addr
52 # define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1)
54 # if (SXE_LONGBITS > 32)
55 # define IN_ADDR unsigned int
57 # define IN_ADDR unsigned long
59 # define NUMERIC_ADDR_ERROR (numeric_addr == (IN_ADDR) -1)
62 /* Define first descriptor number available for subprocesses. */
63 #define FIRST_PROC_DESC 3
66 # include <sys/sysmacros.h> /* for "minor" */
69 #endif /* !NO_SUBPROCESSES */
72 #include <sys/select.h>
76 #include <stropts.h> /* isastream(), I_PUSH */
80 #include <strtio.h> /* TIOCSIGNAL */
84 #include <pty.h> /* openpty() on Tru64, Linux */
88 #include <libutil.h> /* openpty() on FreeBSD */
92 #include <util.h> /* openpty() on NetBSD */
97 /* We could get this from param.h, but better not to depend on finding that.
98 And better not to risk that it might define other symbols used in this
101 # define MAXDESC FD_SETSIZE
104 # endif /* FD_SETSIZE */
105 # define SELECT_TYPE fd_set
107 #else /* no FD_SET */
110 # define SELECT_TYPE int
112 /* Define the macros to access a single-int bitmap of descriptors. */
113 # define FD_SET(n, p) (*(p) |= (1 << (n)))
114 # define FD_CLR(n, p) (*(p) &= ~(1 << (n)))
115 # define FD_ISSET(n, p) (*(p) & (1 << (n)))
116 # define FD_ZERO(p) (*(p) = 0)
118 #endif /* no FD_SET */
120 int poll_fds_for_input(SELECT_TYPE mask);
122 #endif /* INCLUDED_sysproc_h_ */