[PATCH] Add a SYS_write definition on systems where it is not defined in headers

Mike Hommey mh+jemalloc at glandium.org
Tue Mar 27 05:48:58 PDT 2012


From: Mike Hommey <mh at glandium.org>

Namely, in the Android NDK headers, SYS_write is not defined ; but __NR_write is.
---
 include/jemalloc/internal/jemalloc_internal.h.in |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in
index 4f55779..13a9b84 100644
--- a/include/jemalloc/internal/jemalloc_internal.h.in
+++ b/include/jemalloc/internal/jemalloc_internal.h.in
@@ -1,6 +1,9 @@
 #include <sys/mman.h>
 #include <sys/param.h>
 #include <sys/syscall.h>
+#if !defined(SYS_write) && defined(__NR_write)
+#define SYS_write __NR_write
+#endif
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/uio.h>
-- 
1.7.9.1




More information about the jemalloc-discuss mailing list