annotate src/s/freebsd.h @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children 4103f0995bd7
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 #if 0 /* This much, alone, seemed sufficient as of 19.23.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 But it seems better to be independent of netbsd.h. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 #include "netbsd.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 #undef LIB_GCC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 #define LIB_GCC -lgcc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 #undef NEED_ERRNO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 #endif /* 0 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 /* Get most of the stuff from bsd4.3 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 #include "bsd4-3.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 /* For mem-limits.h. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #define BSD4_2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 /* These aren't needed, since we have getloadavg. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #undef KERNEL_FILE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #undef LDAV_SYMBOL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #define LIBS_DEBUG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #define LIBS_SYSTEM -lutil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 /* XEmacs change: */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 #ifdef HAVE_NCURSES
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 #define LIBS_TERMCAP -lncurses -ltermcap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #define LIBS_TERMCAP -ltermcap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #define LIB_GCC -lgcc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 /* freebsd has POSIX-style pgrp behavior. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 #define GETPGRP_NO_ARG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 #ifndef NO_SHARED_LIBS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 #define LD_SWITCH_SYSTEM -e start -dc -dp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 #define HAVE_TEXT_START /* No need to define `start_of_text'. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 #define START_FILES pre-crt0.o /usr/lib/crt0.o
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 #define UNEXEC unexfreebsd.o
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 #define RUN_TIME_REMAP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 #ifndef N_TRELOFF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 #define N_PAGSIZ(x) __LDPGSZ
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 #define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 #define N_TRELOFF(x) N_RELOFF(x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 #else /* NO_SHARED_LIBS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 #ifdef __FreeBSD__ /* shared libs are available, but the user prefers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 not to use them. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 #define LD_SWITCH_SYSTEM -Bstatic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 #define A_TEXT_OFFSET(x) (sizeof (struct exec))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 #endif /* __FreeBSD__ */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 #endif /* NO_SHARED_LIBS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 #define HAVE_GETLOADAVG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 #define NO_TERMIO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 #define DECLARE_GETPWUID_WITH_UID_T
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 /* freebsd uses OXTABS instead of the expected TAB3. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 #define TABDLY OXTABS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 #define TAB3 OXTABS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 /* this silences a few compilation warnings */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 #undef BSD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 #if __FreeBSD__ == 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 #define BSD 199103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 #elif __FreeBSD__ == 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 #define BSD 199306
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 #undef HAVE_UNION_WAIT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 /* #### XEmacs: Is this necessary? */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 #define WRETCODE(w) (_W_INT(w) >> 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 /* FreeBSD defines INT_MAX in /usr/include/limits.h.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 Unless INT_MAX is already defined in lisp.h, XEmacs goes right
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ahead and rolls its own.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 We make sure that the system's definition is used throughout. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 #ifdef emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 #include <limits.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 /* Needed to avoid hanging when child process writes an error message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 and exits -- enami tsugutomo <enami@ba2.so-net.or.jp>. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 #define vfork fork