summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-02-13 21:11:55 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-02-13 21:11:55 +0100
commit40a18d7f9a763a7d5d7fc3708741b52f7b55d0e3 (patch)
treecdfbe9f0541ac352992416213622ca6e92f0a529
parent12eee4fdb5ff2b103d8f316509c590b3325e96a7 (diff)
downloadrtems-40a18d7f9a763a7d5d7fc3708741b52f7b55d0e3.tar.bz2
IMFS: Add CONFIGURE_IMFS_DISABLE_MKNOD_FILE
-rw-r--r--cpukit/sapi/include/confdefs.h6
-rw-r--r--doc/user/conf.t26
-rw-r--r--testsuites/fstests/fsimfsconfig01/init.c8
3 files changed, 35 insertions, 5 deletions
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index 0cf7228ed2..ccc1ded435 100644
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -621,7 +621,11 @@ const rtems_libio_helper rtems_fs_init_helper =
static const IMFS_mknod_controls _Configure_IMFS_mknod_controls = {
&IMFS_mknod_control_directory,
&IMFS_mknod_control_device,
- &IMFS_mknod_control_memfile,
+ #ifdef CONFIGURE_IMFS_DISABLE_MKNOD_FILE
+ &IMFS_mknod_control_enosys,
+ #else
+ &IMFS_mknod_control_memfile,
+ #endif
#if CONFIGURE_MAXIMUM_FIFOS > 0 || CONFIGURE_MAXIMUM_PIPES > 0
&IMFS_mknod_control_fifo
#else
diff --git a/doc/user/conf.t b/doc/user/conf.t
index 138d322994..64d37ad902 100644
--- a/doc/user/conf.t
+++ b/doc/user/conf.t
@@ -2973,6 +2973,32 @@ In case this configuration option is defined, then the support to make
directories, devices, regular files and FIFOs is disabled in the root IMFS.
@c
+@c === CONFIGURE_IMFS_DISABLE_MKNOD_FILE ===
+@c
+@subsection Disable Make Files Support of Root IMFS
+
+@findex CONFIGURE_IMFS_DISABLE_MKNOD_FILE
+
+@table @b
+@item CONSTANT:
+@code{CONFIGURE_IMFS_DISABLE_MKNOD_FILE}
+
+@item DATA TYPE:
+Boolean feature macro.
+
+@item RANGE:
+Defined or undefined.
+
+@item DEFAULT VALUE:
+This is not defined by default.
+
+@end table
+
+@subheading DESCRIPTION:
+In case this configuration option is defined, then the support to make regular
+files is disabled in the root IMFS.
+
+@c
@c === CONFIGURE_IMFS_DISABLE_RMNOD ===
@c
@subsection Disable Remove Nodes Support of Root IMFS
diff --git a/testsuites/fstests/fsimfsconfig01/init.c b/testsuites/fstests/fsimfsconfig01/init.c
index e14ca8d5d8..4132f52bb9 100644
--- a/testsuites/fstests/fsimfsconfig01/init.c
+++ b/testsuites/fstests/fsimfsconfig01/init.c
@@ -78,11 +78,10 @@ static void Init(rtems_task_argument arg)
rv = mknod(dev, S_IFCHR | S_IRWXU, 0);
rtems_test_assert(rv == 0);
+ errno = 0;
fd = creat(file, S_IRWXU);
- rtems_test_assert(fd == 3);
-
- rv = close(fd);
- rtems_test_assert(rv == 0);
+ rtems_test_assert(fd == -1);
+ rtems_test_assert(errno == ENOSYS);
errno = 0;
rv = mkfifo(fifo, S_IRWXU);
@@ -143,6 +142,7 @@ static void Init(rtems_task_argument arg)
#define CONFIGURE_IMFS_DISABLE_MKNOD
#endif
+#define CONFIGURE_IMFS_DISABLE_MKNOD_FILE
#define CONFIGURE_IMFS_DISABLE_MOUNT
#define CONFIGURE_IMFS_DISABLE_RENAME
#define CONFIGURE_IMFS_DISABLE_RMNOD