diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-17 16:12:04 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-17 16:12:04 +0000 |
commit | d40da79b04ee4756675c3356cfc156fb7d9bd547 (patch) | |
tree | f55cad54aadd9cac001bccbbb37922cc27597107 /cpukit/libfs/src/devfs/devstat.c | |
parent | 2008-09-17 Miao Yan <yanmiaobest@gmail.com> (diff) | |
download | rtems-d40da79b04ee4756675c3356cfc156fb7d9bd547.tar.bz2 |
2008-09-17 Miao Yan <yanmiaobest@gmail.com>
* Makefile.am, preinstall.am, libcsupport/Makefile.am,
libcsupport/include/rtems/libcsupport.h,
libcsupport/include/rtems/libio.h, libcsupport/src/base_fs.c,
libcsupport/src/libio_init.c, libcsupport/src/newlibc_exit.c,
libcsupport/src/newlibc_init.c, libcsupport/src/sync.c,
libfs/Makefile.am, libfs/src/imfs/deviceio.c,
sapi/include/confdefs.h: Merge GSOC project code to add simple device
only filesystem (devfs), optionally completely drop out filesystem,
and to clean up disabling newlib reentrancy support. This dropped 17K
from the minimum.exe for sparc/sis and arm/rtl22xx_t now has a 15K
code space.
* libcsupport/src/__usrenv.c, libcsupport/src/newlibc_reent.c,
libfs/src/devfs/devclose.c, libfs/src/devfs/devfs.h,
libfs/src/devfs/devfs_eval.c, libfs/src/devfs/devfs_init.c,
libfs/src/devfs/devfs_mknod.c, libfs/src/devfs/devfs_node_type.c,
libfs/src/devfs/devfs_show.c, libfs/src/devfs/devioctl.c,
libfs/src/devfs/devopen.c, libfs/src/devfs/devread.c,
libfs/src/devfs/devstat.c, libfs/src/devfs/devwrite.c,
libfs/src/imfs/deviceerrno.c: New files.
* libcsupport/src/newlibc.c: Removed.
Diffstat (limited to 'cpukit/libfs/src/devfs/devstat.c')
-rw-r--r-- | cpukit/libfs/src/devfs/devstat.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/cpukit/libfs/src/devfs/devstat.c b/cpukit/libfs/src/devfs/devstat.c new file mode 100644 index 0000000000..6c6ee3e6b1 --- /dev/null +++ b/cpukit/libfs/src/devfs/devstat.c @@ -0,0 +1,40 @@ +/* + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include <rtems.h> +#include <rtems/io.h> +#include <rtems/seterr.h> +#include <rtems/libio.h> +#include <sys/stat.h> +#include <sys/types.h> + +#include "devfs.h" + +int devFS_stat( + rtems_filesystem_location_info_t *loc, + struct stat *buf +) +{ + rtems_device_name_t *the_dev; + + the_dev = (rtems_device_name_t *)loc->node_access; + if (!the_dev) + rtems_set_errno_and_return_minus_one( EFAULT ); + + buf->st_dev = rtems_filesystem_make_dev_t( the_dev->major, the_dev->minor ); + + buf->st_mode = the_dev->mode; + + return 0; +} + + |