summaryrefslogtreecommitdiffstats
path: root/source/lib/system.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-09-17 19:16:12 +0000
committerJeremy Allison <jra@samba.org>1998-09-17 19:16:12 +0000
commitc381d32e3dc23fe887408016cae821aceb30da2c (patch)
tree0cef463d904b3d9eb323490e404c4fc6bc4ecd3f /source/lib/system.c
parent9c8ecd994d43ec64f46ef54e608acb651a9d67e1 (diff)
downloadsamba-c381d32e3dc23fe887408016cae821aceb30da2c.tar.gz
samba-c381d32e3dc23fe887408016cae821aceb30da2c.tar.xz
samba-c381d32e3dc23fe887408016cae821aceb30da2c.zip
configure configure.in: Added tests for fseek64 and ftell64.
config.h.in: Added fseek64 and ftell64. includes.h: Added definition of SMB_BIG_INTEGER. smb.h: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. access.c: Tidyup of dbug statement. system.c: Added sys_fseek and sys_ftell. Changed mode calls to use mode_t. asyncdns.c: Tidyup of comment. loadparm.c: Tidyup of set_default_server_announce_type() function definition. ldap.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. nispass.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. smbpass.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. smbpassfile.c: Use sys_fseek(). chgpasswd.c: Tidyup of debug statement. dosmode.c: Changed mode calls to use mode_t. ipc.c: Removal of dead code. nttrans.c: Changed mode calls to use mode_t. open.c: Changed mode calls to use mode_t. pipes.c: Removal of dead code. reply.c: Removal of dead code. trans2.c: Removal of dead code. Changed mode calls to use mode_t. Jeremy.
Diffstat (limited to 'source/lib/system.c')
-rw-r--r--source/lib/system.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/source/lib/system.c b/source/lib/system.c
index 215bfd0c1df..c3d97e0350f 100644
--- a/source/lib/system.c
+++ b/source/lib/system.c
@@ -205,6 +205,32 @@ SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence)
}
/*******************************************************************
+ An fseek() wrapper that will deal with 64 bit filesizes.
+********************************************************************/
+
+int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence)
+{
+#if defined(LARGE_SMB_OFF_T) && defined(HAVE_FSEEK64)
+ return fseek64(fp, offset, whence);
+#else
+ return fseek(fp, offset, whence);
+#endif
+}
+
+/*******************************************************************
+ An ftell() wrapper that will deal with 64 bit filesizes.
+********************************************************************/
+
+SMB_OFF_T sys_ftell(FILE *fp)
+{
+#if defined(LARGE_SMB_OFF_T) && defined(HAVE_FTELL64)
+ return (SMB_OFF_T)ftell64(fp);
+#else
+ return (SMB_OFF_T)ftell(fp);
+#endif
+}
+
+/*******************************************************************
just a unlink wrapper that calls dos_to_unix.
********************************************************************/
int dos_unlink(char *fname)
@@ -216,7 +242,7 @@ int dos_unlink(char *fname)
/*******************************************************************
a simple open() wrapper that calls dos_to_unix.
********************************************************************/
-int dos_open(char *fname,int flags,int mode)
+int dos_open(char *fname,int flags,mode_t mode)
{
return(open(dos_to_unix(fname,False),flags,mode));
}
@@ -261,7 +287,7 @@ int dos_lstat(char *fname,SMB_STRUCT_STAT *sbuf)
/*******************************************************************
mkdir() gets a wrapper that calls dos_to_unix.
********************************************************************/
-int dos_mkdir(char *dname,int mode)
+int dos_mkdir(char *dname,mode_t mode)
{
return(mkdir(dos_to_unix(dname,False),mode));
}
@@ -413,7 +439,7 @@ int dos_rename(char *from, char *to)
/*******************************************************************
for chmod - call dos_to_unix.
********************************************************************/
-int dos_chmod(char *fname,int mode)
+int dos_chmod(char *fname,mode_t mode)
{
return(chmod(dos_to_unix(fname,False),mode));
}