[lkml]   [2004]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Add getdents32t syscall
Ulrich Drepper wrote:
> > In other words, why doesn't glibc ever just make a new major number and
> > make its "struct dirent" be the 64-bit version?
> You can't be serious. Can you even imagine the pain this would cause?

Why wouldn't this work?

Change the 32-bit struct dirent to this:

struct direct
__ino_t d_ino;
__u32 __padding1;
__off_t d_off;
__u32 __padding2;
__u32 __padding1;
__ino_t d_ino;
__u32 __padding2;
__off_t d_off;
#error Help!
unsigned short int d_reclen;
unsigned char d_type;
char d_name[256];
And also change getdirentries() and readdir() to call the kernel's getdents64.

Use symbol versioning, so that old binaries will link to the old
(compatible and slower) functions, and newly compiled code, using the
new definition of struct dirent, uses the fast new versions of those

I presume that, if ELF symbol versioning doesn't allow you to do this,
then the same trick you do with stat() can be used. From Glibc's

/* To allow the `struct stat' structure and the file type `mode_t'
bits to vary without changing shared library major version number,
the `stat' family of functions and `mknod' are in fact inline
wrappers around calls to `xstat', `fxstat', `lxstat', and `xmknod',
which all take a leading version-number argument designating the
data structure and bits used.
-- Jamie
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:01    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean