diff options
| author | Kenichi Handa | 2012-07-17 07:25:00 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-07-17 07:25:00 +0900 |
| commit | 69c41c4070c86baac11a627e9c3d366420aeb7cc (patch) | |
| tree | e07fda92570b5e4f264c9a7869b57960940008f0 /src/s/gnu-linux.h | |
| parent | 8c536f15bf95916d56bb50495d22b7da7e09fff9 (diff) | |
| parent | 758e556a7ab8f61c007e34310ba399a9aaf15362 (diff) | |
| download | emacs-69c41c4070c86baac11a627e9c3d366420aeb7cc.tar.gz emacs-69c41c4070c86baac11a627e9c3d366420aeb7cc.zip | |
merge trunk
Diffstat (limited to 'src/s/gnu-linux.h')
| -rw-r--r-- | src/s/gnu-linux.h | 143 |
1 files changed, 0 insertions, 143 deletions
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index 409d0205520..2847fd6d19c 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h | |||
| @@ -20,146 +20,3 @@ GNU General Public License for more details. | |||
| 20 | You should have received a copy of the GNU General Public License | 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/>. */ | 21 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 22 | 22 | ||
| 23 | /* Define symbols to identify the version of Unix this is. | ||
| 24 | Define all the symbols that apply correctly. */ | ||
| 25 | #define USG | ||
| 26 | #define GNU_LINUX | ||
| 27 | |||
| 28 | /* SYSTEM_TYPE should indicate the kind of system you are using. | ||
| 29 | It sets the Lisp variable system-type. */ | ||
| 30 | #define SYSTEM_TYPE "gnu/linux" /* All the best software is free. */ | ||
| 31 | |||
| 32 | #ifdef emacs | ||
| 33 | #ifdef HAVE_LINUX_VERSION_H | ||
| 34 | #include <linux/version.h> | ||
| 35 | |||
| 36 | #if LINUX_VERSION_CODE >= 0x20400 | ||
| 37 | /* 21 Jun 06: Eric Hanchrow <offby1@blarg.net> says this works. */ | ||
| 38 | #define SIGNALS_VIA_CHARACTERS | ||
| 39 | #endif /* LINUX_VERSION_CODE >= 0x20400 */ | ||
| 40 | #endif /* HAVE_LINUX_VERSION_H */ | ||
| 41 | #endif /* emacs */ | ||
| 42 | |||
| 43 | #if defined HAVE_GRANTPT | ||
| 44 | #define UNIX98_PTYS | ||
| 45 | |||
| 46 | /* Run only once. We need a `for'-loop because the code uses `continue'. */ | ||
| 47 | #define PTY_ITERATION int i; for (i = 0; i < 1; i++) | ||
| 48 | |||
| 49 | #ifdef HAVE_GETPT | ||
| 50 | #define PTY_NAME_SPRINTF | ||
| 51 | #define PTY_OPEN fd = getpt () | ||
| 52 | #else /* not HAVE_GETPT */ | ||
| 53 | #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); | ||
| 54 | #endif /* not HAVE_GETPT */ | ||
| 55 | |||
| 56 | /* Note that grantpt and unlockpt may fork. We must block SIGCHLD to | ||
| 57 | prevent sigchld_handler from intercepting the child's death. */ | ||
| 58 | #define PTY_TTY_NAME_SPRINTF \ | ||
| 59 | { \ | ||
| 60 | char *ptyname; \ | ||
| 61 | \ | ||
| 62 | sigblock (sigmask (SIGCHLD)); \ | ||
| 63 | if (grantpt (fd) == -1 || unlockpt (fd) == -1 \ | ||
| 64 | || !(ptyname = ptsname(fd))) \ | ||
| 65 | { \ | ||
| 66 | sigunblock (sigmask (SIGCHLD)); \ | ||
| 67 | close (fd); \ | ||
| 68 | return -1; \ | ||
| 69 | } \ | ||
| 70 | strncpy (pty_name, ptyname, sizeof (pty_name)); \ | ||
| 71 | pty_name[sizeof (pty_name) - 1] = 0; \ | ||
| 72 | sigunblock (sigmask (SIGCHLD)); \ | ||
| 73 | } | ||
| 74 | |||
| 75 | #else /* not HAVE_GRANTPT */ | ||
| 76 | |||
| 77 | /* Letter to use in finding device name of first pty, | ||
| 78 | if system supports pty's. 'p' means it is /dev/ptyp0 */ | ||
| 79 | #define FIRST_PTY_LETTER 'p' | ||
| 80 | |||
| 81 | #endif /* not HAVE_GRANTPT */ | ||
| 82 | |||
| 83 | /* Define HAVE_PTYS if the system supports pty devices. */ | ||
| 84 | #define HAVE_PTYS | ||
| 85 | |||
| 86 | #define HAVE_SOCKETS | ||
| 87 | |||
| 88 | /* This is used in list_system_processes. */ | ||
| 89 | #define HAVE_PROCFS 1 | ||
| 90 | |||
| 91 | /* Define CLASH_DETECTION if you want lock files to be written | ||
| 92 | so that Emacs can tell instantly when you try to modify | ||
| 93 | a file that someone else has modified in his Emacs. */ | ||
| 94 | #define CLASH_DETECTION | ||
| 95 | |||
| 96 | /* Here, on a separate page, add any special hacks needed | ||
| 97 | to make Emacs work on this system. For example, | ||
| 98 | you might define certain system call names that don't | ||
| 99 | exist on your system, or that do different things on | ||
| 100 | your system and must be used only through an encapsulation | ||
| 101 | (Which you should place, by convention, in sysdep.c). */ | ||
| 102 | |||
| 103 | /* This is needed for dispnew.c:update_frame. */ | ||
| 104 | #ifdef emacs | ||
| 105 | #include <stdio.h> /* Get the definition of _IO_STDIO_H. */ | ||
| 106 | #if defined (_IO_STDIO_H) || defined (_STDIO_USES_IOSTREAM) | ||
| 107 | /* New C libio names. */ | ||
| 108 | #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \ | ||
| 109 | ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base) | ||
| 110 | #elif defined (__UCLIBC__) | ||
| 111 | /* Using the uClibc library. */ | ||
| 112 | #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \ | ||
| 113 | ((FILE)->__bufpos - (FILE)->__bufstart) | ||
| 114 | #else /* !_IO_STDIO_H && ! __UCLIBC__ */ | ||
| 115 | /* Old C++ iostream names. */ | ||
| 116 | #define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \ | ||
| 117 | ((FILE)->_pptr - (FILE)->_pbase) | ||
| 118 | #endif /* !_IO_STDIO_H && ! __UCLIBC__ */ | ||
| 119 | |||
| 120 | #define INTERRUPT_INPUT | ||
| 121 | #endif /* emacs */ | ||
| 122 | |||
| 123 | #define POSIX /* affects getpagesize.h and systty.h */ | ||
| 124 | |||
| 125 | /* This is to work around mysterious gcc failures in some system versions. | ||
| 126 | It is unlikely that Emacs changes will work around this problem; | ||
| 127 | therefore, this should remain permanently. */ | ||
| 128 | #ifndef HAVE_XRMSETDATABASE | ||
| 129 | #define HAVE_XRMSETDATABASE | ||
| 130 | #endif | ||
| 131 | |||
| 132 | #define NARROWPROTO 1 | ||
| 133 | |||
| 134 | /* Tell that garbage collector that setjmp is known to save all | ||
| 135 | registers relevant for conservative garbage collection in the jmp_buf. */ | ||
| 136 | /* Not all the architectures are tested, but there are Debian packages | ||
| 137 | for SCM and/or Guile on them, so the technique must work. See also | ||
| 138 | comments in alloc.c concerning setjmp and gcc. Fixme: it's | ||
| 139 | probably safe to make this conditional just on GCC, except for ia64 | ||
| 140 | register window-flushing. */ | ||
| 141 | /* Don't use #cpu here since in newest development versions of GCC, | ||
| 142 | we must call cpp with -traditional, and that disables #cpu. */ | ||
| 143 | #if defined __i386__ || defined __sparc__ || defined __mc68000__ \ | ||
| 144 | || defined __alpha__ || defined __mips__ || defined __s390__ \ | ||
| 145 | || defined __arm__ || defined __powerpc__ || defined __amd64__ \ | ||
| 146 | || defined __ia64__ || defined __sh__ | ||
| 147 | #define GC_SETJMP_WORKS 1 | ||
| 148 | #ifdef __ia64__ | ||
| 149 | #define GC_MARK_SECONDARY_STACK() \ | ||
| 150 | do { \ | ||
| 151 | extern void *__libc_ia64_register_backing_store_base; \ | ||
| 152 | __builtin_ia64_flushrs (); \ | ||
| 153 | mark_memory (__libc_ia64_register_backing_store_base, \ | ||
| 154 | __builtin_ia64_bsp ()); \ | ||
| 155 | } while (0) | ||
| 156 | #endif | ||
| 157 | #else | ||
| 158 | #define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE | ||
| 159 | #endif | ||
| 160 | |||
| 161 | #ifdef __i386__ | ||
| 162 | /* libc-linux/sysdeps/linux/i386/ulimit.c says that due to shared library, */ | ||
| 163 | /* we cannot get the maximum address for brk */ | ||
| 164 | # define ULIMIT_BREAK_VALUE (32*1024*1024) | ||
| 165 | #endif | ||