Add fdopendir().
authorJeremy Allison <jra@samba.org>
Tue, 8 Feb 2011 22:43:07 +0000 (14:43 -0800)
committerJeremy Allison <jra@samba.org>
Tue, 8 Feb 2011 23:05:59 +0000 (15:05 -0800)
source3/configure.in
source3/include/proto.h
source3/lib/system.c

index f0d8de7ddb6401f94cc251fdf84bb0992e08ea45..363fbac352d8568cca031005d7122ecb7a4f5ae1 100644 (file)
@@ -1099,6 +1099,7 @@ AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt lseek64 ftruncate64 posix_fallocat
 AC_CHECK_FUNCS(fallocate fallocate64)
 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam)
 AC_CHECK_FUNCS(opendir64 readdir64 seekdir64 telldir64 rewinddir64 closedir64)
+AC_CHECK_FUNCS(fdopendir fdopendir64)
 AC_CHECK_FUNCS(getpwent_r)
 AC_CHECK_FUNCS(getdents64)
 AC_CHECK_FUNCS(setenv strcasecmp fcvt fcvtl)
index 2f2c62747dd643772ef8ff6cfd5cd0f60e5ad6ad..77a7a4055a04623881537c410f26f2c014a3ebc4 100644 (file)
@@ -890,6 +890,7 @@ int sys_open(const char *path, int oflag, mode_t mode);
 FILE *sys_fopen(const char *path, const char *type);
 void kernel_flock(int fd, uint32 share_mode, uint32 access_mask);
 SMB_STRUCT_DIR *sys_opendir(const char *name);
+SMB_STRUCT_DIR *sys_fdopendir(int fd);
 SMB_STRUCT_DIRENT *sys_readdir(SMB_STRUCT_DIR *dirp);
 void sys_seekdir(SMB_STRUCT_DIR *dirp, long offset);
 long sys_telldir(SMB_STRUCT_DIR *dirp);
index 4cf6a299daa11b96670ed3ed7e83b15af5ed2ce3..57434f2d4210fdd65a069295f6dcf122222b85b7 100644 (file)
@@ -866,6 +866,22 @@ SMB_STRUCT_DIR *sys_opendir(const char *name)
 #endif
 }
 
+/*******************************************************************
+ An fdopendir wrapper that will deal with 64 bit filesizes.
+********************************************************************/
+
+SMB_STRUCT_DIR *sys_fdopendir(int fd)
+{
+#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_FDOPENDIR64)
+       return fdopendir64(fd);
+#elif defined(HAVE_FDOPENDIR)
+       return fdopendir(fd);
+#else
+       errno = ENOSYS;
+       return NULL;
+#endif
+}
+
 /*******************************************************************
  A readdir wrapper that will deal with 64 bit filesizes.
 ********************************************************************/