summaryrefslogtreecommitdiff
path: root/source3/lib/system.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-11-09 22:49:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:11 -0500
commitc0406ae1b04a60318ba18abb168b610d8c223005 (patch)
tree5da7bbbfea881461879ba3eff4902432647ce92e /source3/lib/system.c
parent2d0f5486f085e0db4528fb3f72ca311c73c36b92 (diff)
downloadsamba-c0406ae1b04a60318ba18abb168b610d8c223005.tar.gz
r3642: Extend vfs to add seekdir/telldir/rewinddir. Yes I know I have to
fix the modules too... First step in fixing out large directories problem. Jeremy. (This used to be commit 344e9dd33a936b429fefb67cd748ac009a1bab10)
Diffstat (limited to 'source3/lib/system.c')
-rw-r--r--source3/lib/system.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index b27ac5c00ad..f33d1ae7d57 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -362,6 +362,19 @@ FILE *sys_fopen(const char *path, const char *type)
}
/*******************************************************************
+ An opendir wrapper that will deal with 64 bit filesizes.
+********************************************************************/
+
+DIR *sys_opendir(const char *name)
+{
+#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OPENDIR64)
+ return opendir64(name);
+#else
+ return opendir(name);
+#endif
+}
+
+/*******************************************************************
A readdir wrapper that will deal with 64 bit filesizes.
********************************************************************/
@@ -375,6 +388,58 @@ SMB_STRUCT_DIRENT *sys_readdir(DIR *dirp)
}
/*******************************************************************
+ A seekdir wrapper that will deal with 64 bit filesizes.
+********************************************************************/
+
+void sys_seekdir(DIR *dirp, long offset)
+{
+#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_SEEKDIR64)
+ seekdir64(dirp, offset);
+#else
+ seekdir(dirp, offset);
+#endif
+}
+
+/*******************************************************************
+ A telldir wrapper that will deal with 64 bit filesizes.
+********************************************************************/
+
+long sys_telldir(DIR *dirp)
+{
+#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_TELLDIR64)
+ return (long)telldir64(dirp);
+#else
+ return (long)telldir(dirp);
+#endif
+}
+
+/*******************************************************************
+ A rewinddir wrapper that will deal with 64 bit filesizes.
+********************************************************************/
+
+void sys_rewinddir(DIR *dirp)
+{
+#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_REWINDDIR64)
+ rewinddir64(dirp);
+#else
+ rewinddir(dirp);
+#endif
+}
+
+/*******************************************************************
+ A close wrapper that will deal with 64 bit filesizes.
+********************************************************************/
+
+int sys_closedir(DIR *dirp)
+{
+#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_CLOSEDIR64)
+ return closedir64(dirp);
+#else
+ return closedir(dirp);
+#endif
+}
+
+/*******************************************************************
An mknod() wrapper that will deal with 64 bit filesizes.
********************************************************************/