summaryrefslogtreecommitdiff
path: root/source3/lib/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/system.c')
-rw-r--r--source3/lib/system.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 9ee3f7cc26..5e70fb8ac5 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -44,6 +44,27 @@
/*******************************************************************
+ A wrapper for memalign
+********************************************************************/
+
+void* sys_memalign( size_t align, size_t size )
+{
+#if defined(HAVE_MEMALIGN)
+ return memalign( align, size );
+#elif defined(HAVE_POSIX_MEMALIGN)
+ char *p = NULL;
+ int ret = posix_memalign( &p, align, size );
+ if ( ret == 0 )
+ return p;
+
+ return NULL;
+#else
+ DEBUG(0,("memalign functionalaity not available on this platform!\n"));
+ return NULL;
+#endif
+}
+
+/*******************************************************************
A wrapper for usleep in case we don't have one.
********************************************************************/