annotate src/s/sol2.h @ 398:74fd4e045ea6 r21-2-29

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