Replace tests for SYSV_SYSTEM_DIR with HAVE_DIRENT_H, set via autoconf
[bpt/emacs.git] / src / s / usg5-4-common.h
CommitLineData
20c428fd 1/* Definitions file for GNU Emacs running on AT&T's System V Release 4
40c17879
GM
2
3Copyright (C) 1987, 1990, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
20c428fd 5
e05aebe9
GM
6Written by James Van Artsdalen of Dell Computer Corp. james@bigtex.cactus.org.
7Subsequently improved for Dell 2.2 by Eric S. Raymond <esr@snark.thyrsus.com>.
8
20c428fd
JB
9This file is part of GNU Emacs.
10
4b158629 11GNU Emacs is free software: you can redistribute it and/or modify
bd307392 12it under the terms of the GNU General Public License as published by
4b158629
GM
13the Free Software Foundation, either version 3 of the License, or
14(at your option) any later version.
bd307392 15
20c428fd 16GNU Emacs is distributed in the hope that it will be useful,
bd307392
JB
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License
4b158629 22along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20c428fd 23
e05aebe9 24/* Use the SysVr3 file for at least base configuration. */
f2a77c3a 25#define USG /* System III, System V, etc */
20c428fd 26
f2a77c3a 27#define USG5
20c428fd
JB
28#define USG5_4
29
f2a77c3a 30/* SYSTEM_TYPE should indicate the kind of system you are using.
e05aebe9 31 It sets the Lisp variable system-type. */
f2a77c3a 32#define SYSTEM_TYPE "usg-unix-v"
20c428fd 33
e05aebe9
GM
34/* Define HAVE_TERMIO if the system provides sysV-style ioctls
35 for terminal control. */
f2a77c3a
DN
36#define HAVE_TERMIO
37
f2a77c3a 38/* The file containing the kernel's symbol table is called /unix. */
f2a77c3a
DN
39#define KERNEL_FILE "/unix"
40
e05aebe9 41/* The kernel symbol where the load average is found is named avenrun. */
f2a77c3a
DN
42#define LDAV_SYMBOL "avenrun"
43
f2a77c3a
DN
44/* setjmp and longjmp can safely replace _setjmp and _longjmp,
45 but they will run slower. */
f2a77c3a
DN
46#define _setjmp setjmp
47#define _longjmp longjmp
48
e05aebe9 49/* The docs for system V/386 suggest v.3 has sigpause, so let's try it. */
f2a77c3a
DN
50#define HAVE_SYSV_SIGPAUSE
51
e05aebe9 52/* On USG systems signal handlers return void. */
f2a77c3a 53#define SIGTYPE void
5cb70bb5 54
e05aebe9
GM
55/* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct tchars.
56 But get <termio.h> first to make sure ttold.h doesn't interfere.
57 And don't try to use SIGIO yet. */
f0ce95e7 58#include <sys/wait.h>
f0ce95e7 59
20c428fd
JB
60#ifdef emacs
61#include <sys/filio.h>
62#include <termio.h>
63#include <sys/ttold.h>
64#include <signal.h>
bd307392
JB
65#include <sys/stream.h>
66#include <sys/stropts.h>
67#include <sys/termios.h>
bb7b4368 68#define BROKEN_SIGIO
20c428fd
JB
69#endif
70
5447018c 71/* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
e05aebe9
GM
72 instead, there's a system variable _sys_nsig. Unfortunately, we need the
73 constant to dimension an array. So wire in the appropriate value here. */
bb7b4368 74#define NSIG_MINIMUM 32
5447018c 75
e05aebe9 76/* We can support this. */
20c428fd
JB
77#define CLASH_DETECTION
78
e05aebe9 79/* Define HAVE_PTYS if the system supports pty devices. */
20c428fd 80#define HAVE_PTYS
5447018c 81#define HAVE_TERMIOS
20c428fd
JB
82
83/* It is possible to receive SIGCHLD when there are no children
84 waiting, because a previous waitsys(2) cleaned up the carcass of child
85 without clearing the SIGCHLD pending info. So, use a non-blocking
86 wait3 instead, which maps to waitpid(2) in SysVr4. */
20c428fd 87#define wait3(status, options, rusage) \
5bf62b08 88 waitpid ((pid_t) -1, (status), (options))
20c428fd
JB
89#define WRETCODE(w) (w >> 8)
90
91/* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
92 subprocesses the usual way. But TIOCSIGNAL does work for PTYs, and
93 this is all we need. */
20c428fd
JB
94#define TIOCSIGSEND TIOCSIGNAL
95
96/* This change means that we don't loop through allocate_pty too many
e05aebe9 97 times in the (rare) event of a failure. */
20c428fd
JB
98#define FIRST_PTY_LETTER 'z'
99
e05aebe9 100/* This sets the name of the master side of the PTY. */
20c428fd
JB
101#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
102
e05aebe9 103/* Push various streams modules onto a PTY channel. */
20c428fd
JB
104#define SETUP_SLAVE_PTY \
105 if (ioctl (xforkin, I_PUSH, "ptem") == -1) \
106 fatal ("ioctl I_PUSH ptem", errno); \
107 if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \
108 fatal ("ioctl I_PUSH ldterm", errno); \
109 if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
110 fatal ("ioctl I_PUSH ttcompat", errno);
111
e05aebe9 112/* This definition was suggested for next release. So give it a try. */
bd307392 113#define HAVE_SOCKETS
5cb70bb5 114
ab5796a9
MB
115/* arch-tag: 1a0ed909-5faa-434b-b7c3-9d86c63d53a6
116 (do not change this comment) */