annotate src/s/usg5-4-common.h @ 112441:2097405cdc11

Merge: Check return values of some library calls.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 22 Jan 2011 23:32:08 -0800
parents ef719132ddfa
children
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
108310
17d73312ed65 Move TERMINFO, LIBS_TERMCAP from cpp to configure.
Glenn Morris <rgm@gnu.org>
parents: 108274
diff changeset
2
17d73312ed65 Move TERMINFO, LIBS_TERMCAP from cpp to configure.
Glenn Morris <rgm@gnu.org>
parents: 108274
diff changeset
3 Copyright (C) 1987, 1990, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
112228
417b1e4d63cd Merge from emacs-23
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 110441
diff changeset
4 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
6 Written by James Van Artsdalen of Dell Computer Corp. james@bigtex.cactus.org.
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
7 Subsequently improved for Dell 2.2 by Eric S. Raymond <esr@snark.thyrsus.com>.
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
8
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 This file is part of GNU Emacs.
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10
94715
1f134b61867c Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
11 GNU Emacs is free software: you can redistribute it and/or modify
1039
8ab465f7a7ff *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 999
diff changeset
12 it under the terms of the GNU General Public License as published by
94715
1f134b61867c Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
13 the Free Software Foundation, either version 3 of the License, or
1f134b61867c Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
14 (at your option) any later version.
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15
1039
8ab465f7a7ff *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 999
diff changeset
16 GNU Emacs is distributed in the hope that it will be useful,
8ab465f7a7ff *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 999
diff changeset
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
8ab465f7a7ff *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 999
diff changeset
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8ab465f7a7ff *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 999
diff changeset
19 GNU General Public License for more details.
8ab465f7a7ff *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 999
diff changeset
20
8ab465f7a7ff *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 999
diff changeset
21 You should have received a copy of the GNU General Public License
94715
1f134b61867c Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
22 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
24 /* Use the SysVr3 file for at least base configuration. */
96303
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
25 #define USG /* System III, System V, etc */
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26
96303
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
27 #define USG5
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 #define USG5_4
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29
96303
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
30 /* SYSTEM_TYPE should indicate the kind of system you are using.
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
31 It sets the Lisp variable system-type. */
96303
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
32 #define SYSTEM_TYPE "usg-unix-v"
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
33
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
34 /* The file containing the kernel's symbol table is called /unix. */
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
35 #define KERNEL_FILE "/unix"
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
36
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
37 /* The kernel symbol where the load average is found is named avenrun. */
96303
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
38 #define LDAV_SYMBOL "avenrun"
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
39
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
40 /* setjmp and longjmp can safely replace _setjmp and _longjmp,
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
41 but they will run slower. */
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
42 #define _setjmp setjmp
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
43 #define _longjmp longjmp
4336
96d3869ae231 (bzero, bcmp, bcopy): New macros.
Richard M. Stallman <rms@gnu.org>
parents: 4295
diff changeset
44
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
45 /* The docs for system V/386 suggest v.3 has sigpause, so let's try it. */
96303
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
46 #define HAVE_SYSV_SIGPAUSE
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
47
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
48 /* On USG systems signal handlers return void. */
96303
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
49 #define SIGTYPE void
ddedcecb18ef * unexnext.c:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 94715
diff changeset
50
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
51 /* Get FIONREAD from <sys/filio.h>. Get <sys/ttold.h> to get struct tchars.
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
52 But get <termio.h> first to make sure ttold.h doesn't interfere.
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
53 And don't try to use SIGIO yet. */
13466
e31afd8b6355 Always include sys/wait.h unless NOT_C_CODE;
Richard M. Stallman <rms@gnu.org>
parents: 12734
diff changeset
54 #include <sys/wait.h>
e31afd8b6355 Always include sys/wait.h unless NOT_C_CODE;
Richard M. Stallman <rms@gnu.org>
parents: 12734
diff changeset
55
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 #ifdef emacs
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 #include <sys/filio.h>
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 #include <termio.h>
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 #include <sys/ttold.h>
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 #include <signal.h>
1039
8ab465f7a7ff *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 999
diff changeset
61 #include <sys/stream.h>
8ab465f7a7ff *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 999
diff changeset
62 #include <sys/stropts.h>
8ab465f7a7ff *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 999
diff changeset
63 #include <sys/termios.h>
26090
63fd40a97a75 s/usg5-4.h:
Paul Eggert <eggert@twinsun.com>
parents: 23914
diff changeset
64 #define BROKEN_SIGIO
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 #endif
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66
2116
76df2de3dd55 * s/usg5-4.h: Changes from Eric Raymond:
Jim Blandy <jimb@redhat.com>
parents: 1868
diff changeset
67 /* Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
68 instead, there's a system variable _sys_nsig. Unfortunately, we need the
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
69 constant to dimension an array. So wire in the appropriate value here. */
26090
63fd40a97a75 s/usg5-4.h:
Paul Eggert <eggert@twinsun.com>
parents: 23914
diff changeset
70 #define NSIG_MINIMUM 32
2116
76df2de3dd55 * s/usg5-4.h: Changes from Eric Raymond:
Jim Blandy <jimb@redhat.com>
parents: 1868
diff changeset
71
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
72 /* We can support this. */
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 #define CLASH_DETECTION
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
75 /* Define HAVE_PTYS if the system supports pty devices. */
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 #define HAVE_PTYS
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 /* It is possible to receive SIGCHLD when there are no children
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 waiting, because a previous waitsys(2) cleaned up the carcass of child
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 without clearing the SIGCHLD pending info. So, use a non-blocking
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 wait3 instead, which maps to waitpid(2) in SysVr4. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 #define wait3(status, options, rusage) \
8283
32427329c42c (PTY_TTY_NAME_SPRINTF): Fail smoothly if cannot get pty.
Richard M. Stallman <rms@gnu.org>
parents: 7947
diff changeset
83 waitpid ((pid_t) -1, (status), (options))
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 #define WRETCODE(w) (w >> 8)
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 /* TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 subprocesses the usual way. But TIOCSIGNAL does work for PTYs, and
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88 this is all we need. */
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 #define TIOCSIGSEND TIOCSIGNAL
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 /* This change means that we don't loop through allocate_pty too many
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
92 times in the (rare) event of a failure. */
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 #define FIRST_PTY_LETTER 'z'
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
95 /* This sets the name of the master side of the PTY. */
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
98 /* Push various streams modules onto a PTY channel. */
456
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 #define SETUP_SLAVE_PTY \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 if (ioctl (xforkin, I_PUSH, "ptem") == -1) \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 fatal ("ioctl I_PUSH ptem", errno); \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103 fatal ("ioctl I_PUSH ldterm", errno); \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 if (ioctl (xforkin, I_PUSH, "ttcompat") == -1) \
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 fatal ("ioctl I_PUSH ttcompat", errno);
c0335c02f1d7 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106
108511
f8e62c2bf3e9 Reformat some comments in src/s/*.h.
Glenn Morris <rgm@gnu.org>
parents: 108310
diff changeset
107 /* This definition was suggested for next release. So give it a try. */
1039
8ab465f7a7ff *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 999
diff changeset
108 #define HAVE_SOCKETS
4336
96d3869ae231 (bzero, bcmp, bcopy): New macros.
Richard M. Stallman <rms@gnu.org>
parents: 4295
diff changeset
109