diff options
author | Mike Hommey <mh@glandium.org> | 2012-03-27 12:48:58 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2012-03-30 17:21:41 (GMT) |
commit | 1a0e7770243e0539fa8fef7bb1512f784f93389f (patch) | |
tree | 27e634593f7e156c97ca13578e0944f4ec65c8de /src | |
parent | e77fa59ece7e23de586f08980f627b8102511755 (diff) | |
download | jemalloc-1a0e7770243e0539fa8fef7bb1512f784f93389f.zip jemalloc-1a0e7770243e0539fa8fef7bb1512f784f93389f.tar.gz jemalloc-1a0e7770243e0539fa8fef7bb1512f784f93389f.tar.bz2 |
Add a SYS_write definition on systems where it is not defined in headers
Namely, in the Android NDK headers, SYS_write is not defined; but
__NR_write is.
Diffstat (limited to 'src')
-rw-r--r-- | src/util.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -44,7 +44,17 @@ JEMALLOC_CATTR(visibility("hidden"), static) void wrtmessage(void *cbopaque, const char *s) { + +#ifdef 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 + * on FreeBSD; most operating systems do not have this problem though. + */ UNUSED int result = syscall(SYS_write, STDERR_FILENO, s, strlen(s)); +#else + UNUSED int result = write(STDERR_FILENO, s, strlen(s)); +#endif } void (*je_malloc_message)(void *, const char *s) |