4.115
Last change
on this file since 98e5c95 was
98e5c95,
checked in by Sebastian Huber <sebastian.huber@…>, on 12/11/13 at 08:39:09
|
PR2160: imfs: Use ENOSYS for unsupported nodes
Return an error status with errno set to ENOSYS during node creation for
nodes not available in the current configuration.
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | /* |
---|
2 | * COPYRIGHT (c) 2010 |
---|
3 | * Bharath Suri<bharath.s.jois@gmail.com>. |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | */ |
---|
9 | |
---|
10 | #ifdef HAVE_CONFIG_H |
---|
11 | #include "config.h" |
---|
12 | #endif |
---|
13 | |
---|
14 | #include <sys/stat.h> |
---|
15 | #include <stdio.h> |
---|
16 | #include <fcntl.h> |
---|
17 | #include <errno.h> |
---|
18 | #include <unistd.h> |
---|
19 | |
---|
20 | #include "tmacros.h" |
---|
21 | |
---|
22 | /* forward declarations to avoid warnings */ |
---|
23 | rtems_task Init(rtems_task_argument argument); |
---|
24 | |
---|
25 | #define FIFO_PATH "/fifo01" |
---|
26 | |
---|
27 | static void test_main(void) |
---|
28 | { |
---|
29 | int status = -1; |
---|
30 | int fd; |
---|
31 | char buf [1]; |
---|
32 | ssize_t n; |
---|
33 | |
---|
34 | puts("\n\n*** FIFO / PIPE OPEN TEST - 1 ***"); |
---|
35 | |
---|
36 | puts( |
---|
37 | "\nConfiguration: Pipes disabled.\n" |
---|
38 | "Creating named fifo '" FIFO_PATH "'.\n" |
---|
39 | "Must result in failure since pipes are disabled in the configuration." |
---|
40 | ); |
---|
41 | |
---|
42 | errno = 0; |
---|
43 | status = mkfifo(FIFO_PATH, 0777); |
---|
44 | rtems_test_assert(status == -1); |
---|
45 | rtems_test_assert(errno == ENOSYS); |
---|
46 | |
---|
47 | puts("*** END OF FIFO / PIPE OPEN TEST - 1 ***"); |
---|
48 | } |
---|
49 | |
---|
50 | rtems_task Init(rtems_task_argument not_used) |
---|
51 | { |
---|
52 | test_main(); |
---|
53 | rtems_test_exit(0); |
---|
54 | } |
---|
55 | |
---|
56 | #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER |
---|
57 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
58 | |
---|
59 | #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
60 | |
---|
61 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4 |
---|
62 | |
---|
63 | #define CONFIGURE_MAXIMUM_TASKS 1 |
---|
64 | |
---|
65 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
66 | |
---|
67 | #define CONFIGURE_INIT |
---|
68 | |
---|
69 | #include <rtems/confdefs.h> |
---|
Note: See
TracBrowser
for help on using the repository browser.