[Glibc-bsd-commits] r5830 - trunk/glibc-ports/kfreebsd

aurel32 at alioth.debian.org aurel32 at alioth.debian.org
Wed Nov 18 23:08:05 UTC 2015


Author: aurel32
Date: 2015-11-18 23:08:05 +0000 (Wed, 18 Nov 2015)
New Revision: 5830

Modified:
   trunk/glibc-ports/kfreebsd/getdents.c
Log:
Always use the 3-argument system call syscall to implement getdents

It matches our function and is always available on recent FreeBSD version.



Modified: trunk/glibc-ports/kfreebsd/getdents.c
===================================================================
--- trunk/glibc-ports/kfreebsd/getdents.c	2015-11-04 22:53:30 UTC (rev 5829)
+++ trunk/glibc-ports/kfreebsd/getdents.c	2015-11-18 23:08:05 UTC (rev 5830)
@@ -23,8 +23,6 @@
 #include <errno.h>
 #include <sysdep.h>
 
-#if 1
-
 /* Use the 3-argument system call.  */
 
 extern int __syscall_getdents (int fd, char *buf, size_t nbytes);
@@ -47,44 +45,6 @@
   return __syscall_getdents (fd, buf, nbytes);
 }
 
-#else
-
-/* Use the 4-argument system call.  */
-
-extern int __syscall_getdirentries (int fd, char *buf, unsigned int nbytes,
-				    long *basep);
-
-/* Read directory entries from FD into BUF, reading at most NBYTES.
-   Returns the number of bytes read; zero when at end of directory; or
-   -1 for errors.  */
-ssize_t
-internal_function
-__getdents (int fd, char *buf, size_t nbytes)
-{
-  /* On 64-bit platforms, the system call differs from this function
-     because it takes an 'unsigned int', not a 'size_t'.  */
-  unsigned int nbytes32;
-
-  nbytes32 = nbytes;
-  if (nbytes32 == nbytes)
-    return __syscall_getdirentries (fd, buf, nbytes32, NULL);
-  else
-    {
-      /* NBYTES is too large.  */
-      __set_errno (EINVAL);
-      return -1;
-    }
-}
-
-/* Export getdents().  Not an internal_function.  */
-ssize_t
-getdents (int fd, char *buf, size_t nbytes)
-{
-  return __getdents (fd, buf, nbytes);
-}
-
-#endif
-
 /* Since 'struct dirent64' == 'struct dirent', the functions '__getdents64'
    and '__getdents' are equal.  */
 strong_alias (__getdents, __getdents64)




More information about the Glibc-bsd-commits mailing list