annotate src/sysproc.h @ 54:05472e90ae02 r19-16-pre2

Import from CVS: tag r19-16-pre2
author cvs
date Mon, 13 Aug 2007 08:57:55 +0200
parents 376386a54a3c
children 4be1180a9e89
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. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #include <sys/resource.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #if !defined (NO_SUBPROCESSES)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 # include <sys/socket.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 # include <netdb.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 # include <netinet/in.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 # include <arpa/inet.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 #ifdef NEED_NET_ERRNO_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 #include <net/errno.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 #endif /* NEED_NET_ERRNO_H */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #elif defined (SKTPAIR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 # include <sys/socket.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #endif /* HAVE_SOCKETS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 /* TERM is a poor-man's SLIP, used on Linux. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 #ifdef HAVE_TERM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 # include <client.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 /* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 #ifdef HAVE_BROKEN_INET_ADDR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 # define IN_ADDR struct in_addr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 # define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 # if (LONGBITS > 32)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 # define IN_ADDR unsigned int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 # define IN_ADDR unsigned long
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 # define NUMERIC_ADDR_ERROR (numeric_addr == (IN_ADDR) -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 /* Define first descriptor number available for subprocesses. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 #ifdef VMS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 # define FIRST_PROC_DESC 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 #else /* Not VMS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 # define FIRST_PROC_DESC 3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 #endif
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 IRIS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 # include <sys/sysmacros.h> /* for "minor" */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 #endif /* not IRIS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 #endif /* !NO_SUBPROCESSES */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 #ifdef AIX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 #include <sys/select.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 #ifdef FD_SET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 /* 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
83 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
84 file. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 # ifdef FD_SETSIZE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 # define MAXDESC FD_SETSIZE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 # define MAXDESC 64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 # endif /* FD_SETSIZE */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 # define SELECT_TYPE fd_set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 #else /* no FD_SET */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 # define MAXDESC 32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 # define SELECT_TYPE int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 /* Define the macros to access a single-int bitmap of descriptors. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 # define FD_SET(n, p) (*(p) |= (1 << (n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 # define FD_CLR(n, p) (*(p) &= ~(1 << (n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 # define FD_ISSET(n, p) (*(p) & (1 << (n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 # define FD_ZERO(p) (*(p) = 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 #endif /* no FD_SET */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 #ifdef EMACS_BTL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 extern int cadillac_stop_logging ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 extern int cadillac_start_logging ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 #ifdef ENERGIZE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 extern Lisp_Object energize_get_buffer_process (Lisp_Object);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 extern Lisp_Object Fenergize_user_input_buffer_mark (Lisp_Object);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 extern Lisp_Object Venergize_process;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 extern int poll_fds_for_input (SELECT_TYPE mask);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 #ifdef MSDOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 /* #include <process.h> */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 /* Damn that local process.h! Instead we can define P_WAIT ourselves. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 #define P_WAIT 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 #endif