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