Misc code tweaks.
[bpt/emacs.git] / src / s / usg5-4.h
CommitLineData
20c428fd 1/* Definitions file for GNU Emacs running on AT&T's System V Release 4
4b158629 2 Copyright (C) 1987, 1990, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
114f9c96 3 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
20c428fd
JB
4
5This file is part of GNU Emacs.
6
4b158629 7GNU Emacs is free software: you can redistribute it and/or modify
bd307392 8it under the terms of the GNU General Public License as published by
4b158629
GM
9the Free Software Foundation, either version 3 of the License, or
10(at your option) any later version.
bd307392 11
20c428fd 12GNU Emacs is distributed in the hope that it will be useful,
bd307392
JB
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
4b158629 18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20c428fd
JB
19
20/* This file written by James Van Artsdalen of Dell Computer Corporation.
5447018c
JB
21 * james@bigtex.cactus.org. Subsequently improved for Dell 2.2 by Eric
22 * S. Raymond <esr@snark.thyrsus.com>.
20c428fd
JB
23 */
24
25/* Use the SysVr3 file for at least base configuration. */
26
f2a77c3a 27#define USG /* System III, System V, etc */
20c428fd 28
f2a77c3a 29#define USG5
20c428fd
JB
30#define USG5_4
31
f2a77c3a
DN
32/* SYSTEM_TYPE should indicate the kind of system you are using.
33 It sets the Lisp variable system-type. */
20c428fd 34
f2a77c3a 35#define SYSTEM_TYPE "usg-unix-v"
20c428fd 36
f2a77c3a
DN
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
f2a77c3a
DN
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
f2a77c3a
DN
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
f2a77c3a
DN
64/* setjmp and longjmp can safely replace _setjmp and _longjmp,
65 but they will run slower. */
66
67#define _setjmp setjmp
68#define _longjmp longjmp
69
70/* On USG systems these have different names */
71#ifndef HAVE_INDEX
72#define index strchr
73#endif /* ! defined (HAVE_INDEX) */
74#ifndef HAVE_RINDEX
75#define rindex strrchr
76#endif /* ! defined (HAVE_RINDEX) */
77
f2a77c3a
DN
78/* Use terminfo instead of termcap. */
79
80#define TERMINFO
81
82
83/* The docs for system V/386 suggest v.3 has sigpause,
84 so let's give it a try. */
85#define HAVE_SYSV_SIGPAUSE
86
87
88/* If we're using the System V X port, BSD bstring functions will be handy */
89
90#ifdef HAVE_X_WINDOWS
91#define BSTRING
92#endif /* HAVE_X_WINDOWS */
93
f2a77c3a
DN
94/* On USG systems signal handlers return void */
95
96#define SIGTYPE void
5cb70bb5 97
d6bf1bdb
DN
98#define ORDINARY_LINK
99
20c428fd
JB
100/* Undump with ELF */
101
102#undef COFF
103
104#define UNEXEC unexelf.o
105
106/* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct
107 * tchars. But get <termio.h> first to make sure ttold.h doesn't
108 * interfere. And don't try to use SIGIO yet.
109 */
110
f0ce95e7
RS
111#ifndef NOT_C_CODE
112#include <sys/wait.h>
113#endif
114
20c428fd
JB
115#ifdef emacs
116#include <sys/filio.h>
117#include <termio.h>
118#include <sys/ttold.h>
119#include <signal.h>
bd307392
JB
120#include <sys/stream.h>
121#include <sys/stropts.h>
122#include <sys/termios.h>
bb7b4368 123#define BROKEN_SIGIO
20c428fd
JB
124#endif
125
5447018c
JB
126/* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
127 * instead, there's a system variable _sys_nsig. Unfortunately, we need the
128 * constant to dimension an array. So wire in the appropriate value here.
129 */
bb7b4368 130#define NSIG_MINIMUM 32
5447018c 131
20c428fd
JB
132/* We can support this */
133
134#define CLASH_DETECTION
135
136#define HAVE_PTYS
5447018c 137#define HAVE_TERMIOS
20c428fd
JB
138
139/* It is possible to receive SIGCHLD when there are no children
140 waiting, because a previous waitsys(2) cleaned up the carcass of child
141 without clearing the SIGCHLD pending info. So, use a non-blocking
142 wait3 instead, which maps to waitpid(2) in SysVr4. */
143
20c428fd 144#define wait3(status, options, rusage) \
5bf62b08 145 waitpid ((pid_t) -1, (status), (options))
20c428fd
JB
146#define WRETCODE(w) (w >> 8)
147
148/* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
149 subprocesses the usual way. But TIOCSIGNAL does work for PTYs, and
150 this is all we need. */
151
152#define TIOCSIGSEND TIOCSIGNAL
153
154/* This change means that we don't loop through allocate_pty too many
155 times in the (rare) event of a failure. */
156
20c428fd
JB
157#define FIRST_PTY_LETTER 'z'
158
159/* This sets the name of the master side of the PTY. */
160
161#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
162
20c428fd
JB
163/* Push various streams modules onto a PTY channel. */
164
165#define SETUP_SLAVE_PTY \
166 if (ioctl (xforkin, I_PUSH, "ptem") == -1) \
167 fatal ("ioctl I_PUSH ptem", errno); \
168 if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \
169 fatal ("ioctl I_PUSH ldterm", errno); \
170 if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
171 fatal ("ioctl I_PUSH ttcompat", errno);
172
bd307392
JB
173/* This definition was suggested for next release.
174 So give it a try. */
175#define HAVE_SOCKETS
5cb70bb5 176
ab5796a9
MB
177/* arch-tag: 1a0ed909-5faa-434b-b7c3-9d86c63d53a6
178 (do not change this comment) */