readdir() and readdir_r() (XCC)
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 18 Aug 2010 05:50:32 +0000 (22:50 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:52 +0000 (17:35 -0700)
commitf417aa5acb5e0fb13cf7ca0cf4ace9b8373d9461
treeb731187a7ad27ac57be9066fa1b2d137bcd4bf0f
parente1bb7f441431c5a0ebc9c715090e7bc3a10818ca
readdir() and readdir_r() (XCC)

We're currently allowing processes to read() directory FDs, in part
because that is how it was already.  The alternative is to pull in the
glibc stuff related to how Linux does their getdents(), and write that
syscall for ROS.  We'll see how programs really expect readdir() to work
(man 3 readdir, not man 2 readdir).

This patch also brings about per-filetype file_operations, which has
been on the radar/considered for a while.  Right now, they are just used
for having a different read method (and no write method) for
directories.

Rebuild your cross compiler if you want to use the readdir() functions.
kern/include/ros/fs.h
kern/include/vfs.h
kern/src/kfs.c
kern/src/syscall.c
kern/src/vfs.c
tests/file_test.c
tools/compilers/gcc-glibc/glibc-2.11.1-ros/sysdeps/ros/bits/dirent.h
tools/compilers/gcc-glibc/glibc-2.11.1-ros/sysdeps/ros/readdir_r.c [new file with mode: 0644]