-ABI changes:
- Add d_type to struct dirent
-
/usr/include/gnu/stubs-32.h
ptrace details:
Here is the kernel definition of `struct dirent' as of 2.1.20: */
+#ifndef __KERNEL_DIRENT
struct kernel_dirent
{
long int d_ino;
char d_name[256];
};
+# ifdef __NR_getdents64
struct kernel_dirent64
{
uint64_t d_ino;
unsigned char d_type;
char d_name[256];
};
+# endif
+#endif
#ifndef __GETDENTS
# define __GETDENTS __getdents
# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
#endif
-/* XXX: On OpenSolaris d_name is variable length. For compatibility we define
- it to have length 256. */
-
typedef struct dirent
{
#ifndef __USE_FILE_OFFSET64
__off64_t d_off;
#endif
unsigned short int d_reclen;
+ unsigned char d_type;
char d_name[256]; /* We must not include limits.h! */
} dirent_t;
-#ifdef _SYSCALL32
-typedef struct dirent32
- {
- __ino_t d_ino;
- __off_t d_off;
- __uint16_t d_reclen;
- char d_name[256];
- } dirent32_t;
-#endif
-
#ifdef __USE_LARGEFILE64
typedef struct dirent64
{
__ino64_t d_ino;
__off64_t d_off;
unsigned short int d_reclen;
+ unsigned char d_type;
char d_name[256]; /* We must not include limits.h! */
} dirent64_t;
#endif
#undef _DIRENT_HAVE_D_NAMLEN
#define _DIRENT_HAVE_D_RECLEN
#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
-/* Copyright (C) 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <inline-syscall.h>
-#include <dirent.h>
+#include <sys/types,h>
-/* This can't be a direct syscall since it's marked as internal_function. */
+#define __KERNEL_DIRENT
+struct kernel_dirent
+ {
+ __ino_t d_ino;
+ __off_t d_off;
+ unsigned short d_reclen;
+ char d_name[1];
+ };
+#endif
-DECLARE_INLINE_SYSCALL (int, getdents, int fd, void *buf, size_t count);
-
-ssize_t
-internal_function
-__getdents (int fd, char *buf, size_t nbytes)
-{
- return INLINE_SYSCALL(getdents, 3, fd, buf, nbytes);
-}
+#include <sysdeps/unix/sysv/linux/getdents.c>
-/* Copyright (C) 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <inline-syscall.h>
-#include <dirent.h>
+#include <sys/types,h>
-/* This can't be a direct syscall since it's marked as internal_function. */
+#define __KERNEL_DIRENT
+struct kernel_dirent
+ {
+ __ino64_t d_ino;
+ __off64_t d_off;
+ unsigned short d_reclen;
+ char d_name[1];
+ };
+#endif
-DECLARE_INLINE_SYSCALL (int, getdents64, int fd, void *buf, size_t count);
-
-ssize_t
-internal_function
-__getdents64 (int fd, char *buf, size_t nbytes)
-{
- return INLINE_SYSCALL (getdents64, 3, fd, buf, nbytes);
-}
+#define __GETDENTS __getdents64
+#define DIRENT_TYPE struct dirent64
+#include <sysdeps/unix/sysv/linux/getdents.c>
--- /dev/null
+/* This file left intentionally blank. */