Move FIRST_PTY_LETTER, PTY_ITERATION from src/s to configure
[bpt/emacs.git] / src / s / darwin.h
CommitLineData
e0f712ba 1/* System description header file for Darwin (Mac OS X).
e9bffc61 2
acaf905b 3Copyright (C) 2001-2012 Free Software Foundation, Inc.
e0f712ba
AC
4
5This file is part of GNU Emacs.
6
4b158629 7GNU Emacs is free software: you can redistribute it and/or modify
e0f712ba 8it under the terms of the GNU General Public License as published by
4b158629
GM
9the Free Software Foundation, either version 3 of the License, or
10(at your option) any later version.
e0f712ba
AC
11
12GNU Emacs is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
4b158629 18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
e0f712ba
AC
19
20
e05aebe9
GM
21/* Define symbols to identify the version of Unix this is.
22 Define all the symbols that apply correctly. */
e0f712ba
AC
23#define BSD4_2
24/* BSD4_3 and BSD4_4 are already defined in sys/param.h */
e0f712ba 25#define BSD_SYSTEM
e0f712ba 26
14145fa3
AR
27/* More specific than the above two. We cannot use __APPLE__ as this
28 may not be defined on non-OSX Darwin, and we cannot define DARWIN
29 here because Panther and lower CoreFoundation.h uses DARWIN to
e05aebe9 30 distinguish OS X from pure Darwin. */
14145fa3
AR
31#define DARWIN_OS
32
658b9b93
YM
33#define PTY_NAME_SPRINTF /* none */
34#define PTY_TTY_NAME_SPRINTF /* none */
35/* Note that openpty may fork via grantpt on Mac OS X 10.4/Darwin 8.
36 But we don't have to block SIGCHLD because it is blocked in the
37 implementation of grantpt. */
38#define PTY_OPEN \
39 do \
40 { \
41 int slave; \
42 if (openpty (&fd, &slave, pty_name, NULL, NULL) == -1) \
43 fd = -1; \
44 else \
45 emacs_close (slave); \
46 } \
47 while (0)
e0f712ba 48
e05aebe9
GM
49/* PTYs only work correctly on Darwin 7 or higher. So make the default
50 for process-connection-type dependent on the kernel version. */
bb4c0e89 51#define MIN_PTY_KERNEL_VERSION '7'
a15252fd 52
e0f712ba
AC
53/* Avoid the use of the name init_process (process.c) because it is
54 also the name of a Mach system call. */
55#define init_process emacs_init_process
56
e0f712ba 57/* Definitions for how to compile & link. */
edfda783 58#ifdef HAVE_NS
edfda783 59#define SYSTEM_PURESIZE_EXTRA 200000
eb21eab5 60#endif
640a0770 61
b1f52161 62#ifdef emacs
14145fa3
AR
63#define malloc unexec_malloc
64#define realloc unexec_realloc
65#define free unexec_free
e05aebe9 66/* Don't use posix_memalign because it is not compatible with unexmacosx.c. */
890617cb 67#undef HAVE_POSIX_MEMALIGN
14145fa3
AR
68#endif
69
511ca371
AC
70/* The following solves the problem that Emacs hangs when evaluating
71 (make-comint "test0" "/nodir/nofile" nil "") when /nodir/nofile
69955d31
YM
72 does not exist. Also, setsid is not allowed in the vfork child's
73 context as of Darwin 9/Mac OS X 10.5. */
511ca371
AC
74#undef HAVE_WORKING_VFORK
75#define vfork fork