diff options
| author | Jason Evans <jasone@canonware.com> | 2016-11-03 02:18:33 (GMT) |
|---|---|---|
| committer | Jason Evans <jasone@canonware.com> | 2016-11-03 02:18:33 (GMT) |
| commit | d82f2b3473daef45d92d2a83d11487b22f9db4d3 (patch) | |
| tree | bbc90aba058c1c43ddc8e86372f46e890b076c1b /src | |
| parent | 795f6689dec28f161afbf5964ef1b17288dd384d (diff) | |
| download | jemalloc-d82f2b3473daef45d92d2a83d11487b22f9db4d3.zip jemalloc-d82f2b3473daef45d92d2a83d11487b22f9db4d3.tar.gz jemalloc-d82f2b3473daef45d92d2a83d11487b22f9db4d3.tar.bz2 | |
Do not use syscall(2) on OS X 10.12 (deprecated).
Diffstat (limited to 'src')
| -rw-r--r-- | src/pages.c | 6 | ||||
| -rw-r--r-- | src/util.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/pages.c b/src/pages.c index 84e2216..647952a 100644 --- a/src/pages.c +++ b/src/pages.c @@ -219,7 +219,7 @@ os_overcommits_proc(void) char buf[1]; ssize_t nread; -#ifdef SYS_open +#if defined(JEMALLOC_HAVE_SYSCALL) && defined(SYS_open) fd = (int)syscall(SYS_open, "/proc/sys/vm/overcommit_memory", O_RDONLY); #else fd = open("/proc/sys/vm/overcommit_memory", O_RDONLY); @@ -227,13 +227,13 @@ os_overcommits_proc(void) if (fd == -1) return (false); /* Error. */ -#ifdef SYS_read +#if defined(JEMALLOC_HAVE_SYSCALL) && defined(SYS_read) nread = (ssize_t)syscall(SYS_read, fd, &buf, sizeof(buf)); #else nread = read(fd, &buf, sizeof(buf)); #endif -#ifdef SYS_close +#if defined(JEMALLOC_HAVE_SYSCALL) && defined(SYS_close) syscall(SYS_close, fd); #else close(fd); @@ -49,7 +49,7 @@ static void wrtmessage(void *cbopaque, const char *s) { -#ifdef SYS_write +#if defined(JEMALLOC_HAVE_SYSCALL) && defined(SYS_write) /* * Use syscall(2) rather than write(2) when possible in order to avoid * the possibility of memory allocation within libc. This is necessary |
