source: rtems/cpukit/libfs/src/imfs/imfs_readlink.c @ 8851c0a

4.115
Last change on this file since 8851c0a was 8851c0a, checked in by Joel Sherrill <joel.sherrill@…>, on 08/02/10 at 18:27:23

2010-08-02 Joel Sherrill <joel.sherrill@…>

  • libfs/src/imfs/imfs_creat.c, libfs/src/imfs/imfs_eval.c, libfs/src/imfs/imfs_mknod.c, libfs/src/imfs/imfs_readlink.c, libfs/src/pipe/fifo.c: Clean up for coverage improvements and formatting.
  • Property mode set to 100644
File size: 931 bytes
RevLine 
[07a3253d]1/*
2 *  IMFS_readlink
3 *
[a5305f6b]4 *  The following rouine puts the symblic links destination name into
[07a3253d]5 *  buff.
6 *
[08311cc3]7 *  COPYRIGHT (c) 1989-1999.
[07a3253d]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
[cf0539b1]12 *  http://www.rtems.com/license/LICENSE.
[07a3253d]13 *
14 *  $Id$
15 */
16
[d6b1d73]17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
[07a3253d]21#include <errno.h>
22#include "imfs.h"
[c058578]23#include <rtems/libio_.h>
[b2709481]24#include <rtems/seterr.h>
[07a3253d]25
26int IMFS_readlink(
27  rtems_filesystem_location_info_t  *loc,
28 char                               *buf,         /* OUT */
[a5305f6b]29 size_t                             bufsize
[07a3253d]30)
31{
32  IMFS_jnode_t      *node;
33  int                i;
[a5305f6b]34
[07a3253d]35  node = loc->node_access;
36
[8851c0a]37  IMFS_assert( node->type == IMFS_SYM_LINK );
[07a3253d]38
39  for( i=0; ((i<bufsize) && (node->info.sym_link.name[i] != '\0')); i++ )
40    buf[i] = node->info.sym_link.name[i];
41
42  return i;
43}
Note: See TracBrowser for help on using the repository browser.