annotate src/s/freebsd.h @ 179:9ad43877534d r20-3b16

Import from CVS: tag r20-3b16
author cvs
date Mon, 13 Aug 2007 09:52:19 +0200
parents 6075d714658b
children 92f8ad5d0d3f
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 /* s/ file for freebsd system. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 /* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 Earlier versions do not have shared libraries, so inhibit them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 You can inhibit them on newer systems if you wish
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 by defining NO_SHARED_LIBS. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 #ifndef __FreeBSD__
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 #define NO_SHARED_LIBS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 /* Get most of the stuff from bsd4.3 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 #include "bsd4-3.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 /* For mem-limits.h. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 #define BSD4_2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 /* These aren't needed, since we have getloadavg. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 #undef KERNEL_FILE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 #undef LDAV_SYMBOL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #define LIBS_DEBUG
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
26 /* FreeBSD 2.2 or later */
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
27 #ifndef __FreeBSD_version
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
28 #include <osreldate.h>
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
29 #endif
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
30 #if __FreeBSD_version >= 199701
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
31 #define LIBS_SYSTEM "-lutil -lxpg4"
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
32 #else
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
33 #define LIBS_SYSTEM "-lutil"
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
34 #endif
151
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 149
diff changeset
35
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
36 /* Kludge to work around setlocale(LC_ALL,...) not working after 01/1997 */
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
37 #if __FreeBSD_version >= 199701
179
9ad43877534d Import from CVS: tag r20-3b16
cvs
parents: 177
diff changeset
38 #ifndef NOT_C_CODE
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
39 #include <X11/Xlocale.h>
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
40 #define setlocale(locale_category, locale_spec) setlocale(LC_CTYPE, locale_spec)
179
9ad43877534d Import from CVS: tag r20-3b16
cvs
parents: 177
diff changeset
41 #endif /* C code */
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
42 #endif
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
43
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
44 #define LIBS_TERMCAP "-ltermcap"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
46 #ifndef NO_SHARED_LIBS
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
47 #if 0 /* mrb */
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
48 #define LIB_GCC "-lgcc"
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
49 #define LD_SWITCH_SYSTEM "-dc -dp -e start"
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
50 #define START_FILES "pre-crt0.o /usr/lib/crt0.o"
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
51 #else /* mrb */
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
52 #define ORDINARY_LINK
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 167
diff changeset
53 #undef LIB_GCC
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
54 #undef LD_SWITCH_SYSTEM
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
55 #undef START_FILES
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
56 #endif /* mrb */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 #define HAVE_TEXT_START /* No need to define `start_of_text'. */
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
59 #define UNEXEC "unexfreebsd.o"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 #define RUN_TIME_REMAP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 #ifndef N_TRELOFF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 #define N_PAGSIZ(x) __LDPGSZ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 #define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 #define N_TRELOFF(x) N_RELOFF(x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 #else /* NO_SHARED_LIBS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 #ifdef __FreeBSD__ /* shared libs are available, but the user prefers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 not to use them. */
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
70 #define LD_SWITCH_SYSTEM "-Bstatic"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 #define A_TEXT_OFFSET(x) (sizeof (struct exec))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 #endif /* __FreeBSD__ */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 #endif /* NO_SHARED_LIBS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 #define HAVE_GETLOADAVG
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
77 /* #define NO_TERMIO */ /* detected in configure */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 #define DECLARE_GETPWUID_WITH_UID_T
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 /* freebsd uses OXTABS instead of the expected TAB3. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 #define TABDLY OXTABS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 #define TAB3 OXTABS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 /* this silences a few compilation warnings */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 #undef BSD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 #if __FreeBSD__ == 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 #define BSD 199103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 #elif __FreeBSD__ == 2
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
89 #if __FreeBSD_version < 199701
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
90 # define BSD 199306
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
91 #else
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
92 # define BSD 199506
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
93 #endif
122
d2f30a177268 Import from CVS: tag r20-1b14
cvs
parents: 98
diff changeset
94 #elif __FreeBSD__ == 3
d2f30a177268 Import from CVS: tag r20-1b14
cvs
parents: 98
diff changeset
95 #define BSD 199506
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 /* Needed to avoid hanging when child process writes an error message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 and exits -- enami tsugutomo <enami@ba2.so-net.or.jp>. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 #define vfork fork