summaryrefslogtreecommitdiffstats
path: root/source/smbwrapper/wrapped.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-05 04:58:33 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-05 04:58:33 +0000
commitc6ee915336e1533e1f4f10f14b3d57de01f8fe96 (patch)
tree7c76f16a7da7bc7bb9e9ae1a90573494a5a292ba /source/smbwrapper/wrapped.c
parent788992f58613f7f4fa0e9ce7087267dec75f2e51 (diff)
downloadsamba-c6ee915336e1533e1f4f10f14b3d57de01f8fe96.tar.gz
samba-c6ee915336e1533e1f4f10f14b3d57de01f8fe96.tar.xz
samba-c6ee915336e1533e1f4f10f14b3d57de01f8fe96.zip
got rid of all assembly code and gcc special features. I'm hoping to
get smbsh working with the normal sun compiler
Diffstat (limited to 'source/smbwrapper/wrapped.c')
-rw-r--r--source/smbwrapper/wrapped.c157
1 files changed, 106 insertions, 51 deletions
diff --git a/source/smbwrapper/wrapped.c b/source/smbwrapper/wrapped.c
index 025bbcc2db8..d0a3842485a 100644
--- a/source/smbwrapper/wrapped.c
+++ b/source/smbwrapper/wrapped.c
@@ -22,12 +22,6 @@
#include "wrapper.h"
-#ifdef HAVE__OPEN
-__asm__(".globl _open; _open = open");
-#elif HAVE___OPEN
-__asm__(".globl __open; __open = open");
-#endif
-
int open(const char *name, int flags, mode_t mode)
{
if (smbw_path(name)) {
@@ -37,6 +31,19 @@ __asm__(".globl __open; __open = open");
return real_open(name, flags, mode);
}
+#ifdef HAVE__OPEN
+ int _open(const char *name, int flags, mode_t mode)
+{
+ return open(name, flags, mode);
+}
+#elif HAVE___OPEN
+ int __open(const char *name, int flags, mode_t mode)
+{
+ return open(name, flags, mode);
+}
+#endif
+
+
#ifdef HAVE_OPEN64
int open64(const char *name, int flags, mode_t mode)
{
@@ -93,26 +100,25 @@ __asm__(".globl __open; __open = open");
#endif
-#ifdef HAVE___CHDIR
-__asm__(".globl __chdir; __chdir = chdir");
-#elif HAVE__CHDIR
-__asm__(".globl _chdir; _chdir = chdir");
-#endif
-
int chdir(const char *name)
{
return smbw_chdir(name);
}
-
-
-#ifdef HAVE___CLOSE
-__asm__(".globl __close; __close = close");
-#elif HAVE__CLOSE
-__asm__(".globl _close; _close = close");
+#ifdef HAVE___CHDIR
+ int __chdir(const char *name)
+{
+ return chdir(name);
+}
+#elif HAVE__CHDIR
+ int _chdir(const char *name)
+{
+ return chdir(name);
+}
#endif
- ssize_t close(int fd)
+
+ int close(int fd)
{
if (smbw_fd(fd)) {
return smbw_close(fd);
@@ -121,13 +127,19 @@ __asm__(".globl _close; _close = close");
return real_close(fd);
}
-
-#ifdef HAVE___FCHDIR
-__asm__(".globl __fchdir; __fchdir = fchdir");
-#elif HAVE__FCHDIR
-__asm__(".globl _fchdir; _fchdir = fchdir");
+#ifdef HAVE___CLOSE
+ int __close(int fd)
+{
+ return close(fd);
+}
+#elif HAVE__CLOSE
+ int _close(int fd)
+{
+ return close(fd);
+}
#endif
+
int fchdir(int fd)
{
if (smbw_fd(fd)) {
@@ -137,13 +149,19 @@ __asm__(".globl _fchdir; _fchdir = fchdir");
return real_fchdir(fd);
}
-
-#ifdef HAVE___FCNTL
-__asm__(".globl __fcntl; __fcntl = fcntl");
-#elif HAVE__FCNTL
-__asm__(".globl _fcntl; _fcntl = fcntl");
+#ifdef HAVE___FCHDIR
+ int __fchdir(int fd)
+{
+ return fchdir(fd);
+}
+#elif HAVE__FCHDIR
+ int _fchdir(int fd)
+{
+ return fchdir(fd);
+}
#endif
+
int fcntl(int fd, int cmd, long arg)
{
if (smbw_fd(fd)) {
@@ -154,13 +172,20 @@ __asm__(".globl _fcntl; _fcntl = fcntl");
}
-
-#ifdef HAVE___GETDENTS
-__asm__(".globl __getdents; __getdents = getdents");
-#elif HAVE__GETDENTS
-__asm__(".globl _getdents; _getdents = getdents");
+#ifdef HAVE___FCNTL
+ int __fcntl(int fd, int cmd, long arg)
+{
+ return fcntl(fd, cmd, arg);
+}
+#elif HAVE__FCNTL
+ int _fcntl(int fd, int cmd, long arg)
+{
+ return fcntl(fd, cmd, arg);
+}
#endif
+
+
int getdents(int fd, struct dirent *dirp, unsigned int count)
{
if (smbw_fd(fd)) {
@@ -170,14 +195,20 @@ __asm__(".globl _getdents; _getdents = getdents");
return real_getdents(fd, dirp, count);
}
-
-#ifdef HAVE___LSEEK
-__asm__(".globl __lseek; __lseek = lseek");
-#elif HAVE__LSEEK
-__asm__(".globl _lseek; _lseek = lseek");
+#ifdef HAVE___GETDENTS
+ int __getdents(int fd, struct dirent *dirp, unsigned int count)
+{
+ return getdents(fd, dirp, count);
+}
+#elif HAVE__GETDENTS
+ int _getdents(int fd, struct dirent *dirp, unsigned int count)
+{
+ return getdents(fd, dirp, count);
+}
#endif
- ssize_t lseek(int fd, off_t offset, int whence)
+
+ off_t lseek(int fd, off_t offset, int whence)
{
if (smbw_fd(fd)) {
return smbw_lseek(fd, offset, whence);
@@ -186,14 +217,19 @@ __asm__(".globl _lseek; _lseek = lseek");
return real_lseek(fd, offset, whence);
}
-
-
-#ifdef HAVE___READ
-__asm__(".globl __read; __read = read");
-#elif HAVE__READ
-__asm__(".globl _read; _read = read");
+#ifdef HAVE___LSEEK
+ off_t __lseek(int fd, off_t offset, int whence)
+{
+ return lseek(fd, offset, whence);
+}
+#elif HAVE__LSEEK
+ off_t _lseek(int fd, off_t offset, int whence)
+{
+ return lseek(fd, offset, whence);
+}
#endif
+
ssize_t read(int fd, void *buf, size_t count)
{
if (smbw_fd(fd)) {
@@ -203,13 +239,19 @@ __asm__(".globl _read; _read = read");
return real_read(fd, buf, count);
}
-
-#ifdef HAVE___WRITE
-__asm__(".globl __write; __write = write");
-#elif HAVE__WRITE
-__asm__(".globl _write; _write = write");
+#ifdef HAVE___READ
+ ssize_t __read(int fd, void *buf, size_t count)
+{
+ return read(fd, buf, count);
+}
+#elif HAVE__READ
+ ssize_t _read(int fd, void *buf, size_t count)
+{
+ return read(fd, buf, count);
+}
#endif
+
ssize_t write(int fd, void *buf, size_t count)
{
if (smbw_fd(fd)) {
@@ -219,6 +261,19 @@ __asm__(".globl _write; _write = write");
return real_write(fd, buf, count);
}
+#ifdef HAVE___WRITE
+ ssize_t __write(int fd, void *buf, size_t count)
+{
+ return write(fd, buf, count);
+}
+#elif HAVE__WRITE
+ ssize_t _write(int fd, void *buf, size_t count)
+{
+ return write(fd, buf, count);
+}
+#endif
+
+
int access(const char *name, int mode)
{