annotate src/s/sol2.h @ 296:5a79be0ef6a8 r21-0b46

Import from CVS: tag r21-0b46
author cvs
date Mon, 13 Aug 2007 10:38:46 +0200
parents 11cf20601dec
children 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
1 /* Synched up with: Completely divergent from FSF. */
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
2 #define SOLARIS2 1
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
3 #define POSIX 1
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
4
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
5 #ifndef USG
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
6 #define USG
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
7 #endif
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
8
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
9 #ifndef USG5_4
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
10 #define USG5_4
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
11 #endif
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
12
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
13 #undef _POSIX_C_SOURCE
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
14
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
15 #if OS_RELEASE > 54
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
16 /* There were some bugs with preprocessor symbol interaction, which
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
17 were not fixed until 2.5. */
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
18 #define __EXTENSIONS__ 1
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
19
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
20 #undef _XOPEN_SOURCE
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
21 #define _XOPEN_SOURCE 1
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
22
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
23 #undef _XOPEN_SOURCE_EXTENDED
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
24 #define _XOPEN_SOURCE_EXTENDED 1
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
25 #endif /* > Solaris 2.4 */
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
26
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents: 173
diff changeset
27 #if OS_RELEASE >= 57
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents: 173
diff changeset
28 #define HAVE_GETLOADAVG
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents: 173
diff changeset
29 #endif
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents: 173
diff changeset
30
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
31 /* Fix understandable GCC lossage on Solaris 2.6 */
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
32 #if defined(__GNUC__) && OS_RELEASE >= 56 && !defined(NOT_C_CODE)
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
33
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
34 /* GCC va_list munging is a little messed up */
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
35 #define __GNUC_VA_LIST
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
36 #define _VA_LIST_
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
37 #define _VA_LIST va_list
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
38 typedef void *__gnuc_va_list;
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
39 typedef __gnuc_va_list va_list;
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
40
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
41 /* Missing prototypes for functions added in Solaris 2.6 */
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
42 #include <sys/types.h>
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
43 struct msghdr;
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
44 struct sockaddr;
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
45 extern int __xnet_bind (int, const struct sockaddr *, size_t);
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
46 extern int __xnet_listen (int, int);
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
47 extern int __xnet_connect (int, const struct sockaddr *, size_t);
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
48 extern ssize_t __xnet_recvmsg (int, struct msghdr *, int);
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
49 extern ssize_t __xnet_sendmsg (int, const struct msghdr *, int);
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
50 extern ssize_t __xnet_sendto (int, const void *, size_t, int, const struct sockaddr *, size_t);
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
51 extern int __xnet_socket (int, int, int);
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
52 extern int __xnet_socketpair (int, int, int, int *);
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
53 extern int __xnet_getsockopt (int, int, int, void *, size_t *);
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
54 #endif /* GCC && >= Solaris 2.6 && C code */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
56 #include "usg5-4-2.h" /* XEmacs change from 5-4 to 5-4-2 */
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
57 #undef PC /* Defined in x86 /usr/include/sys/reg.h */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 /* SIGIO seems to be working under Solaris and it makes ^G work better... */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 #undef BROKEN_SIGIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 /* eggert@twinsun.com said these work in Solaris.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 Perhaps they work in all kinds of SVR4, but this is more conservative. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 #undef BROKEN_TIOCGETC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 #undef BROKEN_TIOCGWINSZ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
67 #ifdef NOT_C_CODE
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
68 #define ORDINARY_LINK
151
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 149
diff changeset
69 /* XEmacs change -- some Motif packages need -lgen to get regex and regcmp */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 #undef LIBS_SYSTEM
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
72 #define LIBS_SYSTEM "-lsocket -lnsl -lelf -lgen -ldl"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 /* SYSTEM_MALLOC must be defined if dbx/RTC is going to be used. dbx/RTC does
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 not work with a static definition of malloc(). */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 /* We want to be able to test out ralloc.c. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 /* #define SYSTEM_MALLOC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 /* XEmacs: there used to be a special definition of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 PTY_TTY_NAME_SPRINTF here that was identical to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 other SYSV R4 definitions except that it didn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 block SIGCHLD around the call to grantpt(). This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 is *not* in 19.29 and is almost certainly incorrect.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
151
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 149
diff changeset
86 #undef UNEXEC
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
87 #if OS_RELEASE < 56
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
88 #define UNEXEC "unexsol2.o"
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
89 #else
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
90 #define UNEXEC "unexsol2-6.o"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
91 #endif
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
92
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
93 #else /* C_CODE */
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
94
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
95 #if OS_RELEASE <= 53
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
96 /* Solaris 2.3 has a bug in XListFontsWithInfo. */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
97 #define BROKEN_XLISTFONTSWITHINFO
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
98 #endif
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
99
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
100 /* XEmacs addition: Raymond Toy says XEmacs completely misses SIGCHLD
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
101 when compiled with GCC 2.7.0 (but not, apparently, with SunPro C?),
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
102 X11R6, and Solaris 2.4.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
103
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
104 Someone else submitted a simple test program that duplicates this
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
105 behavior, and says it has something to do with the fact that X11R6
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
106 links with the threads library. */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
107
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
108 #ifdef THIS_IS_X11R6
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
109 #define BROKEN_SIGCHLD
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
110 #endif
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
111
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
112 #if OS_RELEASE < 55
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
113
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
114 #if __STDC__ == 1 && defined(__SUNPRO_C)
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
115 #define _POSIX_C_SOURCE 1
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
116 #include <setjmp.h>
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
117 #undef _POSIX_C_SOURCE
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
118 #endif /* cc -Xc */
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
119
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
120 /* Missing prototype, added in Solaris 2.5 */
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
121 extern void *__builtin_alloca (size_t);
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
122 #endif /* before SunOS 5.5 */
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
123
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
124 #if OS_RELEASE == 55
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
125 /* The following functions were added in Solaris 2.5,
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
126 but they forgot to add prototypes to the system header files. */
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
127 int getpagesize (void);
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
128 long random (void);
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
129 void srandom (unsigned int seed);
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
130 int usleep (unsigned int useconds);
169
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
131 #endif /* SunOS 5.5 */
15872534500d Import from CVS: tag r20-3b11
cvs
parents: 167
diff changeset
132
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
133 /* 2.5 now has `random' back in libc but we don't want to use it. */
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
134 #if OS_RELEASE >= 55
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
135 #undef HAVE_RANDOM
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
136 /* Apparently not necessary here, and it causes 10% CPU chewage. */
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
137 #undef BROKEN_SIGCHLD
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
138 #endif /* >= SunOS 5.5 */
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
139
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
140 #if OS_RELEASE < 56
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
141 /* Missing prototypes, added in Solaris 2.6 */
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
142 struct timeval;
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
143 int utimes (char *file, struct timeval *tvp);
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
144 int gethostname (char *name, int namelen);
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
145 #endif /* before SunOS 5.6 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
146
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
147 #include <sys/utsname.h> /* warning: macro redefined: SYS_NMLN */
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
148
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 /* XEmacs: Solaris has sigsetjmp but using it leads to core dumps at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 least under 2.4 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 #undef _setjmp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 #define _setjmp setjmp
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
153
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
154 #endif /* C_CODE */