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

4.115
Last change on this file since 3756041 was 3756041, checked in by Chris Johns <chrisj@…>, on 04/28/12 at 02:21:45

IMFS: Update IMS_assert check when RTEMS_DEBUG is enabled.

Update the assert macro to the new IMFS_jnode_t.

  • Property mode set to 100644
File size: 810 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 "imfs.h"
22
23ssize_t IMFS_readlink(
24  const rtems_filesystem_location_info_t *loc,
25  char *buf,
26  size_t bufsize
27)
28{
29  IMFS_jnode_t      *node;
30  ssize_t            i;
31
32  node = loc->node_access;
33
34  IMFS_assert( node->control.imfs_type == IMFS_SYM_LINK );
35
36  for( i=0; ((i<bufsize) && (node->info.sym_link.name[i] != '\0')); i++ )
37    buf[i] = node->info.sym_link.name[i];
38
39  return i;
40}
Note: See TracBrowser for help on using the repository browser.