annotate src/sysproc.h @ 410:de805c49cfc1 r21-2-35

Import from CVS: tag r21-2-35
author cvs
date Mon, 13 Aug 2007 11:19:21 +0200
parents 74fd4e045ea6
children 697ef44129c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Synched up with: Not really in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
23 #ifndef INCLUDED_sysproc_h_
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
24 #define INCLUDED_sysproc_h_
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
25
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #ifdef HAVE_VFORK_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 # include <vfork.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #include "systime.h" /* necessary for sys/resource.h; also gets the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 FD_* defines on some systems. */
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
32 #ifndef WIN32_NATIVE
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #include <sys/resource.h>
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
34 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #if !defined (NO_SUBPROCESSES)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 #ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */
274
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
39 # include <sys/types.h> /* AJK */
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
40 # ifndef WIN32_NATIVE
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
41 # include <sys/socket.h>
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
42 # include <netdb.h>
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
43 # include <netinet/in.h>
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
44 # include <arpa/inet.h>
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
45 # endif
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
46 # ifdef NEED_NET_ERRNO_H
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
47 # include <net/errno.h>
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
48 # endif /* NEED_NET_ERRNO_H */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 #elif defined (SKTPAIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 # include <sys/socket.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 #endif /* HAVE_SOCKETS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
53 #ifdef WIN32_NATIVE
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
54 /* Note: winsock.h already included in systime.h above */
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
55 /* map winsock error codes to standard names */
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
56 #define EWOULDBLOCK WSAEWOULDBLOCK
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
57 #define EINPROGRESS WSAEINPROGRESS
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
58 #define EALREADY WSAEALREADY
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
59 #define ENOTSOCK WSAENOTSOCK
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
60 #define EDESTADDRREQ WSAEDESTADDRREQ
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
61 #define EMSGSIZE WSAEMSGSIZE
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
62 #define EPROTOTYPE WSAEPROTOTYPE
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
63 #define ENOPROTOOPT WSAENOPROTOOPT
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
64 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
65 #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
66 #define EOPNOTSUPP WSAEOPNOTSUPP
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
67 #define EPFNOSUPPORT WSAEPFNOSUPPORT
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
68 #define EAFNOSUPPORT WSAEAFNOSUPPORT
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
69 #define EADDRINUSE WSAEADDRINUSE
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
70 #define EADDRNOTAVAIL WSAEADDRNOTAVAIL
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
71 #define ENETDOWN WSAENETDOWN
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
72 #define ENETUNREACH WSAENETUNREACH
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
73 #define ENETRESET WSAENETRESET
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
74 #define ECONNABORTED WSAECONNABORTED
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
75 #define ECONNRESET WSAECONNRESET
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
76 #define ENOBUFS WSAENOBUFS
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
77 #define EISCONN WSAEISCONN
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
78 #define ENOTCONN WSAENOTCONN
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
79 #define ESHUTDOWN WSAESHUTDOWN
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
80 #define ETOOMANYREFS WSAETOOMANYREFS
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
81 #define ETIMEDOUT WSAETIMEDOUT
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
82 #define ECONNREFUSED WSAECONNREFUSED
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
83 #define ELOOP WSAELOOP
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
84 /* #define ENAMETOOLONG WSAENAMETOOLONG */
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
85 #define EHOSTDOWN WSAEHOSTDOWN
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
86 #define EHOSTUNREACH WSAEHOSTUNREACH
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
87 /* #define ENOTEMPTY WSAENOTEMPTY */
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
88 #define EPROCLIM WSAEPROCLIM
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
89 #define EUSERS WSAEUSERS
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
90 #define EDQUOT WSAEDQUOT
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
91 #define ESTALE WSAESTALE
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
92 #define EREMOTE WSAEREMOTE
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
93 #endif /* WIN32_NATIVE */
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 398
diff changeset
94
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 /* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 #ifdef HAVE_BROKEN_INET_ADDR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 # define IN_ADDR struct in_addr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 # define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 # if (LONGBITS > 32)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 # define IN_ADDR unsigned int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 # define IN_ADDR unsigned long
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 # define NUMERIC_ADDR_ERROR (numeric_addr == (IN_ADDR) -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 /* Define first descriptor number available for subprocesses. */
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 100
diff changeset
109 #define FIRST_PROC_DESC 3
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 #ifdef IRIS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 # include <sys/sysmacros.h> /* for "minor" */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 #endif /* not IRIS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 #endif /* !NO_SUBPROCESSES */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 #ifdef AIX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 #include <sys/select.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 #ifdef FD_SET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 /* We could get this from param.h, but better not to depend on finding that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 And better not to risk that it might define other symbols used in this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 file. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 # ifdef FD_SETSIZE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 # define MAXDESC FD_SETSIZE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 # define MAXDESC 64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 # endif /* FD_SETSIZE */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 # define SELECT_TYPE fd_set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 #else /* no FD_SET */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 # define MAXDESC 32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 # define SELECT_TYPE int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 /* Define the macros to access a single-int bitmap of descriptors. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 # define FD_SET(n, p) (*(p) |= (1 << (n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 # define FD_CLR(n, p) (*(p) &= ~(1 << (n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 # define FD_ISSET(n, p) (*(p) & (1 << (n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 # define FD_ZERO(p) (*(p) = 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 #endif /* no FD_SET */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 257
diff changeset
146 int poll_fds_for_input (SELECT_TYPE mask);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
148 #endif /* INCLUDED_sysproc_h_ */