summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/getdents.c
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-08-30 23:23:41 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-08-30 23:23:41 +0400
commitd6177bbbd17ddd3f837485f6cb59e24fbc7f82c5 (patch)
tree009c30637db1e59410942e9f447f9e310da859e5 /sysdeps/unix/sysv/linux/getdents.c
parent411498f0cc1bfe8762a4d999ac2761a70c305113 (diff)
parent344e61df0200af758e794b9843ffb37bd89e5259 (diff)
downloadglibc-d6177bbbd17ddd3f837485f6cb59e24fbc7f82c5.tar.gz
Merge branch 'release/2.19/master' of git://sourceware.org/git/glibc
Conflicts: configure.in include/features.h io/ftw.c malloc/arena.c malloc/malloc.c malloc/mtrace.c nptl/allocatestack.c nptl/nptl-init.c nptl/pthread_attr_init.c nptl/pthread_create.c nptl/pthread_detach.c nptl/pthread_getschedparam.c nptl/pthread_setschedparam.c nptl/pthread_setschedprio.c nptl/pthread_timedjoin.c nptl/pthread_tryjoin.c nptl/sysdeps/unix/sysv/linux/fork.h nptl/sysdeps/unix/sysv/linux/register-atfork.c nptl/sysdeps/unix/sysv/linux/unregister-atfork.c nptl/sysdeps/x86_64/tls.h nscd/Makefile sysdeps/unix/inet/syscalls.list sysdeps/unix/opendir.c sysdeps/x86_64/multiarch/strcasestr-nonascii.c
Diffstat (limited to 'sysdeps/unix/sysv/linux/getdents.c')
-rw-r--r--sysdeps/unix/sysv/linux/getdents.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/sysdeps/unix/sysv/linux/getdents.c b/sysdeps/unix/sysv/linux/getdents.c
index 9af50eff92..a7d8b9a1e4 100644
--- a/sysdeps/unix/sysv/linux/getdents.c
+++ b/sysdeps/unix/sysv/linux/getdents.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 19932-2012 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2014 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
@@ -28,7 +28,6 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#include <bp-checks.h>
#include <linux/posix_types.h>
@@ -101,7 +100,6 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
{
ssize_t retval;
-#ifdef __ASSUME_GETDENTS32_D_TYPE
/* The d_ino and d_off fields in kernel_dirent and dirent must have
the same sizes and alignments. */
if (sizeof (DIRENT_TYPE) == sizeof (struct dirent)
@@ -114,7 +112,7 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
&& (offsetof (struct kernel_dirent, d_reclen)
== offsetof (struct dirent, d_reclen)))
{
- retval = INLINE_SYSCALL (getdents, 3, fd, CHECK_N(buf, nbytes), nbytes);
+ retval = INLINE_SYSCALL (getdents, 3, fd, buf, nbytes);
/* The kernel added the d_type value after the name. Change
this now. */
@@ -139,7 +137,6 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
return retval;
}
-#endif
off64_t last_offset = -1;
@@ -164,8 +161,7 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
- offsetof (DIRENT_TYPE, d_name);
kbuf = __alloca(kbytes);
}
- retval = INLINE_SYSCALL (getdents64, 3, fd, CHECK_N(kbuf, kbytes),
- kbytes);
+ retval = INLINE_SYSCALL (getdents64, 3, fd, kbuf, kbytes);
# ifndef __ASSUME_GETDENTS64_SYSCALL
if (retval != -1 || (errno != EINVAL && errno != ENOSYS))
# endif
@@ -261,8 +257,7 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
skdp = kdp = __alloca (red_nbytes);
- retval = INLINE_SYSCALL (getdents, 3, fd,
- CHECK_N ((char *) kdp, red_nbytes), red_nbytes);
+ retval = INLINE_SYSCALL (getdents, 3, fd, (char *) kdp, red_nbytes);
if (retval == -1)
return -1;
@@ -297,11 +292,7 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
DIRENT_SET_DP_INO(dp, kdp->d_ino);
dp->d_off = kdp->d_off;
dp->d_reclen = new_reclen;
-#ifdef __ASSUME_GETDENTS32_D_TYPE
dp->d_type = *((char *) kdp + kdp->d_reclen - 1);
-#else
- dp->d_type = DT_UNKNOWN;
-#endif
memcpy (dp->d_name, kdp->d_name,
kdp->d_reclen - offsetof (struct kernel_dirent, d_name));