diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-06-14 09:53:48 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2010-06-24 17:25:10 +0200 |
commit | daab1935d13e51044d025f1199bcc1274e9a0ebe (patch) | |
tree | 6b6ccee0bfff80eef594afaad8bef2b58c58a31c | |
parent | 2bb9bf64e5d3b8f5fc2d6651412894fd66401b97 (diff) |
[ElectricFence] use memalign instead of posix_memalign
-rw-r--r-- | osdep.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -100,7 +100,12 @@ void *qemu_memalign(size_t alignment, size_t size) #if defined(_POSIX_C_SOURCE) && !defined(__sun__) int ret; void *ptr; +#if 0 ret = posix_memalign(&ptr, alignment, size); +#else + ptr = memalign(alignment, size); + ret = (ptr == NULL) ? -1 : 0; +#endif if (ret != 0) { fprintf(stderr, "Failed to allocate %zu B: %s\n", size, strerror(ret)); |