summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/getdirentries.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-04-27 13:06:39 +0000
committerUlrich Drepper <drepper@redhat.com>1999-04-27 13:06:39 +0000
commit980e58323af243dd0a87f6a6eeec6f97308b46e5 (patch)
tree553907bc56fa9387a688da4efb5e9d710abefb22 /sysdeps/unix/sysv/linux/getdirentries.c
parentb6a7609d56147398e6fa412fd7c7210960300505 (diff)
Update.
* include/dirent.h: Remove __getdirentries declaration, add __getdents and __getdents64. * sysdeps/unix/readdir.c: Use __getdents, not __getdirentries. * sysdeps/unix/readdir_r.c: Likewise. * sysdeps/unix/sysv/linux/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/getdents.c: Define __getdents, not __getdirentries. Remove fourth argument. * sysdeps/unix/sysv/linux/getdirentries.c: New file. * sysdeps/unix/sysv/linux/getdirentries64.c: New file. * sysdeps/unix/sysv/linux/Makefile [subdir=dirent] (sysdep_routines): Add getdirentries and getdirentries64. * sysdeps/unix/sysv/linux/Dist: Add getdirentries and getdirentries64.
Diffstat (limited to 'sysdeps/unix/sysv/linux/getdirentries.c')
-rw-r--r--sysdeps/unix/sysv/linux/getdirentries.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/getdirentries.c b/sysdeps/unix/sysv/linux/getdirentries.c
new file mode 100644
index 0000000000..1f7ba85c55
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/getdirentries.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1993, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <dirent.h>
+#include <unistd.h>
+
+#ifdef GETDENTS64
+# define getdirentries getdirentries64
+# define __getdents __getdents64
+#endif
+
+ssize_t
+getdirentries (int fd, char *buf, size_t nbytes, off_t *basep)
+{
+ off_t base = __lseek (fd, (off_t) 0, SEEK_CUR);
+ ssize_t result;
+
+ result = __getdents (fd, buf, nbytes);
+
+ if (result != -1)
+ *basep = base;
+
+ return result;
+}