Remove some unused definitions from src/s
[bpt/emacs.git] / src / s / gnu-linux.h
CommitLineData
3a707ba5 1/* This file is the configuration file for Linux-based GNU systems
2f86b22b 2
acaf905b 3Copyright (C) 1985-1986, 1992, 1994, 1996, 1999, 2001-2012
e9bffc61 4 Free Software Foundation, Inc.
566e3587 5
e05aebe9
GM
6This file was put together by Michael K. Johnson and Rik Faith.
7
566e3587
JB
8This file is part of GNU Emacs.
9
4b158629 10GNU Emacs is free software: you can redistribute it and/or modify
566e3587 11it under the terms of the GNU General Public License as published by
4b158629
GM
12the Free Software Foundation, either version 3 of the License, or
13(at your option) any later version.
566e3587
JB
14
15GNU Emacs is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
4b158629 21along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
566e3587 22
e05aebe9
GM
23/* Define symbols to identify the version of Unix this is.
24 Define all the symbols that apply correctly. */
566e3587 25#define USG
8db5530a 26#define GNU_LINUX
566e3587 27
65953053 28#ifdef emacs
b764619d 29#ifdef HAVE_LINUX_VERSION_H
65953053 30#include <linux/version.h>
566e3587 31
85a71b37 32#if LINUX_VERSION_CODE >= 0x20400
c5e7567d
DN
33/* 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works. */
34#define SIGNALS_VIA_CHARACTERS
85a71b37 35#endif /* LINUX_VERSION_CODE >= 0x20400 */
b764619d 36#endif /* HAVE_LINUX_VERSION_H */
aa7fcbb0 37#endif /* emacs */
566e3587 38
71125fb8
GM
39#if defined HAVE_GRANTPT
40#define UNIX98_PTYS
566e3587 41
e05aebe9 42/* Run only once. We need a `for'-loop because the code uses `continue'. */
be02381c 43#define PTY_ITERATION int i; for (i = 0; i < 1; i++)
fdc5e0fc 44
71125fb8
GM
45#ifdef HAVE_GETPT
46#define PTY_NAME_SPRINTF
47#define PTY_OPEN fd = getpt ()
48#else /* not HAVE_GETPT */
49#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
50#endif /* not HAVE_GETPT */
51
52/* Note that grantpt and unlockpt may fork. We must block SIGCHLD to
53 prevent sigchld_handler from intercepting the child's death. */
71125fb8
GM
54#define PTY_TTY_NAME_SPRINTF \
55 { \
56 char *ptyname; \
57 \
58 sigblock (sigmask (SIGCHLD)); \
59 if (grantpt (fd) == -1 || unlockpt (fd) == -1 \
60 || !(ptyname = ptsname(fd))) \
61 { \
62 sigunblock (sigmask (SIGCHLD)); \
63 close (fd); \
64 return -1; \
65 } \
66 strncpy (pty_name, ptyname, sizeof (pty_name)); \
67 pty_name[sizeof (pty_name) - 1] = 0; \
68 sigunblock (sigmask (SIGCHLD)); \
69 }
fdc5e0fc 70
dacbb818 71#else /* not HAVE_GRANTPT */
fdc5e0fc 72
71125fb8
GM
73/* Letter to use in finding device name of first pty,
74 if system supports pty's. 'p' means it is /dev/ptyp0 */
71125fb8 75#define FIRST_PTY_LETTER 'p'
fdc5e0fc 76
132d0475 77#endif /* not HAVE_GRANTPT */
fdc5e0fc 78
e05aebe9 79/* Define HAVE_PTYS if the system supports pty devices. */
566e3587
JB
80#define HAVE_PTYS
81
dad29761 82#define HAVE_SOCKETS
566e3587 83
566e3587
JB
84/* Define CLASH_DETECTION if you want lock files to be written
85 so that Emacs can tell instantly when you try to modify
86 a file that someone else has modified in his Emacs. */
b2e209ba 87#define CLASH_DETECTION
566e3587
JB
88
89/* Here, on a separate page, add any special hacks needed
90 to make Emacs work on this system. For example,
91 you might define certain system call names that don't
92 exist on your system, or that do different things on
93 your system and must be used only through an encapsulation
94 (Which you should place, by convention, in sysdep.c). */
95\f
e05aebe9 96/* This is needed for dispnew.c:update_frame. */
5e5623c2 97#ifdef emacs
a9c82aaf 98#include <stdio.h> /* Get the definition of _IO_STDIO_H. */
5e617bc2 99#if defined (_IO_STDIO_H) || defined (_STDIO_USES_IOSTREAM)
e05aebe9 100/* New C libio names. */
c2c3f859 101#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
5e5623c2 102 ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
65f451d0 103#elif defined (__UCLIBC__)
e05aebe9 104/* Using the uClibc library. */
65f451d0
DN
105#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
106 ((FILE)->__bufpos - (FILE)->__bufstart)
107#else /* !_IO_STDIO_H && ! __UCLIBC__ */
e05aebe9 108/* Old C++ iostream names. */
c2c3f859 109#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
5e5623c2 110 ((FILE)->_pptr - (FILE)->_pbase)
65f451d0 111#endif /* !_IO_STDIO_H && ! __UCLIBC__ */
566e3587 112
65953053 113#define INTERRUPT_INPUT
9539dc5d 114#endif /* emacs */
566e3587 115
1abbab7a 116#define POSIX /* affects getpagesize.h and systty.h */
566e3587 117
639f52d8
RS
118/* This is to work around mysterious gcc failures in some system versions.
119 It is unlikely that Emacs changes will work around this problem;
120 therefore, this should remain permanently. */
e3b89505
RS
121#ifndef HAVE_XRMSETDATABASE
122#define HAVE_XRMSETDATABASE
123#endif
e2000885 124
2327e4a0
GM
125#define NARROWPROTO 1
126
bb15bd9a 127/* Tell that garbage collector that setjmp is known to save all
e05aebe9 128 registers relevant for conservative garbage collection in the jmp_buf. */
e7b6b572
DL
129/* Not all the architectures are tested, but there are Debian packages
130 for SCM and/or Guile on them, so the technique must work. See also
131 comments in alloc.c concerning setjmp and gcc. Fixme: it's
132 probably safe to make this conditional just on GCC, except for ia64
133 register window-flushing. */
a8f77aaa
GM
134/* Don't use #cpu here since in newest development versions of GCC,
135 we must call cpp with -traditional, and that disables #cpu. */
e7b6b572
DL
136#if defined __i386__ || defined __sparc__ || defined __mc68000__ \
137 || defined __alpha__ || defined __mips__ || defined __s390__ \
e3177e43 138 || defined __arm__ || defined __powerpc__ || defined __amd64__ \
00f37552 139 || defined __ia64__ || defined __sh__
bb15bd9a 140#define GC_SETJMP_WORKS 1
e3177e43
AS
141#ifdef __ia64__
142#define GC_MARK_SECONDARY_STACK() \
143 do { \
144 extern void *__libc_ia64_register_backing_store_base; \
145 __builtin_ia64_flushrs (); \
146 mark_memory (__libc_ia64_register_backing_store_base, \
2adb6e85 147 __builtin_ia64_bsp ()); \
e3177e43
AS
148 } while (0)
149#endif
b948ce8b
PE
150#else
151#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE
bb15bd9a 152#endif
34374650
PE
153
154#ifdef __i386__
155/* libc-linux/sysdeps/linux/i386/ulimit.c says that due to shared library, */
156/* we cannot get the maximum address for brk */
157# define ULIMIT_BREAK_VALUE (32*1024*1024)
158#endif