source: rtems/cpukit/libcsupport/src/eval.c @ a02224e

4.104.114.84.95
Last change on this file since a02224e was a02224e, checked in by Joel Sherrill <joel.sherrill@…>, on 01/04/02 at 18:29:37

2002-01-04 Ralf Corsepius <corsepiu@…>

  • include/rtems/libio_.h: Remove set_errno_and_return_minus_one.
  • libc/cfsetispeed.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/cfsetospeed.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/chdir.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/chmod.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/chown.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/chroot.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/closedir.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/eval.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fchdir.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fchmod.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fdatasync.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fpathconf.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fstat.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fsync.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/ftruncate.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/getdents.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/ioctl.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/link.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/lseek.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/mknod.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/open.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/read.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/readlink.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/rmdir.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/stat.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/symlink.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/tcsetattr.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/telldir.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/ttyname.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/ttyname_r.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/unlink.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/unmount.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/utime.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/write.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[07a3253d]1/*
2 *  rtems_filesystem_evaluate_path()
3 *
4 *  Routine to seed the evaluate path routine.
5 *
[08311cc3]6 *  COPYRIGHT (c) 1989-1999.
[07a3253d]7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
[9c49db4]16#if HAVE_CONFIG_H
17#include "config.h"
18#endif
19
[07a3253d]20#include <rtems.h>
[3ba74c73]21#include <rtems/libio_.h>
[a02224e]22#include <rtems/seterr.h>
[07a3253d]23
24int rtems_filesystem_evaluate_path(
25  const char                        *pathname,
26  int                                flags,
27  rtems_filesystem_location_info_t  *pathloc,
28  int                                follow_link
29)
30{
31  int                           i;
32  int                           result;
33  rtems_filesystem_node_types_t type;
34
35  /*
36   * Verify Input parameters.
37   */
38
39  if ( !pathname )
[a02224e]40    rtems_set_errno_and_return_minus_one( EFAULT );
[07a3253d]41
42  if ( !pathloc )
[a02224e]43    rtems_set_errno_and_return_minus_one( EIO );       /* should never happen */
[07a3253d]44 
45  /*
46   * Evaluate the path using the optable evalpath.
47   */
48
49  rtems_filesystem_get_start_loc( pathname, &i, pathloc );
50
[9c3fa30]51  if ( !pathloc->ops->evalpath_h )
[a02224e]52    rtems_set_errno_and_return_minus_one( ENOTSUP );
[dd19c0b]53
[9c3fa30]54  result = (*pathloc->ops->evalpath_h)( &pathname[i], flags, pathloc );
[07a3253d]55
56  /*
57   * Get the Node type and determine if you need to follow the link or
58   * not.
59   */
60
[0139484]61  if ( (result == 0) && follow_link ) {
[07a3253d]62
[9c3fa30]63    if ( !pathloc->ops->node_type_h )
[a02224e]64      rtems_set_errno_and_return_minus_one( ENOTSUP );
[07a3253d]65
[9c3fa30]66    type = (*pathloc->ops->node_type_h)( pathloc );
[07a3253d]67
68    if ( ( type == RTEMS_FILESYSTEM_HARD_LINK ) ||
69         ( type == RTEMS_FILESYSTEM_SYM_LINK ) ) {
70
[9c3fa30]71        if ( !pathloc->ops->eval_link_h )
[a02224e]72          rtems_set_errno_and_return_minus_one( ENOTSUP );
[07a3253d]73
[9c3fa30]74         result =  (*pathloc->ops->eval_link_h)( pathloc, flags );
[07a3253d]75 
76    }
77  }
78
79  return result;
80}
81
Note: See TracBrowser for help on using the repository browser.