summaryrefslogtreecommitdiffstats
path: root/source/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
commit344e9dd33a936b429fefb67cd748ac009a1bab10 (patch)
treeb9260b5ec5c891dcc59bf4572d3bfe5fb4ba5cb1 /source/lib/system.c
parentcfd51c02447f7b42cffcaf4cc6179237d58c8229 (diff)
downloadsamba-344e9dd33a936b429fefb67cd748ac009a1bab10.tar.gz
samba-344e9dd33a936b429fefb67cd748ac009a1bab10.tar.xz
samba-344e9dd33a936b429fefb67cd748ac009a1bab10.zip
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.
Diffstat (limited to 'source/lib/system.c')
-rw-r--r--source/lib/system.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/source/lib/system.c b/source/lib/system.c
index b27ac5c00ad..f33d1ae7d57 100644
--- a/source/lib/system.c
+++ b/source/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.
********************************************************************/