]> code.delx.au - gnu-emacs/blob - src/s/freebsd.h
Convert consecutive FSF copyright years to ranges.
[gnu-emacs] / src / s / freebsd.h
1 /* System description header for FreeBSD systems.
2
3 Copyright (C) 1994-2011 Free Software Foundation, Inc.
4
5 Author: Shawn M. Carey
6 (according to authors.el)
7
8 This file is part of GNU Emacs.
9
10 GNU Emacs is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
14
15 GNU Emacs is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22
23 /* Get most of the stuff from bsd-common */
24 #include "bsd-common.h"
25
26 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
27
28 #define HAVE_GETLOADAVG 1
29
30 /* This silences a few compilation warnings. */
31 #undef BSD_SYSTEM
32 #if __FreeBSD__ == 1
33 #define BSD_SYSTEM 199103
34 #elif __FreeBSD__ == 2
35 #define BSD_SYSTEM 199306
36 #elif __FreeBSD__ >= 3
37 #define BSD_SYSTEM 199506
38 #endif
39
40 /* Don't close pty in process.c to make it as controlling terminal.
41 It is already a controlling terminal of subprocess, because we did
42 ioctl TIOCSCTTY. */
43 #define DONT_REOPEN_PTY
44
45 /* Circumvent a bug in FreeBSD. In the following sequence of
46 writes/reads on a PTY, read(2) returns bogus data:
47
48 write(2) 1022 bytes
49 write(2) 954 bytes, get EAGAIN
50 read(2) 1024 bytes in process_read_output
51 read(2) 11 bytes in process_read_output
52
53 That is, read(2) returns more bytes than have ever been written
54 successfully. The 1033 bytes read are the 1022 bytes written
55 successfully after processing (for example with CRs added if the
56 terminal is set up that way which it is here). The same bytes will
57 be seen again in a later read(2), without the CRs. */
58 #define BROKEN_PTY_READ_AFTER_EAGAIN 1
59
60 /* Tell that garbage collector that setjmp is known to save all
61 registers relevant for conservative garbage collection in the jmp_buf. */
62 #define GC_SETJMP_WORKS 1
63
64 /* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */
65 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS