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. */
27 #include "systime.h" /* necessary for sys/resource.h; also gets the
28 FD_* defines on some systems. */
30 #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 */
48 /* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */
49 #ifdef HAVE_BROKEN_INET_ADDR
50 # define IN_ADDR struct in_addr
51 # define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1)
54 # define IN_ADDR unsigned int
56 # define IN_ADDR unsigned long
58 # define NUMERIC_ADDR_ERROR (numeric_addr == (IN_ADDR) -1)
61 /* Define first descriptor number available for subprocesses. */
62 #define FIRST_PROC_DESC 3
65 # include <sys/sysmacros.h> /* for "minor" */
68 #endif /* !NO_SUBPROCESSES */
71 #include <sys/select.h>
76 /* We could get this from param.h, but better not to depend on finding that.
77 And better not to risk that it might define other symbols used in this
80 # define MAXDESC FD_SETSIZE
83 # endif /* FD_SETSIZE */
84 # define SELECT_TYPE fd_set
89 # define SELECT_TYPE int
91 /* Define the macros to access a single-int bitmap of descriptors. */
92 # define FD_SET(n, p) (*(p) |= (1 << (n)))
93 # define FD_CLR(n, p) (*(p) &= ~(1 << (n)))
94 # define FD_ISSET(n, p) (*(p) & (1 << (n)))
95 # define FD_ZERO(p) (*(p) = 0)
97 #endif /* no FD_SET */
99 int poll_fds_for_input (SELECT_TYPE mask);
102 /* #include <process.h> */
103 /* Damn that local process.h! Instead we can define P_WAIT ourselves. */