4.104.114.84.95
Last change
on this file since 0bf2ff8 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.4 KB
|
Line | |
---|
1 | /* |
---|
2 | * mknod() |
---|
3 | * |
---|
4 | * This routine is not defined in the POSIX 1003.1b standard but is |
---|
5 | * commonly supported on most UNIX and POSIX systems. It is the |
---|
6 | * foundation for creating file system objects. |
---|
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 <sys/types.h> |
---|
20 | #include <sys/stat.h> |
---|
21 | #include <fcntl.h> |
---|
22 | #include <unistd.h> |
---|
23 | #include <errno.h> |
---|
24 | #include <stdlib.h> |
---|
25 | #include <assert.h> |
---|
26 | |
---|
27 | #include "libio_.h" |
---|
28 | |
---|
29 | int mknod( |
---|
30 | const char *pathname, |
---|
31 | mode_t mode, |
---|
32 | dev_t dev |
---|
33 | ) |
---|
34 | { |
---|
35 | rtems_filesystem_location_info_t temp_loc; |
---|
36 | int i; |
---|
37 | const char *name_start; |
---|
38 | int result; |
---|
39 | |
---|
40 | if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) ) |
---|
41 | set_errno_and_return_minus_one( EINVAL ); |
---|
42 | |
---|
43 | if ( S_ISFIFO(mode) ) |
---|
44 | set_errno_and_return_minus_one( ENOTSUP ); |
---|
45 | |
---|
46 | rtems_filesystem_get_start_loc( pathname, &i, &temp_loc ); |
---|
47 | |
---|
48 | result = (*temp_loc.ops->evalformake)( |
---|
49 | &pathname[i], |
---|
50 | &temp_loc, |
---|
51 | &name_start |
---|
52 | ); |
---|
53 | if ( result != 0 ) |
---|
54 | return -1; |
---|
55 | |
---|
56 | if ( !temp_loc.ops->mknod ) |
---|
57 | set_errno_and_return_minus_one( ENOTSUP ); |
---|
58 | |
---|
59 | return (*temp_loc.ops->mknod)( name_start, mode, dev, &temp_loc ); |
---|
60 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.