source:
rtems/cpukit/libcsupport/src/symlink.c
@
da154e14
Last change on this file since da154e14 was da154e14, checked in by Sebastian Huber <sebastian.huber@…>, on 05/14/12 at 14:55:41 | |
---|---|
|
|
File size: 964 bytes |
Rev | Line | |
---|---|---|
[07a3253d] | 1 | /* |
2 | * symlink() - POSIX 1003.1b - X.X.X - XXX | |
3 | * | |
[08311cc3] | 4 | * COPYRIGHT (c) 1989-1999. |
[07a3253d] | 5 | * On-Line Applications Research Corporation (OAR). |
6 | * | |
7 | * The license and distribution terms for this file may be | |
8 | * found in the file LICENSE in this distribution or at | |
[0eae36c7] | 9 | * http://www.rtems.com/license/LICENSE. |
[07a3253d] | 10 | */ |
11 | ||
[9c49db4] | 12 | #if HAVE_CONFIG_H |
[3b7c123] | 13 | #include "config.h" |
[9c49db4] | 14 | #endif |
15 | ||
[3b7c123] | 16 | #include <unistd.h> |
17 | ||
[3ba74c73] | 18 | #include <rtems/libio_.h> |
[07a3253d] | 19 | |
[3b7c123] | 20 | int symlink( const char *path1, const char *path2 ) |
[07a3253d] | 21 | { |
[3b7c123] | 22 | int rv = 0; |
23 | rtems_filesystem_eval_path_context_t ctx; | |
[2563410] | 24 | int eval_flags = RTEMS_FS_FOLLOW_HARD_LINK |
25 | | RTEMS_FS_MAKE | |
26 | | RTEMS_FS_EXCLUSIVE; | |
[3b7c123] | 27 | const rtems_filesystem_location_info_t *currentloc = |
28 | rtems_filesystem_eval_path_start( &ctx, path2, eval_flags ); | |
29 | ||
[da154e14] | 30 | rv = (*currentloc->mt_entry->ops->symlink_h)( |
[3b7c123] | 31 | currentloc, |
32 | rtems_filesystem_eval_path_get_token( &ctx ), | |
33 | rtems_filesystem_eval_path_get_tokenlen( &ctx ), | |
34 | path1 | |
35 | ); | |
36 | ||
37 | rtems_filesystem_eval_path_cleanup( &ctx ); | |
38 | ||
39 | return rv; | |
[07a3253d] | 40 | } |
Note: See TracBrowser
for help on using the repository browser.