annotate src/s/usg5-4.h @ 456:c0335c02f1d7

Initial revision
author Jim Blandy <jimb@redhat.com>
date Fri, 13 Dec 1991 18:49:49 +0000
parents
children 44213fc1fbb6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 /* Definitions file for GNU Emacs running on AT&T's System V Release 4
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2 Copyright (C) 1987 Free Software Foundation, Inc.
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 This file is part of GNU Emacs.
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 GNU Emacs is distributed in the hope that it will be useful,
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 but WITHOUT ANY WARRANTY. No author or distributor
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 accepts responsibility to anyone for the consequences of using it
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 or for whether it serves any particular purpose or works at all,
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 unless he says so in writing. Refer to the GNU Emacs General Public
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 License for full details.
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 Everyone is granted permission to copy, modify and redistribute
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 GNU Emacs, but only under the conditions described in the
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 GNU Emacs General Public License. A copy of this license is
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 supposed to have been given to you along with GNU Emacs so you
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 can know your rights and responsibilities. It should be in a
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 file named COPYING. Among other things, the copyright notice
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 and this notice must be preserved on all copies. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 /* This file written by James Van Artsdalen of Dell Computer Corporation.
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 * james@bigtex.cactus.org.
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 /* Use the SysVr3 file for at least base configuration. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 #include "usg5-3.h"
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 #define USG5_4
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 /* We do have multiple jobs. Handle ^Z. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 #undef NOMULTIPLEJOBS
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 /* If compiled by GNU C, we must have gnulib */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 #ifdef __GNUC__
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 #define GNULIB /usr/local/lib/gcc-gnulib
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 #define LIBS_DEBUG
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 #else
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 #define GNULIB
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 #endif
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 #define START_FILES pre-crt0.o /usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xt.o
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 #define LIB_STANDARD GNULIB -lsocket -lnsl -lelf -lc /usr/ucblib/libucb.a /usr/ccs/lib/crtn.o
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 #define DATA_SEG_BITS 0x08000000
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 /* Use ptem.h to get structures related to windows. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 #define NEED_PTEM_H
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 /* Undump with ELF */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 #undef COFF
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 #define UNEXEC unexelf.o
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 /* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 * tchars. But get <termio.h> first to make sure ttold.h doesn't
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 * interfere. And don't try to use SIGIO yet.
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 #ifdef emacs
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 #include <sys/filio.h>
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 #include <termio.h>
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 #include <sys/ttold.h>
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 #include <signal.h>
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 #undef SIGIO
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71 #endif
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 /* libc has this stuff, but not utimes. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 #define HAVE_RENAME
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 #define HAVE_SELECT
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 #define HAVE_TIMEVAL
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 #define HAVE_CLOSEDIR
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 #define HAVE_GETTIMEOFDAY
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 #define HAVE_DUP2
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 #define USE_UTIME
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 /* <sys/stat.h> *defines* stat(2) as a static function. If "static"
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 * is blank, then many files will have a public definition for stat(2).
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88 #undef static
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90 /* We need bss_end from emacs.c for undumping */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 #ifndef USG_SHARED_LIBRARIES
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 #define USG_SHARED_LIBRARIES
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 #endif
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 /* We can support this */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 #define CLASH_DETECTION
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 #define HAVE_PTYS
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 #define HAVE_SETSID
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103 /* It is possible to receive SIGCHLD when there are no children
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 waiting, because a previous waitsys(2) cleaned up the carcass of child
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 without clearing the SIGCHLD pending info. So, use a non-blocking
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 wait3 instead, which maps to waitpid(2) in SysVr4. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 #define HAVE_WAIT_HEADER
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 #define WAITTYPE int
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
110 #define wait3(status, options, rusage) \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
111 waitpid((pid_t) -1, (status), (options))
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 #define WRETCODE(w) (w >> 8)
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114 /* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 subprocesses the usual way. But TIOCSIGNAL does work for PTYs, and
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 this is all we need. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 #define TIOCSIGSEND TIOCSIGNAL
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 /* This change means that we don't loop through allocate_pty too many
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 times in the (rare) event of a failure. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 #undef FIRST_PTY_LETTER
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 #define FIRST_PTY_LETTER 'z'
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 /* This sets the name of the master side of the PTY. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 /* This sets the name of the slave side of the PTY. On SysVr4,
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 grantpt(3) forks a subprocess, so keep sigchld_handler() from
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 intercepting that death. If any child but grantpt's should die
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 within, it should be caught after sigrelse(2). */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 #define PTY_TTY_NAME_SPRINTF \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 { \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 char *ptsname(), *ptyname; \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 sighold(SIGCLD); \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140 if (grantpt(fd) == -1) \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141 fatal("could not grant slave pty"); \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 sigrelse(SIGCLD); \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 if (unlockpt(fd) == -1) \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 fatal("could not unlock slave pty"); \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145 if (!(ptyname = ptsname(fd))) \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 fatal ("could not enable slave pty"); \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 strncpy(pty_name, ptyname, sizeof(pty_name)); \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 pty_name[sizeof(pty_name) - 1] = 0; \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149 }
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151 /* Push various streams modules onto a PTY channel. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
153 #define SETUP_SLAVE_PTY \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 if (ioctl (xforkin, I_PUSH, "ptem") == -1) \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 fatal ("ioctl I_PUSH ptem", errno); \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156 if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157 fatal ("ioctl I_PUSH ldterm", errno); \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158 if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159 fatal ("ioctl I_PUSH ttcompat", errno);
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161 /* The definition of this in usg5-3.h is not needed in 5.4. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 #undef LIBX11_SYSTEM