Move "system type" macros from src/s to configure
[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
acaf905b 3Copyright (C) 1987, 1990, 1999-2012 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
f2a77c3a
DN
23/* setjmp and longjmp can safely replace _setjmp and _longjmp,
24 but they will run slower. */
f2a77c3a
DN
25#define _setjmp setjmp
26#define _longjmp longjmp
27
e05aebe9 28/* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct tchars.
45fa9c0f 29 But get <termio.h> first to make sure ttold.h doesn't interfere. */
f0ce95e7 30#include <sys/wait.h>
f0ce95e7 31
20c428fd
JB
32#ifdef emacs
33#include <sys/filio.h>
34#include <termio.h>
35#include <sys/ttold.h>
36#include <signal.h>
bd307392
JB
37#include <sys/stream.h>
38#include <sys/stropts.h>
39#include <sys/termios.h>
20c428fd
JB
40#endif
41
20c428fd
JB
42/* It is possible to receive SIGCHLD when there are no children
43 waiting, because a previous waitsys(2) cleaned up the carcass of child
44 without clearing the SIGCHLD pending info. So, use a non-blocking
45 wait3 instead, which maps to waitpid(2) in SysVr4. */
20c428fd 46#define wait3(status, options, rusage) \
5bf62b08 47 waitpid ((pid_t) -1, (status), (options))
20c428fd
JB
48#define WRETCODE(w) (w >> 8)
49
50/* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
51 subprocesses the usual way. But TIOCSIGNAL does work for PTYs, and
52 this is all we need. */
20c428fd
JB
53#define TIOCSIGSEND TIOCSIGNAL
54
e05aebe9 55/* Push various streams modules onto a PTY channel. */
20c428fd
JB
56#define SETUP_SLAVE_PTY \
57 if (ioctl (xforkin, I_PUSH, "ptem") == -1) \
efc736d3 58 fatal ("ioctl I_PUSH ptem"); \
20c428fd 59 if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \
efc736d3 60 fatal ("ioctl I_PUSH ldterm"); \
20c428fd 61 if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
efc736d3 62 fatal ("ioctl I_PUSH ttcompat");