diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-05-31 10:41:42 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-05-31 02:57:19 +0200 |
commit | 52399f3177515fce777d85288650ff89f9028dc9 (patch) | |
tree | 4ac95cf572080603e6d4e4b9cabcfd46571fbdb3 /source3 | |
parent | 38fee2b521e1109e08510b286fccd056689ad33f (diff) | |
download | samba-52399f3177515fce777d85288650ff89f9028dc9.tar.gz samba-52399f3177515fce777d85288650ff89f9028dc9.tar.bz2 samba-52399f3177515fce777d85288650ff89f9028dc9.zip |
lib/util Move sys_memalign into lib/util/system.c
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/lib/system.c | 36 |
2 files changed, 0 insertions, 37 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 1f094617ad..23654e1ec6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -352,7 +352,6 @@ int sys_set_nfs_quota(const char *path, const char *bdev, /* The following definitions come from lib/system.c */ -void *sys_memalign( size_t align, size_t size ); int sys_usleep(long usecs); ssize_t sys_read(int fd, void *buf, size_t count); ssize_t sys_write(int fd, const void *buf, size_t count); diff --git a/source3/lib/system.c b/source3/lib/system.c index 292965f47f..0dd4b81a43 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -48,42 +48,6 @@ /******************************************************************* - A wrapper for memalign -********************************************************************/ - -void *sys_memalign( size_t align, size_t size ) -{ -#if defined(HAVE_POSIX_MEMALIGN) - void *p = NULL; - int ret = posix_memalign( &p, align, size ); - if ( ret == 0 ) - return p; - - return NULL; -#elif defined(HAVE_MEMALIGN) - return memalign( align, size ); -#else - /* On *BSD systems memaligns doesn't exist, but memory will - * be aligned on allocations of > pagesize. */ -#if defined(SYSCONF_SC_PAGESIZE) - size_t pagesize = (size_t)sysconf(_SC_PAGESIZE); -#elif defined(HAVE_GETPAGESIZE) - size_t pagesize = (size_t)getpagesize(); -#else - size_t pagesize = (size_t)-1; -#endif - if (pagesize == (size_t)-1) { - DEBUG(0,("memalign functionalaity not available on this platform!\n")); - return NULL; - } - if (size < pagesize) { - size = pagesize; - } - return SMB_MALLOC(size); -#endif -} - -/******************************************************************* A wrapper for usleep in case we don't have one. ********************************************************************/ |