comparison src/s/sol2.h @ 169:15872534500d r20-3b11

Import from CVS: tag r20-3b11
author cvs
date Mon, 13 Aug 2007 09:46:53 +0200
parents 85ec50267440
children 8eaf7971accc
comparison
equal deleted inserted replaced
168:9851d5c6556e 169:15872534500d
1 /* Synched up with: FSF 19.31. */ 1 /* Synched up with: FSF 19.31. */
2 2
3 #define __EXTENSIONS__ 1
4 #define SOLARIS2 1 3 #define SOLARIS2 1
5 #define POSIX 1 4 #define POSIX 1
6 #if 1 5
7 #ifndef USG 6 #ifndef USG
8 #define USG 7 #define USG
9 #endif 8 #endif
9
10 #ifndef USG5_4 10 #ifndef USG5_4
11 #define USG5_4 11 #define USG5_4
12 #endif 12 #endif
13 #if 0 13
14 #undef SYSTEM_TYPE 14 #define __EXTENSIONS__ 1
15 #define SYSTEM_TYPE "solaris" 15
16 #endif
17 #undef _POSIX_C_SOURCE 16 #undef _POSIX_C_SOURCE
18 #if 0 17
19 #define _POSIX_C_SOURCE 199506L 18 /* Solaris 2.4 math.h doesn't respect __EXTENSIONS__ */
20 #endif 19 #ifndef NOT_C_CODE
20
21 #if OS_RELEASE <= 54
22 #include <math.h>
23 #endif /* <= Solaris 2.4 */
24
25 /* Fix understandable GCC lossage on Solaris 2.6 */
26 #if OS_RELEASE >= 56
27 #ifdef __GNUC__
28 #define __GNUC_VA_LIST
29 #define _VA_LIST_
30 #define _VA_LIST va_list
31 typedef void *__gnuc_va_list;
32 typedef __gnuc_va_list va_list;
33 #endif /* GCC */
34 #endif /* >= Solaris 2.6 */
35
36 #endif /* C code */
37
21 #undef _XOPEN_SOURCE 38 #undef _XOPEN_SOURCE
39 #define _XOPEN_SOURCE 1
40
22 #undef _XOPEN_SOURCE_EXTENDED 41 #undef _XOPEN_SOURCE_EXTENDED
23 #if OS_RELEASE >= 55
24 #define _XOPEN_SOURCE 1
25 #define _XOPEN_SOURCE_EXTENDED 1 42 #define _XOPEN_SOURCE_EXTENDED 1
26 #endif /* >= SunOS 5.5 */
27 #endif
28 43
29 #if 1 /* mrb */
30 #include "usg5-4-2.h" /* XEmacs change from 5-4 to 5-4-2 */ 44 #include "usg5-4-2.h" /* XEmacs change from 5-4 to 5-4-2 */
31 #endif 45 #undef PC /* Defined in x86 /usr/include/sys/reg.h */
32 46
33 /* SIGIO seems to be working under Solaris and it makes ^G work better... */ 47 /* SIGIO seems to be working under Solaris and it makes ^G work better... */
34 #undef BROKEN_SIGIO 48 #undef BROKEN_SIGIO
35 49
36 /* eggert@twinsun.com said these work in Solaris. 50 /* eggert@twinsun.com said these work in Solaris.
88 102
89 #ifdef THIS_IS_X11R6 103 #ifdef THIS_IS_X11R6
90 #define BROKEN_SIGCHLD 104 #define BROKEN_SIGCHLD
91 #endif 105 #endif
92 106
93 #if OS_RELEASE == 55
94 /* Solaris 2.5 is the first Solaris that has getpagesize(), srandom()
95 and random(), but they forgot to add prototypes to the header
96 files. */
97 int getpagesize (void);
98 long random (void);
99 void srandom (unsigned int seed);
100 #endif /* SunOS 5.5 */
101
102 #if OS_RELEASE < 55 107 #if OS_RELEASE < 55
103 /* Missing prototype, added in Solaris 2.5 */ 108 /* Missing prototype, added in Solaris 2.5 */
104 extern void *__builtin_alloca(size_t); 109 extern void *__builtin_alloca(size_t);
105 #endif /* before SunOS 5.5 */ 110 #endif /* before SunOS 5.5 */
111
112 #if OS_RELEASE == 55
113 /* The following functions were added in Solaris 2.5,
114 but they forgot to add prototypes to the system header files. */
115 int getpagesize (void);
116 long random (void);
117 void srandom (unsigned int seed);
118 int usleep(unsigned int useconds);
119 #endif /* SunOS 5.5 */
106 120
107 #if OS_RELEASE < 56 121 #if OS_RELEASE < 56
108 /* Missing prototypes, added in Solaris 2.6 */ 122 /* Missing prototypes, added in Solaris 2.6 */
109 struct timeval; 123 struct timeval;
110 int utimes (char *file, struct timeval *tvp); 124 int utimes (char *file, struct timeval *tvp);
111 int gethostname(char *name, int namelen); 125 int gethostname(char *name, int namelen);
112 int usleep(unsigned int useconds);
113 #endif /* before SunOS 5.6 */ 126 #endif /* before SunOS 5.6 */
127
128 #if defined(__GNUC__) && OS_RELEASE >= 56
129 /* Missing prototypes for functions added in Solaris 2.6 */
130 struct msghdr;
131 struct sockaddr;
132 extern int __xnet_bind(int, const struct sockaddr *, size_t);
133 extern int __xnet_listen(int, int);
134 extern int __xnet_connect(int, const struct sockaddr *, size_t);
135 extern ssize_t __xnet_recvmsg(int, struct msghdr *, int);
136 extern ssize_t __xnet_sendmsg(int, const struct msghdr *, int);
137 extern ssize_t __xnet_sendto(int, const void *, size_t, int, const struct sockaddr *, size_t);
138 extern int __xnet_socket(int, int, int);
139 extern int __xnet_socketpair(int, int, int, int *);
140 extern int __xnet_getsockopt(int, int, int, void *, size_t *);
141 #endif /* GCC && >= SunOS 5.6 */
114 142
115 #include <sys/utsname.h> /* warning: macro redefined: SYS_NMLN */ 143 #include <sys/utsname.h> /* warning: macro redefined: SYS_NMLN */
116 144
117 /* Get non-ANSI functions from ANSI header files in cc -Xc mode. 145 /* Get non-ANSI functions from ANSI header files in cc -Xc mode.
118 Sun has promised to fix setjmp.h */ 146 Sun has promised to fix setjmp.h */