[rtems commit] IMFS: Add CONFIGURE_IMFS_DISABLE_MKNOD_FILE
Sebastian Huber
sebh at rtems.org
Fri Feb 13 20:50:35 UTC 2015
Module: rtems
Branch: master
Commit: 40a18d7f9a763a7d5d7fc3708741b52f7b55d0e3
Changeset: http://git.rtems.org/rtems/commit/?id=40a18d7f9a763a7d5d7fc3708741b52f7b55d0e3
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Feb 13 21:11:55 2015 +0100
IMFS: Add CONFIGURE_IMFS_DISABLE_MKNOD_FILE
---
cpukit/sapi/include/confdefs.h | 6 +++++-
doc/user/conf.t | 26 ++++++++++++++++++++++++++
testsuites/fstests/fsimfsconfig01/init.c | 8 ++++----
3 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index 0cf7228..ccc1ded 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 138d322..64d37ad 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
+ at c === CONFIGURE_IMFS_DISABLE_MKNOD_FILE ===
+ at c
+ at subsection Disable Make Files Support of Root IMFS
+
+ at findex CONFIGURE_IMFS_DISABLE_MKNOD_FILE
+
+ at table @b
+ at item CONSTANT:
+ at code{CONFIGURE_IMFS_DISABLE_MKNOD_FILE}
+
+ at item DATA TYPE:
+Boolean feature macro.
+
+ at item RANGE:
+Defined or undefined.
+
+ at item DEFAULT VALUE:
+This is not defined by default.
+
+ at end table
+
+ at subheading DESCRIPTION:
+In case this configuration option is defined, then the support to make regular
+files is disabled in the root IMFS.
+
+ at 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 e14ca8d..4132f52 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
More information about the vc
mailing list