0
|
1 /*
|
|
2 Copyright (C) 1995 Free Software Foundation, Inc.
|
|
3
|
|
4 This file is part of XEmacs.
|
|
5
|
|
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
|
|
9 later version.
|
|
10
|
|
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
|
|
14 for more details.
|
|
15
|
|
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. */
|
|
20
|
|
21 /* Synched up with: Not really in FSF. */
|
|
22
|
|
23 #ifdef HAVE_VFORK_H
|
|
24 # include <vfork.h>
|
|
25 #endif
|
|
26
|
|
27 #include "systime.h" /* necessary for sys/resource.h; also gets the
|
|
28 FD_* defines on some systems. */
|
|
29 #include <sys/resource.h>
|
|
30
|
|
31 #if !defined (NO_SUBPROCESSES)
|
|
32
|
|
33 #ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */
|
|
34 # include <sys/socket.h>
|
|
35 # include <netdb.h>
|
|
36 # include <netinet/in.h>
|
|
37 # include <arpa/inet.h>
|
|
38 #ifdef NEED_NET_ERRNO_H
|
|
39 #include <net/errno.h>
|
|
40 #endif /* NEED_NET_ERRNO_H */
|
|
41 #elif defined (SKTPAIR)
|
|
42 # include <sys/socket.h>
|
|
43 #endif /* HAVE_SOCKETS */
|
|
44
|
|
45 /* TERM is a poor-man's SLIP, used on Linux. */
|
|
46 #ifdef HAVE_TERM
|
|
47 # include <client.h>
|
|
48 #endif
|
|
49
|
|
50 /* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */
|
|
51 #ifdef HAVE_BROKEN_INET_ADDR
|
|
52 # define IN_ADDR struct in_addr
|
|
53 # define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1)
|
|
54 #else
|
|
55 # if (LONGBITS > 32)
|
|
56 # define IN_ADDR unsigned int
|
|
57 # else
|
|
58 # define IN_ADDR unsigned long
|
|
59 # endif
|
|
60 # define NUMERIC_ADDR_ERROR (numeric_addr == (IN_ADDR) -1)
|
|
61 #endif
|
|
62
|
|
63 /* Define first descriptor number available for subprocesses. */
|
|
64 #ifdef VMS
|
|
65 # define FIRST_PROC_DESC 1
|
|
66 #else /* Not VMS */
|
|
67 # define FIRST_PROC_DESC 3
|
|
68 #endif
|
|
69
|
|
70 #ifdef IRIS
|
|
71 # include <sys/sysmacros.h> /* for "minor" */
|
|
72 #endif /* not IRIS */
|
|
73
|
|
74 #endif /* !NO_SUBPROCESSES */
|
|
75
|
|
76 #ifdef AIX
|
|
77 #include <sys/select.h>
|
|
78 #endif
|
|
79
|
|
80 #ifdef FD_SET
|
|
81
|
|
82 /* We could get this from param.h, but better not to depend on finding that.
|
|
83 And better not to risk that it might define other symbols used in this
|
|
84 file. */
|
|
85 # ifdef FD_SETSIZE
|
|
86 # define MAXDESC FD_SETSIZE
|
|
87 # else
|
|
88 # define MAXDESC 64
|
|
89 # endif /* FD_SETSIZE */
|
|
90 # define SELECT_TYPE fd_set
|
|
91
|
|
92 #else /* no FD_SET */
|
|
93
|
|
94 # define MAXDESC 32
|
|
95 # define SELECT_TYPE int
|
|
96
|
|
97 /* Define the macros to access a single-int bitmap of descriptors. */
|
|
98 # define FD_SET(n, p) (*(p) |= (1 << (n)))
|
|
99 # define FD_CLR(n, p) (*(p) &= ~(1 << (n)))
|
|
100 # define FD_ISSET(n, p) (*(p) & (1 << (n)))
|
|
101 # define FD_ZERO(p) (*(p) = 0)
|
|
102
|
|
103 #endif /* no FD_SET */
|
|
104
|
|
105 #ifdef EMACS_BTL
|
|
106 extern int cadillac_stop_logging ();
|
|
107 extern int cadillac_start_logging ();
|
|
108 #endif
|
|
109
|
|
110 #ifdef ENERGIZE
|
|
111 extern Lisp_Object energize_get_buffer_process (Lisp_Object);
|
|
112 extern Lisp_Object Fenergize_user_input_buffer_mark (Lisp_Object);
|
|
113 extern Lisp_Object Venergize_process;
|
|
114 #endif
|
|
115
|
|
116 extern int poll_fds_for_input (SELECT_TYPE mask);
|
|
117
|
|
118 #ifdef MSDOS
|
|
119 /* #include <process.h> */
|
|
120 /* Damn that local process.h! Instead we can define P_WAIT ourselves. */
|
|
121 #define P_WAIT 1
|
|
122 #endif
|