From 40a18d7f9a763a7d5d7fc3708741b52f7b55d0e3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 13 Feb 2015 21:11:55 +0100 Subject: 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 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 @@ -2972,6 +2972,32 @@ This is not defined by default. 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 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 -- cgit v1.2.3