source: rtems/cpukit/libfs/src/devfs/devstat.c @ 33645763

4.115
Last change on this file since 33645763 was 33645763, checked in by Joel Sherrill <joel.sherrill@…>, on 07/23/10 at 00:11:32

2010-07-22 Joel Sherrill <joel.sherrill@…>

PR 1627/testing

  • libfs/src/devfs/devstat.c:
  • Property mode set to 100644
File size: 1002 bytes
Line 
1/*
2 *  The license and distribution terms for this file may be
3 *  found in the file LICENSE in this distribution or at
4 *  http://www.rtems.com/license/LICENSE.
5 *
6 *  $Id$
7 */
8
9#if HAVE_CONFIG_H
10#include "config.h"
11#endif
12
13#include <rtems.h>
14#include <rtems/io.h>
15#include <rtems/seterr.h>
16#include <rtems/libio.h>
17#include <sys/stat.h>
18#include <sys/types.h>
19
20#include "devfs.h"
21
22int devFS_stat(
23  rtems_filesystem_location_info_t *loc,
24  struct stat                      *buf
25)
26{
27  rtems_device_name_t *the_dev;
28
29  the_dev = (rtems_device_name_t *)loc->node_access;
30
31  /*
32   *  stat() invokes devFS_evaluate_path() which checks that node_access
33   *  is not NULL.  So this should NEVER be NULL unless someone breaks
34   *  other code in this filesystem.
35   */
36  #if defined(RTEMS_DEBUG)
37    if (!the_dev)
38      rtems_set_errno_and_return_minus_one( EFAULT );
39  #endif
40
41  buf->st_rdev  = rtems_filesystem_make_dev_t( the_dev->major, the_dev->minor );
42  buf->st_mode = the_dev->mode;
43  return 0;
44}
45
46
Note: See TracBrowser for help on using the repository browser.