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

4.11
Last change on this file since 8851c0a was 8851c0a, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 2, 2010 at 6:27:23 PM

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
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.rtems.com/license/LICENSE.
13 *
14 *  $Id$
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <errno.h>
22#include "imfs.h"
23#include <rtems/libio_.h>
24#include <rtems/seterr.h>
25
26int IMFS_readlink(
27  rtems_filesystem_location_info_t  *loc,
28 char                               *buf,         /* OUT */
29 size_t                             bufsize
30)
31{
32  IMFS_jnode_t      *node;
33  int                i;
34
35  node = loc->node_access;
36
37  IMFS_assert( node->type == IMFS_SYM_LINK );
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.