]> code.delx.au - gnu-emacs/blob - src/s/usg5-4.h
* config.in: Regenerate.
[gnu-emacs] / 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 /*
38 * Define HAVE_TERMIO if the system provides sysV-style ioctls
39 * for terminal control.
40 */
41
42 #define HAVE_TERMIO
43
44 /*
45 * Define HAVE_PTYS if the system supports pty devices.
46 */
47
48 /*
49 * Define SYSV_SYSTEM_DIR to use the V.3 getdents/readir
50 * library functions. Almost, but not quite the same as
51 * the 4.2 functions
52 */
53 #define SYSV_SYSTEM_DIR
54
55 /* The file containing the kernel's symbol table is called /unix. */
56
57 #define KERNEL_FILE "/unix"
58
59 /* The symbol in the kernel where the load average is found
60 is named avenrun. */
61
62 #define LDAV_SYMBOL "avenrun"
63
64 /* Special hacks needed to make Emacs run on this system. */
65
66 /*
67 * Make the sigsetmask function go away. Don't know what the
68 * ramifications of this are, but doesn't seem possible to
69 * emulate it properly anyway at this point.
70 */
71
72 #define sigsetmask(mask) /* Null expansion */
73
74 /* setjmp and longjmp can safely replace _setjmp and _longjmp,
75 but they will run slower. */
76
77 #define _setjmp setjmp
78 #define _longjmp longjmp
79
80 /* On USG systems these have different names */
81 #ifndef HAVE_INDEX
82 #define index strchr
83 #endif /* ! defined (HAVE_INDEX) */
84 #ifndef HAVE_RINDEX
85 #define rindex strrchr
86 #endif /* ! defined (HAVE_RINDEX) */
87
88 /* Compiler bug bites on many systems when default ADDR_CORRECT is used. */
89
90 #define ADDR_CORRECT(x) (x)
91
92 /* Use terminfo instead of termcap. */
93
94 #define TERMINFO
95
96
97 /* The docs for system V/386 suggest v.3 has sigpause,
98 so let's give it a try. */
99 #define HAVE_SYSV_SIGPAUSE
100
101
102 /* If we're using the System V X port, BSD bstring functions will be handy */
103
104 #ifdef HAVE_X_WINDOWS
105 #define BSTRING
106 #endif /* HAVE_X_WINDOWS */
107
108 /* On USG systems signal handlers return void */
109
110 #define SIGTYPE void
111
112 #define ORDINARY_LINK
113
114 #define LIB_STANDARD
115
116 /* there are no -lg libraries on this system, and no libPW */
117
118 #define LIBS_DEBUG
119
120 /* Undump with ELF */
121
122 #undef COFF
123
124 #define UNEXEC unexelf.o
125
126 /* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct
127 * tchars. But get <termio.h> first to make sure ttold.h doesn't
128 * interfere. And don't try to use SIGIO yet.
129 */
130
131 #ifndef NOT_C_CODE
132 #include <sys/wait.h>
133 #endif
134
135 #ifdef emacs
136 #include <sys/filio.h>
137 #include <termio.h>
138 #include <sys/ttold.h>
139 #include <signal.h>
140 #include <sys/stream.h>
141 #include <sys/stropts.h>
142 #include <sys/termios.h>
143 #define BROKEN_SIGIO
144 #endif
145
146 /* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
147 * instead, there's a system variable _sys_nsig. Unfortunately, we need the
148 * constant to dimension an array. So wire in the appropriate value here.
149 */
150 #define NSIG_MINIMUM 32
151
152 /* We can support this */
153
154 #define CLASH_DETECTION
155
156 #define HAVE_PTYS
157 #define HAVE_TERMIOS
158
159 /* It is possible to receive SIGCHLD when there are no children
160 waiting, because a previous waitsys(2) cleaned up the carcass of child
161 without clearing the SIGCHLD pending info. So, use a non-blocking
162 wait3 instead, which maps to waitpid(2) in SysVr4. */
163
164 #define wait3(status, options, rusage) \
165 waitpid ((pid_t) -1, (status), (options))
166 #define WRETCODE(w) (w >> 8)
167
168 /* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
169 subprocesses the usual way. But TIOCSIGNAL does work for PTYs, and
170 this is all we need. */
171
172 #define TIOCSIGSEND TIOCSIGNAL
173
174 /* This change means that we don't loop through allocate_pty too many
175 times in the (rare) event of a failure. */
176
177 #define FIRST_PTY_LETTER 'z'
178
179 /* This sets the name of the master side of the PTY. */
180
181 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
182
183 /* This sets the name of the slave side of the PTY. On SysVr4,
184 grantpt(3) forks a subprocess, so keep sigchld_handler() from
185 intercepting that death. If any child but grantpt's should die
186 within, it should be caught after sigrelse(2). */
187
188 #define PTY_TTY_NAME_SPRINTF \
189 { \
190 char *ptsname (), *ptyname; \
191 \
192 sighold (SIGCLD); \
193 if (grantpt (fd) == -1) \
194 { emacs_close (fd); return -1; } \
195 sigrelse (SIGCLD); \
196 if (unlockpt (fd) == -1) \
197 { emacs_close (fd); return -1; } \
198 if (!(ptyname = ptsname (fd))) \
199 { emacs_close (fd); return -1; } \
200 strncpy (pty_name, ptyname, sizeof (pty_name)); \
201 pty_name[sizeof (pty_name) - 1] = 0; \
202 }
203
204 /* Push various streams modules onto a PTY channel. */
205
206 #define SETUP_SLAVE_PTY \
207 if (ioctl (xforkin, I_PUSH, "ptem") == -1) \
208 fatal ("ioctl I_PUSH ptem", errno); \
209 if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \
210 fatal ("ioctl I_PUSH ldterm", errno); \
211 if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
212 fatal ("ioctl I_PUSH ttcompat", errno);
213
214 /* This definition was suggested for next release.
215 So give it a try. */
216 #define HAVE_SOCKETS
217
218 /* arch-tag: 1a0ed909-5faa-434b-b7c3-9d86c63d53a6
219 (do not change this comment) */