Merge from trunk
[bpt/emacs.git] / src / s / usg5-4-common.h
1 /* Definitions file for GNU Emacs running on AT&T's System V Release 4
2
3 Copyright (C) 1987, 1990, 1999-2011 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 /* Use the SysVr3 file for at least base configuration. */
24 #define USG /* System III, System V, etc */
25
26 #define USG5
27 #define USG5_4
28
29 /* SYSTEM_TYPE should indicate the kind of system you are using.
30 It sets the Lisp variable system-type. */
31 #define SYSTEM_TYPE "usg-unix-v"
32
33 /* The file containing the kernel's symbol table is called /unix. */
34 #define KERNEL_FILE "/unix"
35
36 /* The kernel symbol where the load average is found is named avenrun. */
37 #define LDAV_SYMBOL "avenrun"
38
39 /* setjmp and longjmp can safely replace _setjmp and _longjmp,
40 but they will run slower. */
41 #define _setjmp setjmp
42 #define _longjmp longjmp
43
44 /* The docs for system V/386 suggest v.3 has sigpause, so let's try it. */
45 #define HAVE_SYSV_SIGPAUSE
46
47 /* On USG systems signal handlers return void. */
48 #define SIGTYPE void
49
50 /* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct tchars.
51 But get <termio.h> first to make sure ttold.h doesn't interfere.
52 And don't try to use SIGIO yet. */
53 #include <sys/wait.h>
54
55 #ifdef emacs
56 #include <sys/filio.h>
57 #include <termio.h>
58 #include <sys/ttold.h>
59 #include <signal.h>
60 #include <sys/stream.h>
61 #include <sys/stropts.h>
62 #include <sys/termios.h>
63 #define BROKEN_SIGIO
64 #endif
65
66 /* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
67 instead, there's a system variable _sys_nsig. Unfortunately, we need the
68 constant to dimension an array. So wire in the appropriate value here. */
69 #define NSIG_MINIMUM 32
70
71 /* We can support this. */
72 #define CLASH_DETECTION
73
74 /* Define HAVE_PTYS if the system supports pty devices. */
75 #define HAVE_PTYS
76
77 /* It is possible to receive SIGCHLD when there are no children
78 waiting, because a previous waitsys(2) cleaned up the carcass of child
79 without clearing the SIGCHLD pending info. So, use a non-blocking
80 wait3 instead, which maps to waitpid(2) in SysVr4. */
81 #define wait3(status, options, rusage) \
82 waitpid ((pid_t) -1, (status), (options))
83 #define WRETCODE(w) (w >> 8)
84
85 /* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
86 subprocesses the usual way. But TIOCSIGNAL does work for PTYs, and
87 this is all we need. */
88 #define TIOCSIGSEND TIOCSIGNAL
89
90 /* This change means that we don't loop through allocate_pty too many
91 times in the (rare) event of a failure. */
92 #define FIRST_PTY_LETTER 'z'
93
94 /* This sets the name of the master side of the PTY. */
95 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
96
97 /* Push various streams modules onto a PTY channel. */
98 #define SETUP_SLAVE_PTY \
99 if (ioctl (xforkin, I_PUSH, "ptem") == -1) \
100 fatal ("ioctl I_PUSH ptem", errno); \
101 if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \
102 fatal ("ioctl I_PUSH ldterm", errno); \
103 if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
104 fatal ("ioctl I_PUSH ttcompat", errno);
105
106 /* This definition was suggested for next release. So give it a try. */
107 #define HAVE_SOCKETS
108