Have a look at my LFS patches. There syscall is already
there as: getdents64.
ftp://mea.tmt.tele.fi/linux/LFS/
+/*
+ * New, some-improved getdents64() (for LFS) interface.
+ */
+struct linux_dirent64 {
+ __u64 d_ino; /* 64-bit inode */
+ unsigned long d_off; /* Offset within the directory */
+ unsigned short d_reclen;
+ char d_name[1];
+};
+
+struct getdents_callback64 {
+ struct linux_dirent64 * current_dir;
+ struct linux_dirent64 * previous;
+ int count;
+ int error;
+};
That done (after you tell me which fields to add into that dirent),
you have only the glibc side to do... And what parameters to add
to sys_getdents64() syscall.
I have infact wondered, how many of stat64 parameters could be
carried in to supply speeded up processing; mode, size, mtime ?
Full 'struct stat' ? (propably not)
> 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.
fs/readdir.c: sys_getdents() doesn't have user-space
supplied flag parameter to control call behaviour.
D'uh.. Must have separate call.
> -- Jamie
/Matti Aarnio <matti.aarnio@sonera.fi>
-
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/