source: rtems/cpukit/libfs/src/imfs/imfs_readlink.c @ 7c007cf

4.104.114.95
Last change on this file since 7c007cf was a5305f6b, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/17/04 at 08:34:41

Remove stray white spaces.

  • Property mode set to 100644
File size: 974 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  if ( node->type != IMFS_SYM_LINK )
38    rtems_set_errno_and_return_minus_one( EINVAL );
39
40  for( i=0; ((i<bufsize) && (node->info.sym_link.name[i] != '\0')); i++ )
41    buf[i] = node->info.sym_link.name[i];
42
43  return i;
44}
Note: See TracBrowser for help on using the repository browser.