7
|
1 /* vi:set ts=8 sts=4 sw=4:
|
|
2 *
|
|
3 * VIM - Vi IMproved by Bram Moolenaar
|
|
4 *
|
|
5 * Do ":help uganda" in Vim to read copying and usage conditions.
|
|
6 * Do ":help credits" in Vim to see a list of people who contributed.
|
|
7 */
|
|
8
|
|
9 /*
|
|
10 * os_unixx.h -- include files that are only used in os_unix.c
|
|
11 */
|
|
12
|
|
13 /*
|
|
14 * Stuff for signals
|
|
15 */
|
|
16 #if defined(HAVE_SIGSET) && !defined(signal)
|
|
17 # define signal sigset
|
|
18 #endif
|
|
19
|
|
20 /* sun's sys/ioctl.h redefines symbols from termio world */
|
|
21 #if defined(HAVE_SYS_IOCTL_H) && !defined(sun)
|
|
22 # include <sys/ioctl.h>
|
|
23 #endif
|
|
24
|
|
25 #ifndef USE_SYSTEM /* use fork/exec to start the shell */
|
|
26
|
|
27 # if defined(HAVE_SYS_WAIT_H) || defined(HAVE_UNION_WAIT)
|
|
28 # include <sys/wait.h>
|
|
29 # endif
|
|
30
|
|
31 # ifndef WEXITSTATUS
|
|
32 # ifdef HAVE_UNION_WAIT
|
|
33 # define WEXITSTATUS(stat_val) ((stat_val).w_T.w_Retcode)
|
|
34 # else
|
|
35 # define WEXITSTATUS(stat_val) (((stat_val) >> 8) & 0377)
|
|
36 # endif
|
|
37 # endif
|
|
38
|
|
39 # ifndef WIFEXITED
|
|
40 # ifdef HAVE_UNION_WAIT
|
|
41 # define WIFEXITED(stat_val) ((stat_val).w_T.w_Termsig == 0)
|
|
42 # else
|
|
43 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
|
|
44 # endif
|
|
45 # endif
|
|
46
|
|
47 #endif /* !USE_SYSTEM */
|
|
48
|
|
49 #ifdef HAVE_STROPTS_H
|
|
50 #ifdef sinix
|
|
51 #define buf_T __system_buf_t__
|
|
52 #endif
|
|
53 # include <stropts.h>
|
|
54 #ifdef sinix
|
|
55 #undef buf_T
|
|
56 #endif
|
|
57 #endif
|
|
58
|
|
59 #ifdef HAVE_STRING_H
|
|
60 # include <string.h>
|
|
61 #endif
|
|
62
|
|
63 #ifdef HAVE_SYS_STREAM_H
|
|
64 # include <sys/stream.h>
|
|
65 #endif
|
|
66
|
|
67 #ifdef HAVE_SYS_UTSNAME_H
|
|
68 # include <sys/utsname.h>
|
|
69 #endif
|
|
70
|
|
71 #ifdef HAVE_SYS_SYSTEMINFO_H
|
|
72 /*
|
|
73 * foolish Sinix <sys/systeminfo.h> uses SYS_NMLN but doesn't include
|
|
74 * <limits.h>, where it is defined. Perhaps other systems have the same
|
|
75 * problem? Include it here. -- Slootman
|
|
76 */
|
|
77 # if defined(HAVE_LIMITS_H) && !defined(_LIMITS_H)
|
|
78 # include <limits.h> /* for SYS_NMLN (Sinix 5.41 / Unix SysV.4) */
|
|
79 # endif
|
11
|
80
|
|
81 /* Define SYS_NMLN ourselves if it still isn't defined (for CrayT3E). */
|
|
82 # ifndef SYS_NMLN
|
|
83 # define SYS_NMLN 32
|
|
84 # endif
|
|
85
|
7
|
86 # include <sys/systeminfo.h> /* for sysinfo */
|
|
87 #endif
|
|
88
|
|
89 /*
|
|
90 * We use termios.h if both termios.h and termio.h are available.
|
|
91 * Termios is supposed to be a superset of termio.h. Don't include them both,
|
|
92 * it may give problems on some systems (e.g. hpux).
|
|
93 * I don't understand why we don't want termios.h for apollo.
|
|
94 */
|
|
95 #if defined(HAVE_TERMIOS_H) && !defined(apollo)
|
|
96 # include <termios.h>
|
|
97 #else
|
|
98 # ifdef HAVE_TERMIO_H
|
|
99 # include <termio.h>
|
|
100 # else
|
|
101 # ifdef HAVE_SGTTY_H
|
|
102 # include <sgtty.h>
|
|
103 # endif
|
|
104 # endif
|
|
105 #endif
|
|
106
|
|
107 #ifdef HAVE_SYS_PTEM_H
|
|
108 # include <sys/ptem.h> /* must be after termios.h for Sinix */
|
|
109 # ifndef _IO_PTEM_H /* For UnixWare that should check for _IO_PT_PTEM_H */
|
|
110 # define _IO_PTEM_H
|
|
111 # endif
|
|
112 #endif
|
|
113
|
|
114 /* shared library access */
|
|
115 #if defined(HAVE_DLFCN_H) && defined(USE_DLOPEN)
|
802
|
116 # ifdef __MVS__
|
|
117 /* needed to define RTLD_LAZY (Anthony Giorgio) */
|
|
118 # define __SUSV3
|
|
119 # endif
|
7
|
120 # include <dlfcn.h>
|
|
121 #else
|
|
122 # if defined(HAVE_DL_H) && defined(HAVE_SHL_LOAD)
|
|
123 # include <dl.h>
|
|
124 # endif
|
|
125 #endif
|