Re: How to extend struct stat?

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Thu, 14 Oct 1999 19:16:43 +0200


Alan Cox wrote:
[about d_type field in dirent]
> If the LFS stuff goes in as planned before the freeze it does have to
> change the stat structure for stat64 at least. Perhaps this is an
> opportunity to do both in one ?

This change doesn't have anything to do with stat as such. But IMO, it
would be a very logical to do it at the same time.

I will code up a patch that adds this:

- New struct dirent that matches the one in glibc.

- getdirentries syscall.

Like glibc's getdirentries, except that BASEP can be null and
there's an additional flags argument.

With appropriate flags, glibc's getdirentries will be able to call
this syscall directly, avoiding the parsing and copying overhead
and redundant syscalls it does at the moment.

- Flags argument to distinguish:

- d_type or no d_type
- 32 bit or 64 bit offset.

There's really no gain in the implementation using a separate
syscall for the 64 bit readdir. However if it's decided it's
cleaner to use a separate syscall, say so and I'll do it.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/