From f3b412fbd6dd94d64eb6a63d88baef2816891c29 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 23 Sep 2005 00:38:22 +0000 Subject: r10438: Move portability functions to lib/replace/; replace now simply ensures that a given set of (working) POSIX functions are available (without prefixes to their names, etc). See lib/replace/README for a list. Functions that behave different from their POSIX specification (such as sys_select, sys_read, etc) have kept the sys_ prefix. (This used to be commit 29919a71059b29fa27a49b1f5b84bb8881de65fc) --- source4/lib/system.c | 71 ---------------------------------------------------- 1 file changed, 71 deletions(-) (limited to 'source4/lib/system.c') diff --git a/source4/lib/system.c b/source4/lib/system.c index eb3799c7ca..629b2b07ff 100644 --- a/source4/lib/system.c +++ b/source4/lib/system.c @@ -23,7 +23,6 @@ #include "system/network.h" #include "system/wait.h" #include "system/filesys.h" -#include "pstring.h" /* The idea is that this file will eventually have wrappers around all @@ -77,20 +76,6 @@ int sys_usleep(long usecs) } -/******************************************************************* - System wrapper for getwd -********************************************************************/ -char *sys_getwd(char *s) -{ - char *wd; -#ifdef HAVE_GETCWD - wd = (char *)getcwd(s, sizeof (pstring)); -#else - wd = (char *)getwd(s); -#endif - return wd; -} - /******************************************************************* A read wrapper that will deal with EINTR. ********************************************************************/ @@ -121,24 +106,6 @@ ssize_t sys_write(int fd, const void *buf, size_t count) -/******************************************************************* -os/2 also doesn't have chroot -********************************************************************/ -int sys_chroot(const char *dname) -{ -#ifndef HAVE_CHROOT - static int done; - if (!done) { - DEBUG(1,("WARNING: no chroot!\n")); - done=1; - } - errno = ENOSYS; - return -1; -#else - return(chroot(dname)); -#endif -} - /************************************************************************** A wrapper for gethostbyname() that tries avoids looking up hostnames in the root domain, which can cause dial-on-demand links to come up for no @@ -181,39 +148,6 @@ struct hostent *sys_gethostbyname(const char *name) #endif /* REDUCE_ROOT_DNS_LOOKUPS */ } - - -/************************************************************************** - Wrappers for dlopen, dlsym, dlclose. -****************************************************************************/ - -void *sys_dlopen(const char *name, int flags) -{ -#if defined(HAVE_DLOPEN) - return dlopen(name, flags); -#else - return NULL; -#endif -} - -void *sys_dlsym(void *handle, const char *symbol) -{ -#if defined(HAVE_DLSYM) - return dlsym(handle, symbol); -#else - return NULL; -#endif -} - -const char *sys_dlerror(void) -{ -#if defined(HAVE_DLERROR) - return dlerror(); -#else - return NULL; -#endif -} - const char *sys_inet_ntoa(struct ipv4_addr in) { struct in_addr in2; @@ -221,11 +155,6 @@ const char *sys_inet_ntoa(struct ipv4_addr in) return inet_ntoa(in2); } -uint32_t sys_inet_addr(const char *s) -{ - return inet_addr(s); -} - struct ipv4_addr sys_inet_makeaddr(int net, int host) { struct in_addr in; -- cgit