* unexnext.c:
[bpt/emacs.git] / src / s / usg5-4.h
1 /* Definitions file for GNU Emacs running on AT&T's System V Release 4
2 Copyright (C) 1987, 1990, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
3 2006, 2007, 2008 Free Software Foundation, Inc.
4
5 This file is part of GNU Emacs.
6
7 GNU Emacs is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 GNU Emacs is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* This file written by James Van Artsdalen of Dell Computer Corporation.
21 * james@bigtex.cactus.org. Subsequently improved for Dell 2.2 by Eric
22 * S. Raymond <esr@snark.thyrsus.com>.
23 */
24
25 /* Use the SysVr3 file for at least base configuration. */
26
27 #define USG /* System III, System V, etc */
28
29 #define USG5
30 #define USG5_4
31
32 /* SYSTEM_TYPE should indicate the kind of system you are using.
33 It sets the Lisp variable system-type. */
34
35 #define SYSTEM_TYPE "usg-unix-v"
36
37 /* Default is to set interrupt_input to 0: don't do input buffering within Emacs */
38
39 /* #define INTERRUPT_INPUT */
40
41 /*
42 * Define HAVE_TERMIO if the system provides sysV-style ioctls
43 * for terminal control.
44 */
45
46 #define HAVE_TERMIO
47
48 /*
49 * Define HAVE_PTYS if the system supports pty devices.
50 */
51
52 /* Some versions of V.3 have this, but not all.
53 #define HAVE_PTYS
54 #define SYSV_PTYS */
55
56 /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */
57
58 /* #define HAVE_SOCKETS */
59
60 /*
61 * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate
62 * The 4.2 opendir, etc., library functions.
63 */
64
65 /* #define NONSYSTEM_DIR_LIBRARY */
66
67 /*
68 * Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir
69 * library functions. Almost, but not quite the same as
70 * the 4.2 functions
71 */
72 #define SYSV_SYSTEM_DIR
73
74 /* Define this symbol if your system has the functions bcopy, etc. */
75
76 /* #define BSTRING */
77
78 /* subprocesses should be defined if you want to
79 have code for asynchronous subprocesses
80 (as used in M-x compile and M-x shell).
81 This is supposed to work now on system V release 2. */
82
83 #define subprocesses
84
85 /* If your system uses COFF (Common Object File Format) then define the
86 preprocessor symbol "COFF". */
87
88 #define COFF
89
90 /* define MAIL_USE_FLOCK if the mailer uses flock
91 to interlock access to /usr/spool/mail/$USER.
92 The alternative is that a lock file named
93 /usr/spool/mail/$USER.lock. */
94
95 /* #define MAIL_USE_FLOCK */
96
97 /* Define CLASH_DETECTION if you want lock files to be written
98 so that Emacs can tell instantly when you try to modify
99 a file that someone else has modified in his Emacs. */
100
101 /* #define CLASH_DETECTION */
102
103 /* The file containing the kernel's symbol table is called /unix. */
104
105 #define KERNEL_FILE "/unix"
106
107 /* The symbol in the kernel where the load average is found
108 is named avenrun. */
109
110 #define LDAV_SYMBOL "avenrun"
111
112 /* Define this if system V IPC is available. */
113
114 #define HAVE_SYSVIPC
115
116 /* Special hacks needed to make Emacs run on this system. */
117
118 /*
119 * Make the sigsetmask function go away. Don't know what the
120 * ramifications of this are, but doesn't seem possible to
121 * emulate it properly anyway at this point.
122 */
123
124 #define sigsetmask(mask) /* Null expansion */
125
126 /* setjmp and longjmp can safely replace _setjmp and _longjmp,
127 but they will run slower. */
128
129 #define _setjmp setjmp
130 #define _longjmp longjmp
131
132 /* On USG systems these have different names */
133 #ifndef HAVE_INDEX
134 #define index strchr
135 #endif /* ! defined (HAVE_INDEX) */
136 #ifndef HAVE_RINDEX
137 #define rindex strrchr
138 #endif /* ! defined (HAVE_RINDEX) */
139
140 /* USG systems tend to put everything declared static
141 into the initialized data area, which becomes pure after dumping Emacs.
142 Foil this. Emacs carefully avoids static vars inside functions. */
143
144 #define static
145
146 /* Compiler bug bites on many systems when default ADDR_CORRECT is used. */
147
148 #define ADDR_CORRECT(x) (x)
149
150 /* Use terminfo instead of termcap. */
151
152 #define TERMINFO
153
154
155 /* The docs for system V/386 suggest v.3 has sigpause,
156 so let's give it a try. */
157 #define HAVE_SYSV_SIGPAUSE
158
159
160 /* If we're using the System V X port, BSD bstring functions will be handy */
161
162 #ifdef HAVE_X_WINDOWS
163 #define BSTRING
164 #endif /* HAVE_X_WINDOWS */
165
166 /* Enable support for shared libraries in unexec. */
167
168 #define USG_SHARED_LIBRARIES
169
170 /* On USG systems signal handlers return void */
171
172 #define SIGTYPE void
173
174 #define START_FILES pre-crt0.o /usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xt.o
175 #define LIB_STANDARD -lc /usr/ccs/lib/crtn.o
176
177 /* there are no -lg libraries on this system, and no libPW */
178
179 #define LIBS_DEBUG
180
181 /* Undump with ELF */
182
183 #undef COFF
184
185 #define UNEXEC unexelf.o
186
187 /* <sys/stat.h> *defines* stat(2) as a static function. If "static"
188 * is blank, then many files will have a public definition for stat(2).
189 */
190
191 #undef static
192
193 /* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct
194 * tchars. But get <termio.h> first to make sure ttold.h doesn't
195 * interfere. And don't try to use SIGIO yet.
196 */
197
198 #ifndef NOT_C_CODE
199 #include <sys/wait.h>
200 #endif
201
202 #ifdef emacs
203 #ifndef NO_FILIO_H
204 #include <sys/filio.h>
205 #endif
206 #include <termio.h>
207 #include <sys/ttold.h>
208 #include <signal.h>
209 #include <sys/stream.h>
210 #include <sys/stropts.h>
211 #include <sys/termios.h>
212 #define BROKEN_SIGIO
213 #endif
214
215 /* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
216 * instead, there's a system variable _sys_nsig. Unfortunately, we need the
217 * constant to dimension an array. So wire in the appropriate value here.
218 */
219 #define NSIG_MINIMUM 32
220
221 /* We need bss_end from emacs.c for undumping */
222
223 #ifndef USG_SHARED_LIBRARIES
224 #define USG_SHARED_LIBRARIES
225 #endif
226
227 /* We can support this */
228
229 #define CLASH_DETECTION
230
231 #define HAVE_PTYS
232 #define HAVE_TERMIOS
233
234 /* It is possible to receive SIGCHLD when there are no children
235 waiting, because a previous waitsys(2) cleaned up the carcass of child
236 without clearing the SIGCHLD pending info. So, use a non-blocking
237 wait3 instead, which maps to waitpid(2) in SysVr4. */
238
239 #define HAVE_WAIT_HEADER
240 #define WAITTYPE int
241 #define wait3(status, options, rusage) \
242 waitpid ((pid_t) -1, (status), (options))
243 #define WRETCODE(w) (w >> 8)
244
245 /* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
246 subprocesses the usual way. But TIOCSIGNAL does work for PTYs, and
247 this is all we need. */
248
249 #define TIOCSIGSEND TIOCSIGNAL
250
251 /* This change means that we don't loop through allocate_pty too many
252 times in the (rare) event of a failure. */
253
254 #define FIRST_PTY_LETTER 'z'
255
256 /* This sets the name of the master side of the PTY. */
257
258 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
259
260 /* This sets the name of the slave side of the PTY. On SysVr4,
261 grantpt(3) forks a subprocess, so keep sigchld_handler() from
262 intercepting that death. If any child but grantpt's should die
263 within, it should be caught after sigrelse(2). */
264
265 #define PTY_TTY_NAME_SPRINTF \
266 { \
267 char *ptsname (), *ptyname; \
268 \
269 sighold (SIGCLD); \
270 if (grantpt (fd) == -1) \
271 { emacs_close (fd); return -1; } \
272 sigrelse (SIGCLD); \
273 if (unlockpt (fd) == -1) \
274 { emacs_close (fd); return -1; } \
275 if (!(ptyname = ptsname (fd))) \
276 { emacs_close (fd); return -1; } \
277 strncpy (pty_name, ptyname, sizeof (pty_name)); \
278 pty_name[sizeof (pty_name) - 1] = 0; \
279 }
280
281 /* Push various streams modules onto a PTY channel. */
282
283 #define SETUP_SLAVE_PTY \
284 if (ioctl (xforkin, I_PUSH, "ptem") == -1) \
285 fatal ("ioctl I_PUSH ptem", errno); \
286 if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \
287 fatal ("ioctl I_PUSH ldterm", errno); \
288 if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
289 fatal ("ioctl I_PUSH ttcompat", errno);
290
291 /* Tell x11term.c and keyboard.c we have the system V streams feature. */
292 #define SYSV_STREAMS
293
294 /* This definition was suggested for next release.
295 So give it a try. */
296 #define HAVE_SOCKETS
297
298 /* Markus Weiand <weiand@khof.com> says this is needed for Motif on
299 SINIX. */
300 #define LIBS_SYSTEM -lgen
301
302 /* arch-tag: 1a0ed909-5faa-434b-b7c3-9d86c63d53a6
303 (do not change this comment) */