annotate src/s/freebsd.h @ 157:6b37e6ddd302 r20-3b5

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