| 1 | /* Definitions file for GNU Emacs running on AT&T's System V Release 4 |
| 2 | |
| 3 | Copyright (C) 1987, 1990, 1999-2012 Free Software Foundation, Inc. |
| 4 | |
| 5 | Written by James Van Artsdalen of Dell Computer Corp. james@bigtex.cactus.org. |
| 6 | Subsequently improved for Dell 2.2 by Eric S. Raymond <esr@snark.thyrsus.com>. |
| 7 | |
| 8 | This file is part of GNU Emacs. |
| 9 | |
| 10 | GNU Emacs is free software: you can redistribute it and/or modify |
| 11 | it under the terms of the GNU General Public License as published by |
| 12 | the Free Software Foundation, either version 3 of the License, or |
| 13 | (at your option) any later version. |
| 14 | |
| 15 | GNU Emacs is distributed in the hope that it will be useful, |
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | GNU General Public License for more details. |
| 19 | |
| 20 | You should have received a copy of the GNU General Public License |
| 21 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 22 | |
| 23 | /* setjmp and longjmp can safely replace _setjmp and _longjmp, |
| 24 | but they will run slower. */ |
| 25 | #define _setjmp setjmp |
| 26 | #define _longjmp longjmp |
| 27 | |
| 28 | /* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct tchars. |
| 29 | But get <termio.h> first to make sure ttold.h doesn't interfere. */ |
| 30 | #include <sys/wait.h> |
| 31 | |
| 32 | #ifdef emacs |
| 33 | #include <sys/filio.h> |
| 34 | #include <termio.h> |
| 35 | #include <sys/ttold.h> |
| 36 | #include <signal.h> |
| 37 | #include <sys/stream.h> |
| 38 | #include <sys/stropts.h> |
| 39 | #include <sys/termios.h> |
| 40 | #endif |
| 41 | |
| 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. */ |
| 46 | #define wait3(status, options, rusage) \ |
| 47 | waitpid ((pid_t) -1, (status), (options)) |
| 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. */ |
| 53 | #define TIOCSIGSEND TIOCSIGNAL |
| 54 | |
| 55 | /* Push various streams modules onto a PTY channel. */ |
| 56 | #define SETUP_SLAVE_PTY \ |
| 57 | if (ioctl (xforkin, I_PUSH, "ptem") == -1) \ |
| 58 | fatal ("ioctl I_PUSH ptem"); \ |
| 59 | if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \ |
| 60 | fatal ("ioctl I_PUSH ldterm"); \ |
| 61 | if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \ |
| 62 | fatal ("ioctl I_PUSH ttcompat"); |