annotate src/s/sol2.h @ 863:42375619fa45

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