annotate src/s/sol2.h @ 163:0132846995bd r20-3b8

Import from CVS: tag r20-3b8
author cvs
date Mon, 13 Aug 2007 09:43:35 +0200
parents 6b37e6ddd302
children 85ec50267440
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Synched up with: FSF 19.31. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
3 #define __EXTENSIONS__ 1
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
4 #define SOLARIS2 1
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
5 #define POSIX 1
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
6 #if 1
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
7 #ifndef USG
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
8 #define USG
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
9 #endif
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
10 #ifndef USG5_4
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
11 #define USG5_4
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
12 #endif
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
13 #if 0
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
14 #undef SYSTEM_TYPE
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
15 #define SYSTEM_TYPE "solaris"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
16 #endif
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
17 #undef _POSIX_C_SOURCE
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
18 #if 0
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
19 #define _POSIX_C_SOURCE 199506L
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
20 #endif
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
21 #undef _XOPEN_SOURCE
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
22 #define _XOPEN_SOURCE 1
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
23 #undef _XOPEN_SOURCE_EXTENDED
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
24 #define _XOPEN_SOURCE_EXTENDED 1
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
25 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
27 #if 1 /* mrb */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
28 #include "usg5-4-2.h" /* XEmacs change from 5-4 to 5-4-2 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
29 #endif
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 /* SIGIO seems to be working under Solaris and it makes ^G work better... */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #undef BROKEN_SIGIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 /* eggert@twinsun.com said these work in Solaris.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 Perhaps they work in all kinds of SVR4, but this is more conservative. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #undef BROKEN_TIOCGETC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #undef BROKEN_TIOCGWINSZ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
39 #ifdef NOT_C_CODE
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
40 #define ORDINARY_LINK
151
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 149
diff changeset
41 /* XEmacs change -- some Motif packages need -lgen to get regex and regcmp */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #undef LIBS_SYSTEM
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
44 #define LIBS_SYSTEM "-lsocket -lnsl -lelf -lgen -ldl"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 /* 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
47 not work with a static definition of malloc(). */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 /* We want to be able to test out ralloc.c. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 /* #define SYSTEM_MALLOC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 /* XEmacs: there used to be a special definition of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 PTY_TTY_NAME_SPRINTF here that was identical to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 other SYSV R4 definitions except that it didn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 block SIGCHLD around the call to grantpt(). This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 is *not* in 19.29 and is almost certainly incorrect.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
151
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 149
diff changeset
58 #undef UNEXEC
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
59 #if OS_RELEASE < 56
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
60 #define UNEXEC "unexsol2.o"
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
61 #else
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
62 #define UNEXEC "unexsol2-6.o"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
63 #endif
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
64
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
65 #else /* C_CODE */
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
66
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
67 #if OS_RELEASE <= 53
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
68 /* Solaris 2.3 has a bug in XListFontsWithInfo. */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
69 #define BROKEN_XLISTFONTSWITHINFO
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
70 #endif
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
71
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
72 /* 2.5 now has random back in libc but we don't want to use it. */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
73 #if OS_RELEASE >= 55
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
74 #undef HAVE_RANDOM
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
75 /* Apparently not necessary here, and it causes 10% CPU chewage. */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
76 #undef BROKEN_SIGCHLD
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
77 #endif /* >= SunOS 5.5 */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
78
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
79 /* XEmacs addition: Raymond Toy says XEmacs completely misses SIGCHLD
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
80 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
81 X11R6, and Solaris 2.4.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
82
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
83 Someone else submitted a simple test program that duplicates this
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
84 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
85 links with the threads library. */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
86
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
87 #ifdef THIS_IS_X11R6
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
88 #define BROKEN_SIGCHLD
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
89 #endif
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
90
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
91 #if OS_RELEASE == 55
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
92 /* Solaris 2.5 is the first Solaris that has getpagesize(), srandom()
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
93 and random(), but they forgot to add prototypes to the header
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
94 files. */
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
95 int getpagesize (void);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
96 long random (void);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
97 void srandom (unsigned int seed);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
98 #endif /* SunOS 5.5 */
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 #if OS_RELEASE < 55
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
101 /* Another missing prototype, added in Solaris 2.5 */
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
102 extern void *__builtin_alloca(size_t);
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
103 #endif /* before SunOS 5.5 */
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
104
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
105 #if OS_RELEASE < 56
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
106 /* XEmacs: Solaris include files miss this. */
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
107 struct timeval;
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
108 int utimes (char *file, struct timeval *tvp);
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
109 extern int gethostname(char *, unsigned);
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
110 #endif /* before SunOS 5.6 */
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 #include <sys/utsname.h> /* warning: macro redefined: SYS_NMLN */
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
113
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
114 /* Get non-ANSI functions from ANSI header files in cc -Xc mode.
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
115 Sun has promised to fix setjmp.h */
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
116 #if __STDC__ == 1 && defined(__SUNPRO_C)
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
117 #define _POSIX_C_SOURCE 1
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
118 #include <setjmp.h>
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
119 #undef _POSIX_C_SOURCE
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
120 #endif /* cc -Xc */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 /* XEmacs: Solaris has sigsetjmp but using it leads to core dumps at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 least under 2.4 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 #undef _setjmp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 #define _setjmp setjmp
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
126
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
127 #endif /* C_CODE */