summaryrefslogtreecommitdiffstats
path: root/source/lib/system.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-02-24 12:40:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:10 -0500
commit0d2b80c6c4a744b05a0efdec352cddccc430e0c4 (patch)
tree59f6e7eee799d5430f7a31eab63086f42eb39036 /source/lib/system.c
parent82f1da8117434c52c383b33a905b3765f0240d4a (diff)
downloadsamba-0d2b80c6c4a744b05a0efdec352cddccc430e0c4.tar.gz
samba-0d2b80c6c4a744b05a0efdec352cddccc430e0c4.tar.xz
samba-0d2b80c6c4a744b05a0efdec352cddccc430e0c4.zip
r21525: Go ahead and checkin the mlock() & memalign() fixes so
others don't get stuck with the winbindd hang. Still waiting on additional confirmation from Guenther that this fixes thes issues he was observing as well. But it's been running in my local tree for a day without problems.
Diffstat (limited to 'source/lib/system.c')
-rw-r--r--source/lib/system.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/lib/system.c b/source/lib/system.c
index 9ee3f7cc26a..5e70fb8ac5e 100644
--- a/source/lib/system.c
+++ b/source/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.
********************************************************************/