annotate src/os_unixx.h @ 537:e321639cfa3e

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