annotate src/s/freebsd.h @ 167:85ec50267440 r20-3b10

Import from CVS: tag r20-3b10
author cvs
date Mon, 13 Aug 2007 09:45:46 +0200
parents 0132846995bd
children 2d532a89d707
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
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
36 #define LIBS_TERMCAP "-ltermcap"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
37 #define LIB_GCC "-lgcc"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
167
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
39 #ifndef NO_SHARED_LIBS
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
40 #if 0 /* mrb */
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
41 #define LD_SWITCH_SYSTEM "-dc -dp -e start"
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
42 #define START_FILES "pre-crt0.o /usr/lib/crt0.o"
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
43 #else /* mrb */
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
44 #define ORDINARY_LINK
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
45 #undef LD_SWITCH_SYSTEM
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
46 #undef START_FILES
85ec50267440 Import from CVS: tag r20-3b10
cvs
parents: 163
diff changeset
47 #endif /* mrb */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 #define HAVE_TEXT_START /* No need to define `start_of_text'. */
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
50 #define UNEXEC "unexfreebsd.o"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 #define RUN_TIME_REMAP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 #ifndef N_TRELOFF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 #define N_PAGSIZ(x) __LDPGSZ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 #define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 #define N_TRELOFF(x) N_RELOFF(x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 #else /* NO_SHARED_LIBS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 #ifdef __FreeBSD__ /* shared libs are available, but the user prefers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 not to use them. */
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents: 157
diff changeset
61 #define LD_SWITCH_SYSTEM "-Bstatic"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 #define A_TEXT_OFFSET(x) (sizeof (struct exec))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 #endif /* __FreeBSD__ */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 #endif /* NO_SHARED_LIBS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 #define HAVE_GETLOADAVG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 #define NO_TERMIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 #define DECLARE_GETPWUID_WITH_UID_T
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 /* freebsd uses OXTABS instead of the expected TAB3. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 #define TABDLY OXTABS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 #define TAB3 OXTABS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 /* this silences a few compilation warnings */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 #undef BSD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 #if __FreeBSD__ == 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 #define BSD 199103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 #elif __FreeBSD__ == 2
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
80 #if __FreeBSD_version < 199701
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
81 # define BSD 199306
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
82 #else
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
83 # define BSD 199506
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 122
diff changeset
84 #endif
122
d2f30a177268 Import from CVS: tag r20-1b14
cvs
parents: 98
diff changeset
85 #elif __FreeBSD__ == 3
d2f30a177268 Import from CVS: tag r20-1b14
cvs
parents: 98
diff changeset
86 #define BSD 199506
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 /* Needed to avoid hanging when child process writes an error message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 and exits -- enami tsugutomo <enami@ba2.so-net.or.jp>. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 #define vfork fork