annotate src/sysproc.h @ 274:ca9a9ec9c1c1 r21-0b35

Import from CVS: tag r21-0b35
author cvs
date Mon, 13 Aug 2007 10:29:42 +0200
parents c5d627a313b1
children 1d62742628b6
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 #ifdef HAVE_VFORK_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 # include <vfork.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #include "systime.h" /* necessary for sys/resource.h; also gets the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 FD_* defines on some systems. */
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
29 #ifndef WINDOWSNT
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #include <sys/resource.h>
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 0
diff changeset
31 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #if !defined (NO_SUBPROCESSES)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */
274
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
36 # include <sys/types.h> /* AJK */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 # include <sys/socket.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 # include <netdb.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 # include <netinet/in.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 # include <arpa/inet.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #ifdef NEED_NET_ERRNO_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 #include <net/errno.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #endif /* NEED_NET_ERRNO_H */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 #elif defined (SKTPAIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 # include <sys/socket.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 #endif /* HAVE_SOCKETS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 /* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 #ifdef HAVE_BROKEN_INET_ADDR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 # define IN_ADDR struct in_addr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 # define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 # if (LONGBITS > 32)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 # define IN_ADDR unsigned int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 # define IN_ADDR unsigned long
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 # define NUMERIC_ADDR_ERROR (numeric_addr == (IN_ADDR) -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 /* Define first descriptor number available for subprocesses. */
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 100
diff changeset
62 #define FIRST_PROC_DESC 3
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 #ifdef IRIS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 # include <sys/sysmacros.h> /* for "minor" */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 #endif /* not IRIS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 #endif /* !NO_SUBPROCESSES */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 #ifdef AIX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 #include <sys/select.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 #ifdef FD_SET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 /* 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
77 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
78 file. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 # ifdef FD_SETSIZE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 # define MAXDESC FD_SETSIZE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 # define MAXDESC 64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 # endif /* FD_SETSIZE */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 # define SELECT_TYPE fd_set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 #else /* no FD_SET */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 # define MAXDESC 32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 # define SELECT_TYPE int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 /* Define the macros to access a single-int bitmap of descriptors. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 # define FD_SET(n, p) (*(p) |= (1 << (n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 # define FD_CLR(n, p) (*(p) &= ~(1 << (n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 # define FD_ISSET(n, p) (*(p) & (1 << (n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 # define FD_ZERO(p) (*(p) = 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 #endif /* no FD_SET */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 #ifdef EMACS_BTL
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 257
diff changeset
100 int cadillac_stop_logging ();
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 257
diff changeset
101 int cadillac_start_logging ();
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 257
diff changeset
104 int poll_fds_for_input (SELECT_TYPE mask);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 #ifdef MSDOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 /* #include <process.h> */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 /* Damn that local process.h! Instead we can define P_WAIT ourselves. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 #define P_WAIT 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 #endif