4.104.114.84.95
Last change
on this file since 07a3253d was
07a3253d,
checked in by Joel Sherrill <joel.sherrill@…>, on 11/23/98 at 19:07:58
|
Added base version of file system infrastructure. This includes a major
overhaul of the RTEMS system call interface. This base file system is
the "In-Memory File System" aka IMFS.
The design and implementation was done by the following people:
+ Joel Sherrill (joel@…)
+ Jennifer Averett (jennifer@…)
+ Steve "Mr Mount" Salitasc (salitasc@…)
+ Kerwin Wade (wade@…)
PROBLEMS
========
+ It is VERY likely that merging this will break the UNIX port. This
can/will be fixed.
+ There is likely some reentrancy/mutual exclusion needed.
+ Eventually, there should be a "mini-IMFS" description table to
eliminate links, symlinks, etc to save memory. All you need to
have "classic RTEMS" functionality is technically directories
and device IO. All the rest could be left out to save memory.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | /* |
---|
2 | * IMFS_symlink |
---|
3 | * |
---|
4 | * The following rouine creates a new symbolic link node under parent |
---|
5 | * with the name given in name. The node is set to point to the node at |
---|
6 | * to_loc. |
---|
7 | * |
---|
8 | * COPYRIGHT (c) 1989-1998. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * Copyright assigned to U.S. Government, 1994. |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.OARcorp.com/rtems/license.html. |
---|
15 | * |
---|
16 | * $Id$ |
---|
17 | */ |
---|
18 | |
---|
19 | #include <errno.h> |
---|
20 | #include "imfs.h" |
---|
21 | #include "libio_.h" |
---|
22 | |
---|
23 | int IMFS_symlink( |
---|
24 | rtems_filesystem_location_info_t *parent_loc, |
---|
25 | const char *link_name, |
---|
26 | const char *node_name |
---|
27 | ) |
---|
28 | { |
---|
29 | IMFS_types_union info; |
---|
30 | IMFS_jnode_t *new_node; |
---|
31 | char new_name[ NAME_MAX + 1 ]; |
---|
32 | int i; |
---|
33 | |
---|
34 | /* |
---|
35 | * Remove any separators at the end of the string. |
---|
36 | */ |
---|
37 | |
---|
38 | IMFS_get_token( node_name, new_name, &i ); |
---|
39 | |
---|
40 | info.sym_link.name = link_name; |
---|
41 | |
---|
42 | /* |
---|
43 | * Create a new link node. |
---|
44 | */ |
---|
45 | |
---|
46 | new_node = IMFS_create_node( |
---|
47 | parent_loc, |
---|
48 | IMFS_SYM_LINK, |
---|
49 | new_name, |
---|
50 | ( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )), |
---|
51 | &info |
---|
52 | ); |
---|
53 | |
---|
54 | if ( !new_node ) |
---|
55 | set_errno_and_return_minus_one( ENOMEM ); |
---|
56 | |
---|
57 | return 0; |
---|
58 | } |
---|
59 | |
---|
60 | |
---|
Note: See
TracBrowser
for help on using the repository browser.