source: rtems/c/src/exec/libfs/src/imfs/imfs_readlink.c @ c058578

4.104.114.84.95
Last change on this file since c058578 was c058578, checked in by Joel Sherrill <joel.sherrill@…>, on 11/01/00 at 21:02:46

2000-11-01 Joel Sherrill <joel@…>

  • src/imfs/Makefile.am, src/imfs/deviceio.c, src/imfs/imfs_chown.c, src/imfs/imfs_config.c, src/imfs/imfs_creat.c, src/imfs/imfs_debug.c, src/imfs/imfs_directory.c, src/imfs/imfs_eval.c, src/imfs/imfs_fchmod.c, src/imfs/imfs_free.c, src/imfs/imfs_fsunmount.c, src/imfs/imfs_gtkn.c, src/imfs/imfs_init.c, src/imfs/imfs_initsupp.c, src/imfs/imfs_link.c, src/imfs/imfs_mknod.c, src/imfs/imfs_mount.c, src/imfs/imfs_readlink.c, src/imfs/imfs_rmnod.c, src/imfs/imfs_stat.c, src/imfs/imfs_symlink.c, src/imfs/imfs_unixstub.c, src/imfs/imfs_unlink.c, src/imfs/imfs_unmount.c, src/imfs/imfs_utime.c, src/imfs/ioman.c, src/imfs/memfile.c, src/imfs/miniimfs_init.c: assoc.h, error.h, libio_.h, libio.h, and libcsupport.h moved from libc to lib/include/rtems and now must be referenced as <rtems/XXX.h>. Now we do not have to reach up and over to libc to pick them up.
  • Property mode set to 100644
File size: 908 bytes
Line 
1/*
2 *  IMFS_readlink
3 *
4 *  The following rouine puts the symblic links destination name into
5 *  buff.
6 *
7 *  COPYRIGHT (c) 1989-1999.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#include <errno.h>
18#include "imfs.h"
19#include <rtems/libio_.h>
20
21int IMFS_readlink(
22  rtems_filesystem_location_info_t  *loc,
23 char                               *buf,         /* OUT */
24 size_t                             bufsize   
25)
26{
27  IMFS_jnode_t      *node;
28  int                i;
29 
30  node = loc->node_access;
31
32  if ( node->type != IMFS_SYM_LINK )
33    set_errno_and_return_minus_one( EINVAL );
34
35  for( i=0; ((i<bufsize) && (node->info.sym_link.name[i] != '\0')); i++ )
36    buf[i] = node->info.sym_link.name[i];
37
38  return i;
39}
Note: See TracBrowser for help on using the repository browser.