OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [libfs/] [src/] [imfs/] [imfs_readlink.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
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
 *  imfs_readlink.c,v 1.5 2002/01/04 18:30:58 joel Exp
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
 
26
int 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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.