summaryrefslogtreecommitdiff
path: root/source3/smbwrapper/wrapped.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-05 08:44:46 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-05 08:44:46 +0000
commit81905488fffbf6fbdcfd8ec351566026445f9e01 (patch)
tree61045a57c996ec24a74ae20c29c00e7431c14651 /source3/smbwrapper/wrapped.c
parent80ae082c8760ac4218b454d8c7d6b7e4203bdd8c (diff)
downloadsamba-81905488fffbf6fbdcfd8ec351566026445f9e01.tar.gz
samba-81905488fffbf6fbdcfd8ec351566026445f9e01.tar.bz2
samba-81905488fffbf6fbdcfd8ec351566026445f9e01.zip
ported smbwrapper to SunOS4. It seems to work. pity so many binaries on
my SunOS box are statically linked. (This used to be commit 541f1c421127334817b73388f4ccb9cc0841dd4e)
Diffstat (limited to 'source3/smbwrapper/wrapped.c')
-rw-r--r--source3/smbwrapper/wrapped.c40
1 files changed, 36 insertions, 4 deletions
diff --git a/source3/smbwrapper/wrapped.c b/source3/smbwrapper/wrapped.c
index 81f8162290..7902371ec6 100644
--- a/source3/smbwrapper/wrapped.c
+++ b/source3/smbwrapper/wrapped.c
@@ -22,8 +22,15 @@
#include "wrapper.h"
- int open(const char *name, int flags, mode_t mode)
+ int open(const char *name, int flags, ...)
{
+ va_list ap;
+ mode_t mode;
+
+ va_start(ap, flags);
+ mode = va_arg(ap, mode_t);
+ va_end(ap);
+
if (smbw_path(name)) {
return smbw_open(name, flags, mode);
}
@@ -174,8 +181,14 @@
#endif
- int fcntl(int fd, int cmd, long arg)
+ int fcntl(int fd, int cmd, ...)
{
+ va_list ap;
+ long arg;
+ va_start(ap, cmd);
+ arg = va_arg(ap, long);
+ va_end(ap);
+
if (smbw_fd(fd)) {
return smbw_fcntl(fd, cmd, arg);
}
@@ -575,6 +588,7 @@
}
+#ifdef HAVE_UTIME
int utime(const char *name,void *tvp)
{
if (smbw_path(name)) {
@@ -583,6 +597,18 @@
return real_utime(name, tvp);
}
+#endif
+
+#ifdef HAVE_UTIMES
+ int utimes(const char *name,void *tvp)
+{
+ if (smbw_path(name)) {
+ return smbw_utimes(name, tvp);
+ }
+
+ return real_utimes(name, tvp);
+}
+#endif
int readlink(char *path, char *buf, size_t bufsize)
{
@@ -657,6 +683,7 @@
return real_dup2(oldfd, newfd);
}
+#ifdef real_opendir
DIR *opendir(const char *name)
{
DIR *ret;
@@ -666,7 +693,9 @@
return real_opendir(name);
}
+#endif
+#ifdef real_readdir
struct dirent *readdir(DIR *dir)
{
if (smbw_dirp(dir)) {
@@ -675,7 +704,9 @@
return real_readdir(dir);
}
+#endif
+#ifdef real_closedir
int closedir(DIR *dir)
{
if (smbw_dirp(dir)) {
@@ -684,8 +715,9 @@
return real_closedir(dir);
}
+#endif
-#ifndef NO_TELLDIR_WRAPPER
+#ifdef real_telldir
off_t telldir(DIR *dir)
{
if (smbw_dirp(dir)) {
@@ -696,7 +728,7 @@
}
#endif
-#ifndef NO_SEEKDIR_WRAPPER
+#ifdef real_seekdir
void seekdir(DIR *dir, off_t offset)
{
if (smbw_dirp(dir)) {