[lkml]   [2000]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Return file types from readdir()
Ulrich Drepper wrote:
> > You might prefer a new syscall or open() flag to the method I use for
> > returning the info. If that's the case, ask and I'll write.
> Please use a new syscall.

A new syscall would be tidy, preferably one returning the binary layout
that Glibc returns to apps. Perhaps it should take an extra argument
like BSD's __readdirx for future whiteout/unionfs support.

(readdir64 would not be implemented as a syscall -- you don't need 64
bit dir offsets).

> Otherwise automatically detecting which method can be used is not that
> easy.

It is easy. Look in the new <linux/dirent.h>, at the

That macro always returns DT_UNKNOWN for dirent records without type
info. It is binary compatible with older kernels (and indeed the new
one can return typeless records too).

So all you have to add to Glibc is:

user_dirent->d_type = GETDENTS_DIRENT_D_TYPE (kernel_dirent);

It will just work(tm).

-- Jamie

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:56    [W:0.043 / U:37.008 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site