diff --git a/Documentation/NfsHowto.html b/Documentation/NfsHowto.html index 95da2bb73c7..ec90bbb9260 100644 --- a/Documentation/NfsHowto.html +++ b/Documentation/NfsHowto.html @@ -77,12 +77,9 @@

  1. - First, there are number of things that you must configure in order to be able to use any file system: + First, there are things that you must configure in order to be able to use any file system:
  2. These different device driver types are discussed in the following paragraphs. - Note: device driver support requires that the in-memory, pseudo file system - is enabled by setting the CONFIG_NFILE_DESCRIPTORS in the NuttX configuration file to a - non-zero value. + Note: device driver support depends on the in-memory, pseudo file system + that is enabled by default.

    6.1 Character Device Drivers

    diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 2fcb270e664..e8cd444ce7f 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -8465,9 +8465,7 @@ interface of the same name.

    Pseudo Root File System. - Or, a simple in-memory, pseudo file system can be enabled. - This simple file system can be enabled setting the CONFIG_NFILE_DESCRIPTORS - option to a non-zero value. + A simple in-memory, pseudo file system can be enabled by default. This is an in-memory file system because it does not require any storage medium or block driver support. Rather, file system contents are generated on-the-fly as referenced via @@ -8583,7 +8581,6 @@ interface of the same name. in your NuttX configuration file:

      -
    • CONFIG_NFILE_DESCRIPTORS Defined to be greater than 0
    • CONFIG_DISABLE_POLL NOT defined

    diff --git a/arch/arm/src/common/up_exit.c b/arch/arm/src/common/up_exit.c index c16430f225c..a9d288860b4 100644 --- a/arch/arm/src/common/up_exit.c +++ b/arch/arm/src/common/up_exit.c @@ -80,18 +80,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -102,7 +99,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefs); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/arm/src/common/up_initialize.c b/arch/arm/src/common/up_initialize.c index 8ffe5519b05..82669eace87 100644 --- a/arch/arm/src/common/up_initialize.c +++ b/arch/arm/src/common/up_initialize.c @@ -166,7 +166,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -188,7 +187,6 @@ void up_initialize(void) #if defined(CONFIG_DEV_LOOP) loop_register(); /* Standard /dev/loop */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ defined(CONFIG_DRIVER_NOTE) @@ -213,7 +211,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); @@ -232,7 +230,7 @@ void up_initialize(void) up_cryptoinitialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) +#ifdef CONFIG_CRYPTO_CRYPTODEV devcrypto_register(); #endif diff --git a/arch/arm/src/common/up_internal.h b/arch/arm/src/common/up_internal.h index c6c807ebd23..5aa16f2f213 100644 --- a/arch/arm/src/common/up_internal.h +++ b/arch/arm/src/common/up_internal.h @@ -57,7 +57,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS == 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE diff --git a/arch/avr/src/at32uc3/at32uc3_config.h b/arch/avr/src/at32uc3/at32uc3_config.h index 9dd75a24f7e..de8fe4600f5 100644 --- a/arch/avr/src/at32uc3/at32uc3_config.h +++ b/arch/avr/src/at32uc3/at32uc3_config.h @@ -149,7 +149,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE diff --git a/arch/avr/src/at90usb/at90usb_config.h b/arch/avr/src/at90usb/at90usb_config.h index b00fd1e0ba8..cae14c0707f 100644 --- a/arch/avr/src/at90usb/at90usb_config.h +++ b/arch/avr/src/at90usb/at90usb_config.h @@ -68,7 +68,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE diff --git a/arch/avr/src/atmega/atmega_config.h b/arch/avr/src/atmega/atmega_config.h index 3d21cd82a79..30501e04653 100644 --- a/arch/avr/src/atmega/atmega_config.h +++ b/arch/avr/src/atmega/atmega_config.h @@ -74,7 +74,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE diff --git a/arch/avr/src/common/up_exit.c b/arch/avr/src/common/up_exit.c index 16aac19bb97..d0c722dec7c 100644 --- a/arch/avr/src/common/up_exit.c +++ b/arch/avr/src/common/up_exit.c @@ -79,18 +79,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -101,7 +98,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefs); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/avr/src/common/up_initialize.c b/arch/avr/src/common/up_initialize.c index f9b68bd1e4f..29fd996e1f3 100644 --- a/arch/avr/src/common/up_initialize.c +++ b/arch/avr/src/common/up_initialize.c @@ -74,7 +74,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE @@ -207,7 +207,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -229,7 +228,6 @@ void up_initialize(void) #if defined(CONFIG_DEV_LOOP) loop_register(); /* Standard /dev/loop */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ defined(CONFIG_DRIVER_NOTE) @@ -254,7 +252,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); @@ -273,7 +271,7 @@ void up_initialize(void) up_cryptoinitialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) +#ifdef CONFIG_CRYPTO_CRYPTODEV devcrypto_register(); #endif diff --git a/arch/avr/src/common/up_internal.h b/arch/avr/src/common/up_internal.h index 51a230af43f..761a88898bf 100644 --- a/arch/avr/src/common/up_internal.h +++ b/arch/avr/src/common/up_internal.h @@ -151,13 +151,8 @@ void up_lowinit(void); /* Defined in chip/xxx_serial.c */ -#if CONFIG_NFILE_DESCRIPTORS > 0 void up_earlyserialinit(void); void up_serialinit(void); -#else -# define up_earlyserialinit() -# define up_serialinit() -#endif /* Defined in drivers/lowconsole.c */ diff --git a/arch/hc/src/common/up_exit.c b/arch/hc/src/common/up_exit.c index 1e7f00a6aa1..fe9054d7cb0 100644 --- a/arch/hc/src/common/up_exit.c +++ b/arch/hc/src/common/up_exit.c @@ -79,18 +79,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -101,7 +98,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefs); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/hc/src/common/up_initialize.c b/arch/hc/src/common/up_initialize.c index d1cebe3926b..f7354c70ee4 100644 --- a/arch/hc/src/common/up_initialize.c +++ b/arch/hc/src/common/up_initialize.c @@ -129,7 +129,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -151,7 +150,6 @@ void up_initialize(void) #if defined(CONFIG_DEV_LOOP) loop_register(); /* Standard /dev/loop */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ defined(CONFIG_DRIVER_NOTE) @@ -176,7 +174,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); @@ -195,7 +193,7 @@ void up_initialize(void) up_cryptoinitialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) +#ifdef CONFIG_CRYPTO_CRYPTODEV devcrypto_register(); #endif diff --git a/arch/hc/src/common/up_internal.h b/arch/hc/src/common/up_internal.h index c9e22e837fd..251bb045b3d 100644 --- a/arch/hc/src/common/up_internal.h +++ b/arch/hc/src/common/up_internal.h @@ -57,7 +57,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE @@ -163,13 +163,8 @@ void hc_timer_initialize(void); /* Debug output */ -#if CONFIG_NFILE_DESCRIPTORS > 0 void up_earlyserialinit(void); void up_serialinit(void); -#else -# define up_earlyserialinit() -# define up_serialinit() -#endif #ifdef CONFIG_DEV_LOWCONSOLE void lowconsole_init(void); diff --git a/arch/mips/src/common/up_exit.c b/arch/mips/src/common/up_exit.c index 7f25cedf1f9..cce67178df3 100644 --- a/arch/mips/src/common/up_exit.c +++ b/arch/mips/src/common/up_exit.c @@ -81,18 +81,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -103,7 +100,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefs); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/mips/src/common/up_initialize.c b/arch/mips/src/common/up_initialize.c index f5594980e84..b58168b1105 100644 --- a/arch/mips/src/common/up_initialize.c +++ b/arch/mips/src/common/up_initialize.c @@ -131,7 +131,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -153,7 +152,6 @@ void up_initialize(void) #if defined(CONFIG_DEV_LOOP) loop_register(); /* Standard /dev/loop */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ defined(CONFIG_DRIVER_NOTE) @@ -178,7 +176,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); @@ -197,7 +195,7 @@ void up_initialize(void) up_cryptoinitialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) +#ifdef CONFIG_CRYPTO_CRYPTODEV devcrypto_register(); #endif diff --git a/arch/mips/src/common/up_internal.h b/arch/mips/src/common/up_internal.h index e18fe7fac65..3ea3c651eb2 100644 --- a/arch/mips/src/common/up_internal.h +++ b/arch/mips/src/common/up_internal.h @@ -54,7 +54,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE @@ -236,13 +236,8 @@ void up_addregion(void); /* Serial output */ void up_lowputc(char ch); -#if CONFIG_NFILE_DESCRIPTORS > 0 void up_earlyserialinit(void); void up_serialinit(void); -#else -# define up_earlyserialinit() -# define up_serialinit() -#endif /* System timer */ diff --git a/arch/misoc/src/lm32/lm32.h b/arch/misoc/src/lm32/lm32.h index 6d4ef15a073..047598f328b 100644 --- a/arch/misoc/src/lm32/lm32.h +++ b/arch/misoc/src/lm32/lm32.h @@ -74,7 +74,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE diff --git a/arch/misoc/src/lm32/lm32_exit.c b/arch/misoc/src/lm32/lm32_exit.c index 22481dbbab6..0c38ebb2da1 100644 --- a/arch/misoc/src/lm32/lm32_exit.c +++ b/arch/misoc/src/lm32/lm32_exit.c @@ -74,18 +74,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -96,7 +93,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefssinfo); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/misoc/src/minerva/minerva.h b/arch/misoc/src/minerva/minerva.h index b6245f70034..b79888e91a1 100644 --- a/arch/misoc/src/minerva/minerva.h +++ b/arch/misoc/src/minerva/minerva.h @@ -74,7 +74,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE diff --git a/arch/misoc/src/minerva/minerva_exit.c b/arch/misoc/src/minerva/minerva_exit.c index 1a24b5ce4cd..c825dfaca45 100644 --- a/arch/misoc/src/minerva/minerva_exit.c +++ b/arch/misoc/src/minerva/minerva_exit.c @@ -74,18 +74,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -95,7 +92,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) sinfo(" fd=%d refcount=%d\n", i, inode->i_crefssinfo); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/or1k/src/common/up_exit.c b/arch/or1k/src/common/up_exit.c index 476093ea573..383cfaa5084 100644 --- a/arch/or1k/src/common/up_exit.c +++ b/arch/or1k/src/common/up_exit.c @@ -79,18 +79,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -101,7 +98,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefssinfo); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/or1k/src/common/up_initialize.c b/arch/or1k/src/common/up_initialize.c index 97a1a006ea9..932048304d8 100644 --- a/arch/or1k/src/common/up_initialize.c +++ b/arch/or1k/src/common/up_initialize.c @@ -225,7 +225,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -247,7 +246,6 @@ void up_initialize(void) #if defined(CONFIG_DEV_LOOP) loop_register(); /* Standard /dev/loop */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ defined(CONFIG_DRIVER_NOTE) @@ -270,7 +268,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); @@ -293,7 +291,7 @@ void up_initialize(void) up_cryptoinitialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) +#ifdef CONFIG_CRYPTO_CRYPTODEV devcrypto_register(); #endif diff --git a/arch/or1k/src/common/up_internal.h b/arch/or1k/src/common/up_internal.h index 86eb6ce3756..3ec2277b78a 100644 --- a/arch/or1k/src/common/up_internal.h +++ b/arch/or1k/src/common/up_internal.h @@ -57,7 +57,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS == 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE diff --git a/arch/renesas/src/common/up_exit.c b/arch/renesas/src/common/up_exit.c index 81b61d9085d..835ba9ba752 100644 --- a/arch/renesas/src/common/up_exit.c +++ b/arch/renesas/src/common/up_exit.c @@ -79,18 +79,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s\n", tcb, tcb->argv[0]); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -101,7 +98,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefs); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/renesas/src/common/up_initialize.c b/arch/renesas/src/common/up_initialize.c index fcfd33dd159..2487a98e20f 100644 --- a/arch/renesas/src/common/up_initialize.c +++ b/arch/renesas/src/common/up_initialize.c @@ -112,7 +112,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -134,7 +133,6 @@ void up_initialize(void) #if defined(CONFIG_DEV_LOOP) loop_register(); /* Standard /dev/loop */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ defined(CONFIG_DRIVER_NOTE) @@ -162,7 +160,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); @@ -181,7 +179,7 @@ void up_initialize(void) up_cryptoinitialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) +#ifdef CONFIG_CRYPTO_CRYPTODEV devcrypto_register(); #endif diff --git a/arch/renesas/src/common/up_internal.h b/arch/renesas/src/common/up_internal.h index f107a0d1e66..e0d259a59fb 100644 --- a/arch/renesas/src/common/up_internal.h +++ b/arch/renesas/src/common/up_internal.h @@ -62,7 +62,7 @@ * a serial console is assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE @@ -165,13 +165,8 @@ void up_vectorfiq(void); /* Defined in xyz_serial.c */ -#if CONFIG_NFILE_DESCRIPTORS > 0 void up_earlyconsoleinit(void); void up_consoleinit(void); -#else -# define up_earlyconsoleinit() -# define up_consoleinit() -#endif /* Defined in drivers/lowconsole.c */ diff --git a/arch/risc-v/src/common/up_exit.c b/arch/risc-v/src/common/up_exit.c index 941910d686d..2102b849e5d 100644 --- a/arch/risc-v/src/common/up_exit.c +++ b/arch/risc-v/src/common/up_exit.c @@ -81,18 +81,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -103,7 +100,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefs); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/risc-v/src/common/up_initialize.c b/arch/risc-v/src/common/up_initialize.c index 986ea1c5d89..e1ad78bbb77 100644 --- a/arch/risc-v/src/common/up_initialize.c +++ b/arch/risc-v/src/common/up_initialize.c @@ -131,7 +131,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -142,8 +141,6 @@ void up_initialize(void) devzero_register(); /* Standard /dev/zero */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ - /* Initialize the serial device driver */ #ifdef USE_SERIALDRIVER @@ -162,7 +159,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); diff --git a/arch/risc-v/src/common/up_internal.h b/arch/risc-v/src/common/up_internal.h index 011f00d510c..8d26124f93f 100644 --- a/arch/risc-v/src/common/up_internal.h +++ b/arch/risc-v/src/common/up_internal.h @@ -77,7 +77,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE diff --git a/arch/sim/src/up_initialize.c b/arch/sim/src/up_initialize.c index f18767ba96b..7ec962b9b99 100644 --- a/arch/sim/src/up_initialize.c +++ b/arch/sim/src/up_initialize.c @@ -207,7 +207,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -229,7 +228,6 @@ void up_initialize(void) #if defined(CONFIG_DEV_LOOP) loop_register(); /* Standard /dev/loop */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ defined(CONFIG_DRIVER_NOTE) @@ -250,7 +248,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); @@ -269,7 +267,7 @@ void up_initialize(void) up_cryptoinitialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) +#ifdef CONFIG_CRYPTO_CRYPTODEV devcrypto_register(); #endif diff --git a/arch/sim/src/up_internal.h b/arch/sim/src/up_internal.h index 71f41facd97..a30ee8f33bc 100644 --- a/arch/sim/src/up_internal.h +++ b/arch/sim/src/up_internal.h @@ -85,7 +85,7 @@ /* Determine which (if any) console driver to use */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS == 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_DEVCONSOLE # undef CONFIG_RAMLOG_CONSOLE #else diff --git a/arch/x86/src/common/up_exit.c b/arch/x86/src/common/up_exit.c index e3bec44e831..0aa1377915d 100644 --- a/arch/x86/src/common/up_exit.c +++ b/arch/x86/src/common/up_exit.c @@ -79,18 +79,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -101,7 +98,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefs); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/x86/src/common/up_initialize.c b/arch/x86/src/common/up_initialize.c index 790a315207e..48c95ecfeaa 100644 --- a/arch/x86/src/common/up_initialize.c +++ b/arch/x86/src/common/up_initialize.c @@ -131,7 +131,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -153,7 +152,6 @@ void up_initialize(void) #if defined(CONFIG_DEV_LOOP) loop_register(); /* Standard /dev/loop */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ defined(CONFIG_DRIVER_NOTE) @@ -178,7 +176,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); @@ -197,7 +195,7 @@ void up_initialize(void) up_cryptoinitialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) +#ifdef CONFIG_CRYPTO_CRYPTODEV devcrypto_register(); #endif diff --git a/arch/x86/src/common/up_internal.h b/arch/x86/src/common/up_internal.h index 1ad721b39c2..32690eddfe5 100644 --- a/arch/x86/src/common/up_internal.h +++ b/arch/x86/src/common/up_internal.h @@ -56,7 +56,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE @@ -202,13 +202,8 @@ void up_addregion(void); /* Defined in xyz_serial.c */ -#if CONFIG_NFILE_DESCRIPTORS > 0 void up_earlyserialinit(void); void up_serialinit(void); -#else -# define up_earlyserialinit() -# define up_serialinit() -#endif /* Defined in drivers/lowconsole.c */ diff --git a/arch/xtensa/src/common/xtensa.h b/arch/xtensa/src/common/xtensa.h index a27c7e26ead..06e1948d020 100644 --- a/arch/xtensa/src/common/xtensa.h +++ b/arch/xtensa/src/common/xtensa.h @@ -57,7 +57,7 @@ * assumed. */ -#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#ifndef CONFIG_DEV_CONSOLE # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE @@ -329,13 +329,8 @@ void xtensa_add_region(void); /* Serial output */ void up_lowputc(char ch); -#if CONFIG_NFILE_DESCRIPTORS > 0 void xtensa_early_serial_initialize(void); void xtensa_serial_initialize(void); -#else -# define xtensa_earlyserialinit() -# define xtensa_serial_initialize() -#endif /* System timer */ diff --git a/arch/xtensa/src/common/xtensa_exit.c b/arch/xtensa/src/common/xtensa_exit.c index 6dec81087b2..50ababe408f 100644 --- a/arch/xtensa/src/common/xtensa_exit.c +++ b/arch/xtensa/src/common/xtensa_exit.c @@ -80,18 +80,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _xtensa_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s pid=%d\n", tcb, tcb->argv[0], tcb->pid); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -102,7 +99,6 @@ static void _xtensa_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefs); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/xtensa/src/common/xtensa_initialize.c b/arch/xtensa/src/common/xtensa_initialize.c index 9721e86962e..3a109b4e1b7 100644 --- a/arch/xtensa/src/common/xtensa_initialize.c +++ b/arch/xtensa/src/common/xtensa_initialize.c @@ -139,7 +139,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -161,7 +160,6 @@ void up_initialize(void) #if defined(CONFIG_DEV_LOOP) loop_register(); /* Standard /dev/loop */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ defined(CONFIG_DRIVER_NOTE) @@ -186,7 +184,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); @@ -205,7 +203,7 @@ void up_initialize(void) up_cryptoinitialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) +#ifdef CONFIG_CRYPTO_CRYPTODEV devcrypto_register(); #endif diff --git a/arch/z16/src/common/up_exit.c b/arch/z16/src/common/up_exit.c index 2da02445159..27eed07ff09 100644 --- a/arch/z16/src/common/up_exit.c +++ b/arch/z16/src/common/up_exit.c @@ -79,18 +79,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s\n", tcb, tcb->argv[0]); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -101,7 +98,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefs); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/z16/src/common/up_initialize.c b/arch/z16/src/common/up_initialize.c index ea5653c99f2..3df9ce06f10 100644 --- a/arch/z16/src/common/up_initialize.c +++ b/arch/z16/src/common/up_initialize.c @@ -131,7 +131,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -153,7 +152,6 @@ void up_initialize(void) #if defined(CONFIG_DEV_LOOP) loop_register(); /* Standard /dev/loop */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ defined(CONFIG_DRIVER_NOTE) @@ -178,7 +176,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); @@ -197,7 +195,7 @@ void up_initialize(void) up_cryptoinitialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) +#ifdef CONFIG_CRYPTO_CRYPTODEV devcrypto_register(); #endif diff --git a/arch/z16/src/common/up_internal.h b/arch/z16/src/common/up_internal.h index 015cc642348..98ccae82ada 100644 --- a/arch/z16/src/common/up_internal.h +++ b/arch/z16/src/common/up_internal.h @@ -62,10 +62,10 @@ */ #if defined(CONFIG_Z16_LOWPUTC) || defined(CONFIG_Z16_LOWGETC) || \ - CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) + defined(CONFIG_DEV_LOWCONSOLE) # define USE_LOWCONSOLE 1 # define USE_LOWUARTINIT 1 -#elif !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#elif !defined(CONFIG_DEV_CONSOLE) # undef USE_SERIALDRIVER # undef USE_EARLYSERIALINIT # undef CONFIG_DEV_LOWCONSOLE diff --git a/arch/z80/src/common/up_exit.c b/arch/z80/src/common/up_exit.c index cefe81db09f..250de676051 100644 --- a/arch/z80/src/common/up_exit.c +++ b/arch/z80/src/common/up_exit.c @@ -81,18 +81,15 @@ #ifdef CONFIG_DUMP_ON_EXIT static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *filelist; #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *streamlist; #endif int i; -#endif sinfo(" TCB=%p name=%s\n", tcb, tcb->argv[0]); sinfo(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state); -#if CONFIG_NFILE_DESCRIPTORS > 0 filelist = tcb->group->tg_filelist; for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++) { @@ -103,7 +100,6 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) i, inode->i_crefs); } } -#endif #if CONFIG_NFILE_STREAMS > 0 streamlist = tcb->group->tg_streamlist; diff --git a/arch/z80/src/common/up_initialize.c b/arch/z80/src/common/up_initialize.c index 25210078fe2..4f836eb630b 100644 --- a/arch/z80/src/common/up_initialize.c +++ b/arch/z80/src/common/up_initialize.c @@ -128,7 +128,6 @@ void up_initialize(void) iob_initialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Register devices */ #if defined(CONFIG_DEV_NULL) @@ -150,7 +149,6 @@ void up_initialize(void) #if defined(CONFIG_DEV_LOOP) loop_register(); /* Standard /dev/loop */ #endif -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if defined(CONFIG_SCHED_INSTRUMENTATION_BUFFER) && \ defined(CONFIG_DRIVER_NOTE) @@ -175,7 +173,7 @@ void up_initialize(void) ramlog_consoleinit(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_PSEUDOTERM_SUSV1) +#ifdef CONFIG_PSEUDOTERM_SUSV1 /* Register the master pseudo-terminal multiplexor device */ (void)ptmx_register(); @@ -194,7 +192,7 @@ void up_initialize(void) up_cryptoinitialize(); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_CRYPTO_CRYPTODEV) +#ifdef CONFIG_CRYPTO_CRYPTODEV devcrypto_register(); #endif diff --git a/arch/z80/src/common/up_internal.h b/arch/z80/src/common/up_internal.h index 9a8ed0c9a1e..59e71a51f70 100644 --- a/arch/z80/src/common/up_internal.h +++ b/arch/z80/src/common/up_internal.h @@ -57,14 +57,14 @@ * assumed. */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) +#if defined(CONFIG_DEV_LOWCONSOLE) # undef USE_SERIALDRIVER # ifdef CONFIG_HAVE_LOWSERIALINIT # define USE_LOWSERIALINIT 1 # else # undef USE_LOWSERIALINIT # endif -#elif !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0 +#elif !defined(CONFIG_DEV_CONSOLE) # undef USE_SERIALDRIVER # undef USE_LOWSERIALINIT # undef CONFIG_DEV_LOWCONSOLE diff --git a/binfmt/libpcode/README.txt b/binfmt/libpcode/README.txt index debbb95931e..8b1b3740099 100644 --- a/binfmt/libpcode/README.txt +++ b/binfmt/libpcode/README.txt @@ -12,7 +12,6 @@ the NuttX apps/ package and that you have named the directory apps/). Other required configuration settings: - CONFIG_NFILE_DESCRIPTORS > 3 CONFIG_BINFMT_DISABLE=n CONFIG_BINFMT_PCODE=y diff --git a/binfmt/pcode.c b/binfmt/pcode.c index db8caf175f7..bfe45a58176 100644 --- a/binfmt/pcode.c +++ b/binfmt/pcode.c @@ -67,10 +67,6 @@ * are required -- only the more obvious. */ -#if CONFIG_NFILE_DESCRIPTORS < 1 -# error You must provide file descriptors via CONFIG_NFILE_DESCRIPTORS in your configuration file -#endif - #ifdef CONFIG_BINFMT_DISABLE # error The binary loader is disabled (CONFIG_BINFMT_DISABLE)! #endif diff --git a/configs/demo9s12ne64/ostest/defconfig b/configs/demo9s12ne64/ostest/defconfig index 06f5cad1b7f..842c8786113 100644 --- a/configs/demo9s12ne64/ostest/defconfig +++ b/configs/demo9s12ne64/ostest/defconfig @@ -20,7 +20,7 @@ CONFIG_IDLETHREAD_STACKSIZE=256 CONFIG_MAX_TASKS=8 CONFIG_MAX_WDOGPARMS=2 CONFIG_MOTOROLA_SREC=y -CONFIG_NFILE_DESCRIPTORS=0 +CONFIG_NFILE_DESCRIPTORS=3 CONFIG_NFILE_STREAMS=0 CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_TIMERS=0 diff --git a/configs/ea3131/locked/mklocked.sh b/configs/ea3131/locked/mklocked.sh index 3dbbd54b3dd..86e593b51d2 100755 --- a/configs/ea3131/locked/mklocked.sh +++ b/configs/ea3131/locked/mklocked.sh @@ -183,10 +183,7 @@ if [ "$answer" = n ]; then echo "EXTERN(pthread_initialize)" >>ld-locked.inc fi -answer=$(checkzero CONFIG_NFILE_DESCRIPTORS) -if [ "$answer" = n ]; then - echo "EXTERN(fs_initialize)" >>ld-locked.inc -fi +echo "EXTERN(fs_initialize)" >>ld-locked.inc answer=$(checkconfig CONFIG_NET) if [ "$answer" = y ]; then diff --git a/configs/ne64badge/ostest/defconfig b/configs/ne64badge/ostest/defconfig index a3cf6b06d7d..5bcbd83c2af 100644 --- a/configs/ne64badge/ostest/defconfig +++ b/configs/ne64badge/ostest/defconfig @@ -19,7 +19,7 @@ CONFIG_IDLETHREAD_STACKSIZE=256 CONFIG_MAX_TASKS=8 CONFIG_MAX_WDOGPARMS=2 CONFIG_MOTOROLA_SREC=y -CONFIG_NFILE_DESCRIPTORS=0 +CONFIG_NFILE_DESCRIPTORS=3 CONFIG_NFILE_STREAMS=0 CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_TIMERS=0 diff --git a/configs/p112/ostest/defconfig b/configs/p112/ostest/defconfig index 603947db945..48cf2ad324b 100644 --- a/configs/p112/ostest/defconfig +++ b/configs/p112/ostest/defconfig @@ -16,7 +16,7 @@ CONFIG_GRAN=y CONFIG_HOST_WINDOWS=y CONFIG_MAX_TASKS=8 CONFIG_MAX_WDOGPARMS=2 -CONFIG_NFILE_DESCRIPTORS=0 +CONFIG_NFILE_DESCRIPTORS=3 CONFIG_NFILE_STREAMS=0 CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_TIMERS=0 diff --git a/configs/z16f2800100zcog/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch b/configs/z16f2800100zcog/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch index f7d5fe4eb16..78f67faa01d 100644 --- a/configs/z16f2800100zcog/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch +++ b/configs/z16f2800100zcog/tools/zneo-zdsii-5_0_1-variadic-func-fix.patch @@ -10,7 +10,7 @@ index ba7dbe7..45e4ab1 100644 #include #include #include -@@ -79,8 +80,13 @@ static FAR struct nsh_vtbl_s *nsh_consoleclone(FAR struct nsh_vtbl_s *vtbl); +@@ -79,7 +80,12 @@ static FAR struct nsh_vtbl_s *nsh_consoleclone(FAR struct nsh_vtbl_s *vtbl); static void nsh_consolerelease(FAR struct nsh_vtbl_s *vtbl); static ssize_t nsh_consolewrite(FAR struct nsh_vtbl_s *vtbl, FAR const void *buffer, size_t nbytes); @@ -23,7 +23,6 @@ index ba7dbe7..45e4ab1 100644 +#endif static FAR char *nsh_consolelinebuffer(FAR struct nsh_vtbl_s *vtbl); - #if CONFIG_NFILE_DESCRIPTORS > 0 @@ -213,6 +219,7 @@ static ssize_t nsh_consolewrite(FAR struct nsh_vtbl_s *vtbl, FAR const void *buf * ****************************************************************************/ @@ -32,14 +31,13 @@ index ba7dbe7..45e4ab1 100644 static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, ...) { -@@ -263,6 +270,51 @@ static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl, +@@ -263,6 +270,29 @@ static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl, #endif } +#else +static int nsh_consolevoutput(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, va_list ap) +{ -+#if CONFIG_NFILE_DESCRIPTORS > 0 + FAR struct console_stdio_s *pstate = (FAR struct console_stdio_s *)vtbl; + int ret; + @@ -56,27 +54,6 @@ index ba7dbe7..45e4ab1 100644 + ret = vfprintf(pstate->cn_outstream, fmt, ap); + + return ret; -+#else -+ char *str; -+ -+ /* Use vasprintf() to allocate a buffer and fill it with the formatted -+ * data -+ */ -+ -+ str = NULL; -+ (void)vasprintf(&str, fmt, ap); -+ -+ /* Was a string allocated? */ -+ -+ if (str) -+ { -+ /* Yes.. Print then free the allocated string */ -+ -+ printf("%s", str); -+ free(str); -+ } -+ -+ return 0; +#endif +} +#endif @@ -138,7 +115,7 @@ index c78362f..207f9b9 100644 /* Size of info to be saved in call to nsh_redirect */ -@@ -107,7 +110,11 @@ struct nsh_vtbl_s +@@ -107,6 +110,10 @@ struct nsh_vtbl_s void (*release)(FAR struct nsh_vtbl_s *vtbl); #endif ssize_t (*write)(FAR struct nsh_vtbl_s *vtbl, FAR const void *buffer, size_t nbytes); @@ -148,7 +125,6 @@ index c78362f..207f9b9 100644 + int (*voutput)(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, va_list ap); +#endif FAR char *(*linebuffer)(FAR struct nsh_vtbl_s *vtbl); - #if CONFIG_NFILE_DESCRIPTORS > 0 void (*redirect)(FAR struct nsh_vtbl_s *vtbl, int fd, FAR uint8_t *save); @@ -159,5 +166,6 @@ struct console_stdio_s /* Defined in nsh_console.c *************************************************/ diff --git a/configs/z80sim/ostest/defconfig b/configs/z80sim/ostest/defconfig index c53ff10529b..bca37ea0f54 100644 --- a/configs/z80sim/ostest/defconfig +++ b/configs/z80sim/ostest/defconfig @@ -12,7 +12,7 @@ CONFIG_DISABLE_POLL=y CONFIG_DISABLE_PTHREAD=y CONFIG_MAX_TASKS=8 CONFIG_MAX_WDOGPARMS=2 -CONFIG_NFILE_DESCRIPTORS=0 +CONFIG_NFILE_DESCRIPTORS=3 CONFIG_NFILE_STREAMS=0 CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_TIMERS=0 diff --git a/configs/z80sim/src/Makefile b/configs/z80sim/src/Makefile index 6ab51ade33d..060c116c679 100644 --- a/configs/z80sim/src/Makefile +++ b/configs/z80sim/src/Makefile @@ -36,10 +36,6 @@ -include $(TOPDIR)/Make.defs ASRCS = -CSRCS = z80_irq.c z80_timerisr.c z80_lowputc.c - -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) -CSRCS += z80_serial.c -endif +CSRCS = z80_irq.c z80_timerisr.c z80_lowputc.c z80_serial.c include $(TOPDIR)/configs/Board.mk diff --git a/configs/z80sim/src/z80_serial.c b/configs/z80sim/src/z80_serial.c index a71da233f9d..ee1f60570e6 100644 --- a/configs/z80sim/src/z80_serial.c +++ b/configs/z80sim/src/z80_serial.c @@ -55,7 +55,7 @@ #include "up_arch.h" #include "up_internal.h" -#if defined(USE_SERIALDRIVER) && CONFIG_NFILE_DESCRIPTORS > 0 +#ifdef USE_SERIALDRIVER /**************************************************************************** * Private Function Prototypes @@ -336,7 +336,7 @@ void up_serialinit(void) (void)uart_register("/dev/ttyS0", &g_uartport); } -#endif /* USE_SERIALDRIVER && CONFIG_NFILE_DESCRIPTORS > 0 */ +#endif /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc diff --git a/configs/z8encore000zco/ostest/defconfig b/configs/z8encore000zco/ostest/defconfig index e7967a1ce7e..00bdee973e6 100644 --- a/configs/z8encore000zco/ostest/defconfig +++ b/configs/z8encore000zco/ostest/defconfig @@ -17,7 +17,7 @@ CONFIG_HOST_WINDOWS=y CONFIG_IDLETHREAD_STACKSIZE=256 CONFIG_MAX_TASKS=8 CONFIG_MAX_WDOGPARMS=2 -CONFIG_NFILE_DESCRIPTORS=0 +CONFIG_NFILE_DESCRIPTORS=3 CONFIG_NFILE_STREAMS=0 CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_TIMERS=0 diff --git a/configs/z8f64200100kit/ostest/defconfig b/configs/z8f64200100kit/ostest/defconfig index 0ecc6904693..717f104ec6f 100644 --- a/configs/z8f64200100kit/ostest/defconfig +++ b/configs/z8f64200100kit/ostest/defconfig @@ -16,7 +16,7 @@ CONFIG_HOST_WINDOWS=y CONFIG_IDLETHREAD_STACKSIZE=256 CONFIG_MAX_TASKS=8 CONFIG_MAX_WDOGPARMS=2 -CONFIG_NFILE_DESCRIPTORS=0 +CONFIG_NFILE_DESCRIPTORS=3 CONFIG_NFILE_STREAMS=0 CONFIG_NUNGET_CHARS=0 CONFIG_PREALLOC_TIMERS=0 diff --git a/drivers/Makefile b/drivers/Makefile index 191c1a66df3..b4fc05160b6 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -83,8 +83,7 @@ include wireless$(DELIM)Make.defs include contactless$(DELIM)Make.defs include 1wire$(DELIM)Make.defs -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) - CSRCS += dev_null.c dev_zero.c +CSRCS += dev_null.c dev_zero.c ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) CSRCS += ramdisk.c @@ -96,7 +95,6 @@ ifeq ($(CONFIG_DRVR_READAHEAD),y) endif endif endif -endif # CONFIG_NFILE_DESCRIPTORS != 0 AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/drivers/bch/Make.defs b/drivers/bch/Make.defs index 18225c55933..902c003ebfe 100644 --- a/drivers/bch/Make.defs +++ b/drivers/bch/Make.defs @@ -33,7 +33,6 @@ # ############################################################################ -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) # Include BCH driver @@ -49,4 +48,4 @@ VPATH += :bch CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)bch} endif -endif + diff --git a/drivers/pipes/Make.defs b/drivers/pipes/Make.defs index 836505481b6..377e43a588e 100644 --- a/drivers/pipes/Make.defs +++ b/drivers/pipes/Make.defs @@ -33,8 +33,6 @@ # ############################################################################ -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) - # Include pipe driver CSRCS += pipe.c fifo.c pipe_common.c @@ -43,4 +41,4 @@ CSRCS += pipe.c fifo.c pipe_common.c DEPPATH += --dep-path pipes VPATH += :pipes -endif + diff --git a/drivers/serial/Make.defs b/drivers/serial/Make.defs index f1e5020b7ec..5d1b7c11c30 100644 --- a/drivers/serial/Make.defs +++ b/drivers/serial/Make.defs @@ -33,8 +33,6 @@ # ############################################################################ -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) - # Include serial drivers CSRCS += serial.c serial_io.c lowconsole.c @@ -66,4 +64,4 @@ endif DEPPATH += --dep-path serial VPATH += :serial -endif + diff --git a/drivers/syslog/syslog.h b/drivers/syslog/syslog.h index cfc97dab07e..909ebdcd0ec 100644 --- a/drivers/syslog/syslog.h +++ b/drivers/syslog/syslog.h @@ -100,9 +100,7 @@ EXTERN FAR const struct syslog_channel_s *g_syslog_channel; * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int syslog_dev_initialize(FAR const char *devpath, int oflags, int mode); -#endif /**************************************************************************** * Name: syslog_dev_uninitialize @@ -124,7 +122,7 @@ int syslog_dev_initialize(FAR const char *devpath, int oflags, int mode); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SYSLOG_FILE) +#ifdef CONFIG_SYSLOG_FILE int syslog_dev_uninitialize(void); #endif /* CONFIG_SYSLOG_FILE */ @@ -343,9 +341,7 @@ ssize_t syslog_dev_write(FAR const char *buffer, size_t buflen); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int syslog_dev_putc(int ch); -#endif /**************************************************************************** * Name: syslog_dev_flush @@ -361,9 +357,7 @@ int syslog_dev_putc(int ch); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int syslog_dev_flush(void); -#endif #undef EXTERN #ifdef __cplusplus diff --git a/drivers/syslog/syslog_device.c b/drivers/syslog/syslog_device.c index e76f5b9bee8..a239993114a 100644 --- a/drivers/syslog/syslog_device.c +++ b/drivers/syslog/syslog_device.c @@ -58,8 +58,6 @@ #include "syslog.h" -#if CONFIG_NFILE_DESCRIPTORS > 0 - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -698,4 +696,3 @@ int syslog_dev_flush(void) return OK; } -#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */ diff --git a/drivers/usbhost/usbhost_hidkbd.c b/drivers/usbhost/usbhost_hidkbd.c index 432f095585b..96588341cb6 100644 --- a/drivers/usbhost/usbhost_hidkbd.c +++ b/drivers/usbhost/usbhost_hidkbd.c @@ -75,7 +75,7 @@ /* Don't compile if prerequisites are not met */ -#if defined(CONFIG_USBHOST) && !defined(CONFIG_USBHOST_INT_DISABLE) && CONFIG_NFILE_DESCRIPTORS > 0 +#if defined(CONFIG_USBHOST) && !defined(CONFIG_USBHOST_INT_DISABLE) /**************************************************************************** * Pre-processor Definitions @@ -2448,4 +2448,4 @@ int usbhost_kbdinit(void) return usbhost_registerclass(&g_hidkbd); } -#endif /* CONFIG_USBHOST)&& !CONFIG_USBHOST_INT_DISABLE && CONFIG_NFILE_DESCRIPTORS */ +#endif /* CONFIG_USBHOST)&& !CONFIG_USBHOST_INT_DISABLE */ diff --git a/drivers/usbhost/usbhost_hidmouse.c b/drivers/usbhost/usbhost_hidmouse.c index f23d61fefc2..1b4ddac1764 100644 --- a/drivers/usbhost/usbhost_hidmouse.c +++ b/drivers/usbhost/usbhost_hidmouse.c @@ -73,7 +73,7 @@ /* Don't compile if prerequisites are not met */ -#if defined(CONFIG_USBHOST) && !defined(CONFIG_USBHOST_INT_DISABLE) && CONFIG_NFILE_DESCRIPTORS > 0 +#if defined(CONFIG_USBHOST) && !defined(CONFIG_USBHOST_INT_DISABLE) /**************************************************************************** * Pre-processor Definitions @@ -2577,4 +2577,4 @@ int usbhost_mouse_init(void) return usbhost_registerclass(&g_hidmouse); } -#endif /* CONFIG_USBHOST)&& !CONFIG_USBHOST_INT_DISABLE && CONFIG_NFILE_DESCRIPTORS */ +#endif /* CONFIG_USBHOST)&& !CONFIG_USBHOST_INT_DISABLE */ diff --git a/drivers/usbhost/usbhost_storage.c b/drivers/usbhost/usbhost_storage.c index e3b5828429b..58dd6bd439d 100644 --- a/drivers/usbhost/usbhost_storage.c +++ b/drivers/usbhost/usbhost_storage.c @@ -64,7 +64,7 @@ /* Don't compile if prerequisites are not met */ #if defined(CONFIG_USBHOST) && !defined(CONFIG_USBHOST_BULK_DISABLE) && \ - !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 + !defined(CONFIG_DISABLE_MOUNTPOINT) /**************************************************************************** * Pre-processor Definitions @@ -2317,4 +2317,5 @@ int usbhost_msc_initialize(void) return usbhost_registerclass(&g_storage); } -#endif /* CONFIG_USBHOST && !CONFIG_USBHOST_BULK_DISABLE && !CONFIG_DISABLE_MOUNTPOINT && CONFIG_NFILE_DESCRIPTORS > 0 */ +#endif /* CONFIG_USBHOST && !CONFIG_USBHOST_BULK_DISABLE && !CONFIG_DISABLE_MOUNTPOINT */ + diff --git a/fs/Makefile b/fs/Makefile index f66b2ce7db0..2218aace6c7 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -59,7 +59,6 @@ include shm/Make.defs # Additional files required is mount-able file systems are supported -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) include mount/Make.defs @@ -79,7 +78,6 @@ include userfs/Make.defs include hostfs/Make.defs include littlefs/Make.defs -endif endif COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/fs/aio/aio.h b/fs/aio/aio.h index 73ff7faa79f..3ec406f3b83 100644 --- a/fs/aio/aio.h +++ b/fs/aio/aio.h @@ -63,24 +63,16 @@ # define CONFIG_FS_NAIOC 8 #endif -#undef AIO_HAVE_FILEP #undef AIO_HAVE_PSOCK -#if CONFIG_NFILE_DESCRIPTORS > 0 -# define AIO_HAVE_FILEP -#endif - #if defined(CONFIG_NET_TCP) && CONFIG_NSOCKET_DESCRIPTORS > 0 # define AIO_HAVE_PSOCK #endif -#if !defined(AIO_HAVE_FILEP) && !defined(AIO_HAVE_PSOCK) -# error AIO needs file and/or socket descriptors -#endif - /**************************************************************************** * Public Types ****************************************************************************/ + /* This structure contains one AIO control block and appends information * needed by the logic running on the worker thread. These structures are * pre-allocated, the number pre-allocated controlled by CONFIG_FS_NAIOC. @@ -93,9 +85,7 @@ struct aio_container_s FAR struct aiocb *aioc_aiocbp; /* The contained AIO control block */ union { -#ifdef AIO_HAVE_FILEP FAR struct file *aioc_filep; /* File structure to use with the I/O */ -#endif #ifdef AIO_HAVE_PSOCK FAR struct socket *aioc_psock; /* Socket structure to use with the I/O */ #endif diff --git a/fs/aio/aio_read.c b/fs/aio/aio_read.c index 319e51f5826..58ff62c9151 100644 --- a/fs/aio/aio_read.c +++ b/fs/aio/aio_read.c @@ -94,10 +94,9 @@ static void aio_read_worker(FAR void *arg) #endif aiocbp = aioc_decant(aioc); -#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK) +#ifdef AIO_HAVE_PSOCK if (aiocbp->aio_fildes < CONFIG_NFILE_DESCRIPTORS) #endif -#ifdef AIO_HAVE_FILEP { /* Perform the file read using: * @@ -110,11 +109,8 @@ static void aio_read_worker(FAR void *arg) nread = file_pread(aioc->u.aioc_filep, (FAR void *)aiocbp->aio_buf, aiocbp->aio_nbytes, aiocbp->aio_offset); } -#endif -#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK) - else -#endif #ifdef AIO_HAVE_PSOCK + else { /* Perform the socket receive using: * diff --git a/fs/aio/aio_write.c b/fs/aio/aio_write.c index e92b4c3d2ef..c984da6dea8 100644 --- a/fs/aio/aio_write.c +++ b/fs/aio/aio_write.c @@ -81,9 +81,7 @@ static void aio_write_worker(FAR void *arg) uint8_t prio; #endif ssize_t nwritten = 0; -#ifdef AIO_HAVE_FILEP int oflags; -#endif /* Get the information from the container, decant the AIO control block, * and free the container before starting any I/O. That will minimize @@ -97,10 +95,9 @@ static void aio_write_worker(FAR void *arg) #endif aiocbp = aioc_decant(aioc); -#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK) +#ifdef AIO_HAVE_PSOCK if (aiocbp->aio_fildes < CONFIG_NFILE_DESCRIPTORS) #endif -#ifdef AIO_HAVE_FILEP { /* Call fcntl(F_GETFL) to get the file open mode. */ @@ -138,11 +135,8 @@ static void aio_write_worker(FAR void *arg) aiocbp->aio_offset); } } -#endif -#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK) - else -#endif #ifdef AIO_HAVE_PSOCK + else { /* Perform the send using: * @@ -166,9 +160,7 @@ static void aio_write_worker(FAR void *arg) aiocbp->aio_result = nwritten; -#ifdef AIO_HAVE_FILEP errout: -#endif /* Signal the client */ diff --git a/fs/aio/aioc_contain.c b/fs/aio/aioc_contain.c index ee8f18a6831..7a5d0f38dd1 100644 --- a/fs/aio/aioc_contain.c +++ b/fs/aio/aioc_contain.c @@ -76,10 +76,8 @@ FAR struct aio_container_s *aio_contain(FAR struct aiocb *aiocbp) FAR struct aio_container_s *aioc; union { -#ifdef AIO_HAVE_FILEP FAR struct file *filep; -#endif -#ifdef AIO_HAVE_FILEP +#ifdef AIO_HAVE_PSOCK FAR struct socket *psock; #endif FAR void *ptr; @@ -89,10 +87,9 @@ FAR struct aio_container_s *aio_contain(FAR struct aiocb *aiocbp) #endif int ret; -#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK) +#ifdef AIO_HAVE_PSOCK if (aiocbp->aio_fildes < CONFIG_NFILE_DESCRIPTORS) #endif -#ifdef AIO_HAVE_FILEP { /* Get the file structure corresponding to the file descriptor. */ @@ -104,11 +101,8 @@ FAR struct aio_container_s *aio_contain(FAR struct aiocb *aiocbp) DEBUGASSERT(u.filep != NULL); } -#endif -#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK) - else -#endif #ifdef AIO_HAVE_PSOCK + else { /* Get the socket structure corresponding to the socket descriptor */ diff --git a/fs/dirent/Make.defs b/fs/dirent/Make.defs index f955b3bff1e..adfba6202be 100644 --- a/fs/dirent/Make.defs +++ b/fs/dirent/Make.defs @@ -33,14 +33,10 @@ # ############################################################################ -# Don't build anything if there are no file descriptors - -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) - CSRCS += fs_closedir.c fs_opendir.c fs_readdir.c fs_rewinddir.c fs_seekdir.c # Include dirent build support DEPPATH += --dep-path dirent VPATH += :dirent -endif + diff --git a/fs/driver/Make.defs b/fs/driver/Make.defs index 46890334c4a..b9f23af2780 100644 --- a/fs/driver/Make.defs +++ b/fs/driver/Make.defs @@ -33,10 +33,6 @@ # ############################################################################ -# Don't build anything if there are no file descriptors - -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) - CSRCS += fs_registerdriver.c fs_unregisterdriver.c # Don't build-in block driver support if there are no mountpoints @@ -63,4 +59,3 @@ endif # CONFIG_DISABLE_MOUNTPOINT DEPPATH += --dep-path driver VPATH += :driver -endif diff --git a/fs/inode/Make.defs b/fs/inode/Make.defs index 57fc04800f1..f72c911cb48 100644 --- a/fs/inode/Make.defs +++ b/fs/inode/Make.defs @@ -33,10 +33,6 @@ # ############################################################################ -# Don't build anything if there are no file descriptors - -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) - CSRCS += fs_files.c fs_foreachinode.c fs_inode.c fs_inodeaddref.c CSRCS += fs_inodebasename.c fs_inodefind.c fs_inodefree.c fs_inoderelease.c CSRCS += fs_inoderemove.c fs_inodereserve.c fs_inodesearch.c @@ -46,4 +42,4 @@ CSRCS += fs_fileopen.c fs_filedetach.c fs_fileclose.c DEPPATH += --dep-path inode VPATH += :inode -endif + diff --git a/fs/inode/fs_filedetach.c b/fs/inode/fs_filedetach.c index c02aa8ea7db..ff71d5f2d9f 100644 --- a/fs/inode/fs_filedetach.c +++ b/fs/inode/fs_filedetach.c @@ -109,7 +109,6 @@ static inline void _files_semtake(FAR struct filelist *list) * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_detach(int fd, FAR struct file *filep) { FAR struct filelist *list; @@ -165,5 +164,4 @@ int file_detach(int fd, FAR struct file *filep) _files_semgive(list); return OK; } -#endif diff --git a/fs/mount/Make.defs b/fs/mount/Make.defs index b26511e0533..e03f2c0d08b 100644 --- a/fs/mount/Make.defs +++ b/fs/mount/Make.defs @@ -33,9 +33,8 @@ # ############################################################################ -# Don't build anything if there are no file descriptors +# Don't build anything if there is no mountpoint support -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) CSRCS += fs_mount.c fs_umount2.c fs_foreachmountpoint.c @@ -56,4 +55,4 @@ DEPPATH += --dep-path mount VPATH += :mount endif -endif + diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index 28d980fcd3e..78e64bce7f4 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -1049,9 +1049,7 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile, size_t buflen, off_t offset) { FAR struct task_group_s *group = tcb->group; -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Guaranteed to be true */ FAR struct file *file; -#endif #if CONFIG_NSOCKET_DESCRIPTORS > 0 FAR struct socket *socket; #endif @@ -1066,7 +1064,6 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile, remaining = buflen; totalsize = 0; -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Guaranteed to be true */ linesize = snprintf(procfile->line, STATUS_LINELEN, "\n%-3s %-8s %s\n", "FD", "POS", "OFLAGS"); copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset); @@ -1082,7 +1079,9 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile, /* Examine each open file descriptor */ - for (i = 0, file = group->tg_filelist.fl_files; i < CONFIG_NFILE_DESCRIPTORS; i++, file++) + for (i = 0, file = group->tg_filelist.fl_files; + i < CONFIG_NFILE_DESCRIPTORS; + i++, file++) { /* Is there an inode associated with the file descriptor? */ @@ -1102,7 +1101,6 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile, } } } -#endif #if CONFIG_NSOCKET_DESCRIPTORS > 0 linesize = snprintf(procfile->line, STATUS_LINELEN, "\n%-3s %-2s %-3s %s\n", diff --git a/fs/vfs/Make.defs b/fs/vfs/Make.defs index a306b9297b8..ced07db1c82 100644 --- a/fs/vfs/Make.defs +++ b/fs/vfs/Make.defs @@ -33,42 +33,6 @@ # ############################################################################ -# If there are no file descriptors configured, then a small part of the -# logic in this directory may still apply to socket descriptors - -ifeq ($(CONFIG_NFILE_DESCRIPTORS),0) -ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0) - -# Socket descriptor support - -CSRCS += fs_close.c fs_read.c fs_write.c fs_ioctl.c - -# Support for network access using streams - -ifneq ($(CONFIG_NFILE_STREAMS),0) -CSRCS += fs_fdopen.c -endif - -# Support for poll() and select() (which derives from poll() - -ifneq ($(CONFIG_DISABLE_POLL),y) -CSRCS += fs_poll.c fs_select.c -endif - -# Support for sendfile() - -ifeq ($(CONFIG_NET_SENDFILE),y) -CSRCS += fs_sendfile.c -endif - -# Include vfs build support - -DEPPATH += --dep-path vfs -VPATH += :vfs -endif - -else - # Common file/socket descriptor support CSRCS += fs_close.c fs_dup.c fs_dup2.c fs_fcntl.c fs_dupfd.c fs_dupfd2.c @@ -106,4 +70,3 @@ endif DEPPATH += --dep-path vfs VPATH += :vfs -endif diff --git a/fs/vfs/fs_close.c b/fs/vfs/fs_close.c index 800e4ad1d93..f029c08add2 100644 --- a/fs/vfs/fs_close.c +++ b/fs/vfs/fs_close.c @@ -82,24 +82,20 @@ int close(int fd) { int errcode; -#if CONFIG_NFILE_DESCRIPTORS > 0 int ret; -#endif /* close() is a cancellation point */ (void)enter_cancellation_point(); -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Did we get a valid file descriptor? */ if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) -#endif { /* Close a socket descriptor */ #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 - if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS)) + if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)) { ret = net_close(fd); if (ret < 0) @@ -119,7 +115,6 @@ int close(int fd) } } -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Close the driver or mountpoint. NOTES: (1) there is no * exclusion mechanism here, the driver or mountpoint must be * able to handle concurrent operations internally, (2) The driver @@ -142,8 +137,6 @@ int close(int fd) leave_cancellation_point(); return OK; -#endif - errout: set_errno(errcode); leave_cancellation_point(); diff --git a/fs/vfs/fs_dup.c b/fs/vfs/fs_dup.c index 3358e482310..db63e830ed6 100644 --- a/fs/vfs/fs_dup.c +++ b/fs/vfs/fs_dup.c @@ -65,7 +65,6 @@ int dup(int fd) /* Check the range of the descriptor to see if we got a file or a socket * descriptor. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 if ((unsigned int)fd < CONFIG_NFILE_DESCRIPTORS) { /* Its a valid file descriptor.. dup the file descriptor using any @@ -76,12 +75,11 @@ int dup(int fd) ret = fs_dupfd(fd, 0); } else -#endif { /* Not a valid file descriptor. Did we get a valid socket descriptor? */ #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 - if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS)) + if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)) { /* Yes.. dup the socket descriptor. The errno value is not set. */ diff --git a/fs/vfs/fs_dup2.c b/fs/vfs/fs_dup2.c index 3d5d8a7b097..5225da9630e 100644 --- a/fs/vfs/fs_dup2.c +++ b/fs/vfs/fs_dup2.c @@ -1,7 +1,8 @@ /**************************************************************************** * fs/vfs/fs_dup2.c * - * Copyright (C) 2007-2009, 2011, 2013, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011, 2013, 2017 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,7 +51,7 @@ * performed. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 +#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 /**************************************************************************** * Public Functions @@ -77,7 +78,7 @@ int dup2(int fd1, int fd2) /* Not a valid file descriptor. Did we get a valid socket descriptor? */ - if ((unsigned int)fd1 < (CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS)) + if ((unsigned int)fd1 < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)) { /* Yes.. dup the socket descriptor. The errno value is not set. */ @@ -110,5 +111,5 @@ int dup2(int fd1, int fd2) } } -#endif /* CONFIG_NFILE_DESCRIPTORS > 0 ... */ +#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS > 0 */ diff --git a/fs/vfs/fs_dupfd.c b/fs/vfs/fs_dupfd.c index 2ea7deea379..7f40f8a1889 100644 --- a/fs/vfs/fs_dupfd.c +++ b/fs/vfs/fs_dupfd.c @@ -1,7 +1,8 @@ /**************************************************************************** * fs/vfs/fs_dupfd.c * - * Copyright (C) 2007-2009, 2011-2014, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2014, 2017 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,8 +48,6 @@ #include "inode/inode.h" -#if CONFIG_NFILE_DESCRIPTORS > 0 - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -147,5 +146,3 @@ errout: return ERROR; } -#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */ - diff --git a/fs/vfs/fs_dupfd2.c b/fs/vfs/fs_dupfd2.c index 1f4f983196a..bba880b689c 100644 --- a/fs/vfs/fs_dupfd2.c +++ b/fs/vfs/fs_dupfd2.c @@ -46,8 +46,6 @@ #include "inode/inode.h" -#if CONFIG_NFILE_DESCRIPTORS > 0 - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -133,5 +131,3 @@ errout: return ERROR; } -#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */ - diff --git a/fs/vfs/fs_fcntl.c b/fs/vfs/fs_fcntl.c index d75847d1cb9..37838cb9148 100644 --- a/fs/vfs/fs_fcntl.c +++ b/fs/vfs/fs_fcntl.c @@ -75,7 +75,6 @@ * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_vfcntl(FAR struct file *filep, int cmd, va_list ap) { int ret = -EINVAL; @@ -212,7 +211,6 @@ int file_vfcntl(FAR struct file *filep, int cmd, va_list ap) return ret; } -#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */ /**************************************************************************** * Name: file_fcntl @@ -233,7 +231,6 @@ int file_vfcntl(FAR struct file *filep, int cmd, va_list ap) * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_fcntl(FAR struct file *filep, int cmd, ...) { va_list ap; @@ -252,7 +249,6 @@ int file_fcntl(FAR struct file *filep, int cmd, ...) va_end(ap); return ret; } -#endif /**************************************************************************** * Name: fcntl @@ -289,7 +285,6 @@ int fcntl(int fd, int cmd, ...) /* Did we get a valid file descriptor? */ -#if CONFIG_NFILE_DESCRIPTORS > 0 if ((unsigned int)fd < CONFIG_NFILE_DESCRIPTORS) { /* Get the file structure corresponding to the file descriptor. */ @@ -307,12 +302,11 @@ int fcntl(int fd, int cmd, ...) } } else -#endif { /* No... check for operations on a socket descriptor */ #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 - if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS)) + if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)) { /* Yes.. defer socket descriptor operations to net_vfcntl(). The * errno is not set on failures. diff --git a/fs/vfs/fs_fdopen.c b/fs/vfs/fs_fdopen.c index 09154ec56fd..2382c755923 100644 --- a/fs/vfs/fs_fdopen.c +++ b/fs/vfs/fs_fdopen.c @@ -62,7 +62,6 @@ * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 static inline int fs_checkfd(FAR struct tcb_s *tcb, int fd, int oflags) { FAR struct file *filep; @@ -110,7 +109,6 @@ static inline int fs_checkfd(FAR struct tcb_s *tcb, int fd, int oflags) return OK; } -#endif /**************************************************************************** * Public Functions @@ -159,9 +157,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb) * lie in a different range. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) -#endif { /* No.. If networking is enabled then this might be a socket * descriptor. @@ -177,14 +173,14 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb) #endif } - /* The descriptor is in a valid range to file descriptor... perform some more checks */ + /* The descriptor is in a valid range to file descriptor... perform some + * more checks. + */ -#if CONFIG_NFILE_DESCRIPTORS > 0 else { ret = fs_checkfd(tcb, fd, oflags); } -#endif /* Do we have a good descriptor of some sort? */ diff --git a/fs/vfs/fs_ioctl.c b/fs/vfs/fs_ioctl.c index 63b32a514d9..887cd268b07 100644 --- a/fs/vfs/fs_ioctl.c +++ b/fs/vfs/fs_ioctl.c @@ -75,7 +75,6 @@ * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_ioctl(FAR struct file *filep, int req, unsigned long arg) { FAR struct inode *inode; @@ -101,7 +100,6 @@ int file_ioctl(FAR struct file *filep, int req, unsigned long arg) return (int)inode->u.i_ops->ioctl(filep, req, arg); } -#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */ /**************************************************************************** * Name: ioctl/fs_ioctl @@ -139,19 +137,17 @@ int ioctl(int fd, int req, unsigned long arg) #endif { int errcode; -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct file *filep; int ret; /* Did we get a valid file descriptor? */ if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) -#endif { /* Perform the socket ioctl */ #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 - if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS+CONFIG_NSOCKET_DESCRIPTORS)) + if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)) { ret = netdev_ioctl(fd, req, arg); if (ret < 0) @@ -170,7 +166,6 @@ int ioctl(int fd, int req, unsigned long arg) } } -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Get the file structure corresponding to the file descriptor. */ ret = fs_getfilep(fd, &filep); @@ -194,9 +189,6 @@ int ioctl(int fd, int req, unsigned long arg) } return ret; -#else - errcode = ENOTTY; -#endif errout: set_errno(errcode); diff --git a/fs/vfs/fs_lseek.c b/fs/vfs/fs_lseek.c index d1b8e314da9..6356ff31594 100644 --- a/fs/vfs/fs_lseek.c +++ b/fs/vfs/fs_lseek.c @@ -47,8 +47,6 @@ #include "inode/inode.h" -#if CONFIG_NFILE_DESCRIPTORS > 0 - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -194,4 +192,3 @@ errout: return (off_t)ERROR; } -#endif diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c index 18d67c524a7..d5469584219 100644 --- a/fs/vfs/fs_poll.c +++ b/fs/vfs/fs_poll.c @@ -98,7 +98,6 @@ static int poll_semtake(FAR sem_t *sem) * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 static int poll_fdsetup(int fd, FAR struct pollfd *fds, bool setup) { /* Check for a valid file descriptor */ @@ -121,7 +120,6 @@ static int poll_fdsetup(int fd, FAR struct pollfd *fds, bool setup) return fdesc_poll(fd, fds, setup); } -#endif /**************************************************************************** * Name: poll_setup @@ -131,7 +129,6 @@ static int poll_fdsetup(int fd, FAR struct pollfd *fds, bool setup) * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 static inline int poll_setup(FAR struct pollfd *fds, nfds_t nfds, sem_t *sem) { unsigned int i; @@ -227,7 +224,6 @@ static inline int poll_setup(FAR struct pollfd *fds, nfds_t nfds, sem_t *sem) return OK; } -#endif /**************************************************************************** * Name: poll_teardown @@ -238,9 +234,8 @@ static inline int poll_setup(FAR struct pollfd *fds, nfds_t nfds, sem_t *sem) * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 -static inline int poll_teardown(FAR struct pollfd *fds, nfds_t nfds, int *count, - int ret) +static inline int poll_teardown(FAR struct pollfd *fds, nfds_t nfds, + FAR int *count, int ret) { unsigned int i; int status = OK; @@ -299,7 +294,6 @@ static inline int poll_teardown(FAR struct pollfd *fds, nfds_t nfds, int *count, return ret; } -#endif /**************************************************************************** * Public Functions @@ -324,7 +318,6 @@ static inline int poll_teardown(FAR struct pollfd *fds, nfds_t nfds, int *count, * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) { FAR struct inode *inode; @@ -370,7 +363,6 @@ int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) return ret; } -#endif /**************************************************************************** * Name: fdesc_poll @@ -391,7 +383,6 @@ int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int fdesc_poll(int fd, FAR struct pollfd *fds, bool setup) { FAR struct file *filep; @@ -411,7 +402,6 @@ int fdesc_poll(int fd, FAR struct pollfd *fds, bool setup) return file_poll(filep, fds, setup); } -#endif /**************************************************************************** * Name: poll diff --git a/fs/vfs/fs_read.c b/fs/vfs/fs_read.c index 35bbede9255..2dcff0f3af7 100644 --- a/fs/vfs/fs_read.c +++ b/fs/vfs/fs_read.c @@ -140,9 +140,7 @@ ssize_t nx_read(int fd, FAR void *buf, size_t nbytes) { /* Did we get a valid file descriptor? */ -#if CONFIG_NFILE_DESCRIPTORS > 0 if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) -#endif { #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 /* No.. If networking is enabled, read() is the same as recv() with @@ -156,8 +154,6 @@ ssize_t nx_read(int fd, FAR void *buf, size_t nbytes) return -EBADF; #endif } - -#if CONFIG_NFILE_DESCRIPTORS > 0 else { FAR struct file *filep; @@ -178,11 +174,6 @@ ssize_t nx_read(int fd, FAR void *buf, size_t nbytes) return file_read(filep, buf, nbytes); } -#else - /* I don't think we can get here */ - - return -ENOSYS; -#endif } /**************************************************************************** diff --git a/fs/vfs/fs_sendfile.c b/fs/vfs/fs_sendfile.c index 9211f7ff136..87bd64da647 100644 --- a/fs/vfs/fs_sendfile.c +++ b/fs/vfs/fs_sendfile.c @@ -50,7 +50,7 @@ #include #include -#if CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NET_SENDFILE +#ifdef CONFIG_NET_SENDFILE /**************************************************************************** * Public Functions @@ -148,4 +148,5 @@ ssize_t sendfile(int outfd, int infd, off_t *offset, size_t count) return lib_sendfile(outfd, infd, offset, count); } -#endif /* CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NET_SENDFILE */ +#endif /* CONFIG_NET_SENDFILE */ + diff --git a/fs/vfs/fs_write.c b/fs/vfs/fs_write.c index 4d62cb0d984..724e691465c 100644 --- a/fs/vfs/fs_write.c +++ b/fs/vfs/fs_write.c @@ -137,9 +137,7 @@ ssize_t file_write(FAR struct file *filep, FAR const void *buf, size_t nbytes) ssize_t nx_write(int fd, FAR const void *buf, size_t nbytes) { -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct file *filep; -#endif ssize_t ret; if (buf == NULL) @@ -149,9 +147,7 @@ ssize_t nx_write(int fd, FAR const void *buf, size_t nbytes) /* Did we get a valid file descriptor? */ -#if CONFIG_NFILE_DESCRIPTORS > 0 if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS) -#endif { #if defined(CONFIG_NET_TCP) && CONFIG_NSOCKET_DESCRIPTORS > 0 /* Write to a socket descriptor is equivalent to send with flags == 0. */ @@ -161,8 +157,6 @@ ssize_t nx_write(int fd, FAR const void *buf, size_t nbytes) ret = -EBADF; #endif } - -#if CONFIG_NFILE_DESCRIPTORS > 0 else { /* The descriptor is in the right range to be a file descriptor.. @@ -180,7 +174,6 @@ ssize_t nx_write(int fd, FAR const void *buf, size_t nbytes) ret = file_write(filep, buf, nbytes); } } -#endif return ret; } diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h index c83f5682b52..48a8eedf8d2 100644 --- a/include/nuttx/fs/fs.h +++ b/include/nuttx/fs/fs.h @@ -425,13 +425,11 @@ struct file /* This defines a list of files indexed by the file descriptor */ -#if CONFIG_NFILE_DESCRIPTORS > 0 struct filelist { sem_t fl_sem; /* Manage access to the file list */ struct file fl_files[CONFIG_NFILE_DESCRIPTORS]; }; -#endif /* The following structure defines the list of files used for standard C I/O. * Note that NuttX can support the standard C APIs with or without buffering @@ -703,9 +701,7 @@ int inode_checkflags(FAR struct inode *inode, int oflags); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 void files_initlist(FAR struct filelist *list); -#endif /**************************************************************************** * Name: files_releaselist @@ -715,9 +711,7 @@ void files_initlist(FAR struct filelist *list); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 void files_releaselist(FAR struct filelist *list); -#endif /**************************************************************************** * Name: file_dup2 @@ -736,9 +730,7 @@ void files_releaselist(FAR struct filelist *list); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_dup2(FAR struct file *filep1, FAR struct file *filep2); -#endif /**************************************************************************** * Name: fs_dupfd OR dup @@ -760,9 +752,7 @@ int file_dup2(FAR struct file *filep1, FAR struct file *filep2); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int fs_dupfd(int fd, int minfd); -#endif /**************************************************************************** * Name: file_dup @@ -799,13 +789,11 @@ int file_dup(FAR struct file *filep, int minfd); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 int fs_dupfd2(int fd1, int fd2); #else # define fs_dupfd2(fd1, fd2) dup2(fd1, fd2) #endif -#endif /**************************************************************************** * Name: file_open @@ -854,9 +842,7 @@ int file_open(FAR struct file *filep, FAR const char *path, int oflags, ...); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_detach(int fd, FAR struct file *filep); -#endif /**************************************************************************** * Name: file_close @@ -900,10 +886,8 @@ int file_close(FAR struct file *filep); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int open_blockdriver(FAR const char *pathname, int mountflags, FAR struct inode **ppinode); -#endif /**************************************************************************** * Name: close_blockdriver @@ -922,9 +906,7 @@ int open_blockdriver(FAR const char *pathname, int mountflags, * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int close_blockdriver(FAR struct inode *inode); -#endif /**************************************************************************** * Name: fs_ioctl @@ -1016,9 +998,7 @@ ssize_t lib_sendfile(int outfd, int infd, off_t *offset, size_t count); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int fs_getfilep(int fd, FAR struct file **filep); -#endif /**************************************************************************** * Name: nx_open and nx_vopen @@ -1065,9 +1045,7 @@ int nx_open(FAR const char *path, int oflags, ...); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 ssize_t file_read(FAR struct file *filep, FAR void *buf, size_t nbytes); -#endif /**************************************************************************** * Name: nx_read @@ -1102,9 +1080,7 @@ ssize_t nx_read(int fd, FAR void *buf, size_t nbytes); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 ssize_t file_write(FAR struct file *filep, FAR const void *buf, size_t nbytes); -#endif /**************************************************************************** * Name: nx_write @@ -1143,10 +1119,8 @@ ssize_t nx_write(int fd, FAR const void *buf, size_t nbytes); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 ssize_t file_pread(FAR struct file *filep, FAR void *buf, size_t nbytes, off_t offset); -#endif /**************************************************************************** * Name: file_pwrite @@ -1158,10 +1132,8 @@ ssize_t file_pread(FAR struct file *filep, FAR void *buf, size_t nbytes, * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 ssize_t file_pwrite(FAR struct file *filep, FAR const void *buf, size_t nbytes, off_t offset); -#endif /**************************************************************************** * Name: file_seek @@ -1173,9 +1145,7 @@ ssize_t file_pwrite(FAR struct file *filep, FAR const void *buf, * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 off_t file_seek(FAR struct file *filep, off_t offset, int whence); -#endif /**************************************************************************** * Name: file_fsync @@ -1187,7 +1157,7 @@ off_t file_seek(FAR struct file *filep, off_t offset, int whence); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) +#ifndef CONFIG_DISABLE_MOUNTPOINT int file_fsync(FAR struct file *filep); #endif @@ -1201,7 +1171,7 @@ int file_fsync(FAR struct file *filep); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) +#ifndef CONFIG_DISABLE_MOUNTPOINT int file_truncate(FAR struct file *filep, off_t length); #endif @@ -1223,9 +1193,7 @@ int file_truncate(FAR struct file *filep, off_t length); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_ioctl(FAR struct file *filep, int req, unsigned long arg); -#endif /**************************************************************************** * Name: file_vfcntl @@ -1246,9 +1214,7 @@ int file_ioctl(FAR struct file *filep, int req, unsigned long arg); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_vfcntl(FAR struct file *filep, int cmd, va_list ap); -#endif /**************************************************************************** * Name: file_fcntl @@ -1269,9 +1235,7 @@ int file_vfcntl(FAR struct file *filep, int cmd, va_list ap); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_fcntl(FAR struct file *filep, int cmd, ...); -#endif /**************************************************************************** * Name: file_poll @@ -1292,9 +1256,7 @@ int file_fcntl(FAR struct file *filep, int cmd, ...); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup); -#endif /**************************************************************************** * Name: file_fstat @@ -1319,9 +1281,7 @@ int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int file_fstat(FAR struct file *filep, FAR struct stat *buf); -#endif /**************************************************************************** * Name: fdesc_poll @@ -1341,9 +1301,7 @@ int file_fstat(FAR struct file *filep, FAR struct stat *buf); * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int fdesc_poll(int fd, FAR struct pollfd *fds, bool setup); -#endif #undef EXTERN #if defined(__cplusplus) diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h index 93358a28786..8da91fbbf8f 100644 --- a/include/nuttx/net/net.h +++ b/include/nuttx/net/net.h @@ -97,11 +97,7 @@ * socket descriptors */ -#ifdef CONFIG_NFILE_DESCRIPTORS -# define __SOCKFD_OFFSET CONFIG_NFILE_DESCRIPTORS -#else -# define __SOCKFD_OFFSET 0 -#endif +#define __SOCKFD_OFFSET CONFIG_NFILE_DESCRIPTORS /* Capabilities of a socket */ diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h index dbbee3811e9..fddd931826c 100644 --- a/include/nuttx/sched.h +++ b/include/nuttx/sched.h @@ -66,7 +66,6 @@ /* Configuration ****************************************************************/ /* Task groups currently only supported for retention of child status */ -#undef HAVE_TASK_GROUP #undef HAVE_GROUP_MEMBERS /* We need a group an group members if we are supporting the parent/child @@ -74,41 +73,7 @@ */ #if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS) -# define HAVE_TASK_GROUP 1 # define HAVE_GROUP_MEMBERS 1 - -/* We need a group (but not members) if any other resources are shared within - * a task group. NOTE: that we essentially always need a task group and that - * managing this definition adds a lot of overhead just to handle a corner- - * case very minimal system! - */ - -#else -# if !defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SCHED_HAVE_PARENT) -# define HAVE_TASK_GROUP 1 /* pthreads with parent*/ -# elif !defined(CONFIG_DISABLE_ENVIRON) -# define HAVE_TASK_GROUP 1 /* Environment variables */ -# elif !defined(CONFIG_DISABLE_SIGNALS) -# define HAVE_TASK_GROUP 1 /* Signals */ -# elif defined(CONFIG_SCHED_ATEXIT) -# define HAVE_TASK_GROUP 1 /* Group atexit() function */ -# elif defined(CONFIG_SCHED_ONEXIT) -# define HAVE_TASK_GROUP 1 /* Group on_exit() function */ -# elif defined(CONFIG_SCHED_WAITPID) -# define HAVE_TASK_GROUP 1 /* Group waitpid() function */ -# elif CONFIG_NFILE_DESCRIPTORS > 0 -# define HAVE_TASK_GROUP 1 /* File descriptors */ -# elif CONFIG_NFILE_STREAMS > 0 -# define HAVE_TASK_GROUP 1 /* Standard C buffered I/O */ -# elif CONFIG_NSOCKET_DESCRIPTORS > 0 -# define HAVE_TASK_GROUP 1 /* Sockets */ -# elif !defined(CONFIG_DISABLE_MQUEUE) -# define HAVE_TASK_GROUP 1 /* Message queues */ -# elif defined(CONFIG_ARCH_ADDRENV) -# define HAVE_TASK_GROUP 1 /* Address environment */ -# elif defined(CONFIG_MM_SHM) -# define HAVE_TASK_GROUP 1 /* Shared memory */ -# endif #endif /* In any event, we don't need group members if support for pthreads is disabled */ @@ -440,8 +405,6 @@ struct dspace_s * is free. */ -#ifdef HAVE_TASK_GROUP - #ifndef CONFIG_DISABLE_PTHREAD struct join_s; /* Forward reference */ /* Defined in sched/pthread/pthread.h */ @@ -562,11 +525,9 @@ struct task_group_s * life of the PIC data is managed. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 /* File descriptors ***********************************************************/ struct filelist tg_filelist; /* Maps file descriptor to file */ -#endif #if CONFIG_NFILE_STREAMS > 0 /* FILE streams ***************************************************************/ @@ -607,7 +568,6 @@ struct task_group_s struct group_shm_s tg_shm; /* Task shared memory logic */ #endif }; -#endif /* struct tcb_s ******************************************************************/ /* This is the common part of the task control block (TCB). The TCB is the heart @@ -626,9 +586,7 @@ struct tcb_s /* Task Group *****************************************************************/ -#ifdef HAVE_TASK_GROUP FAR struct task_group_s *group; /* Pointer to shared task group data */ -#endif /* Task Management Fields *****************************************************/ @@ -863,12 +821,10 @@ FAR struct tcb_s *sched_gettcb(pid_t pid); * currently executing task. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 FAR struct filelist *sched_getfiles(void); #if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *sched_getstreams(void); #endif /* CONFIG_NFILE_STREAMS */ -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if CONFIG_NSOCKET_DESCRIPTORS > 0 FAR struct socketlist *sched_getsockets(void); diff --git a/include/sys/select.h b/include/sys/select.h index 3eb30aea952..ba3b2551ee1 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -46,8 +46,6 @@ #include #include -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -133,5 +131,4 @@ int pselect(int nfds, FAR fd_set *readfds, FAR fd_set *writefds, } #endif -#endif /* CONFIG_NFILE_DESCRIPTORS || CONFIG_NSOCKET_DESCRIPTORS */ #endif /* __INCLUDE_SYS_SELECT_H */ diff --git a/include/sys/syscall.h b/include/sys/syscall.h index 8c0f911911b..b9d0a9c4529 100644 --- a/include/sys/syscall.h +++ b/include/sys/syscall.h @@ -275,54 +275,56 @@ # define CONFIG_NSOCKET_DESCRIPTORS 0 #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 -# define SYS_close (__SYS_descriptors + 0) -# ifdef CONFIG_LIBC_IOCTL_VARIADIC -# define SYS_fs_ioctl (__SYS_descriptors + 1) +#define SYS_close (__SYS_descriptors + 0) + +#ifdef CONFIG_LIBC_IOCTL_VARIADIC +# define SYS_fs_ioctl (__SYS_descriptors + 1) +#else +# define SYS_ioctl (__SYS_descriptors + 1) +#endif + +#define SYS_read (__SYS_descriptors + 2) +#define SYS_write (__SYS_descriptors + 3) +#define SYS_pread (__SYS_descriptors + 4) +#define SYS_pwrite (__SYS_descriptors + 5) + +#ifdef CONFIG_FS_AIO +# define SYS_aio_read (__SYS_descriptors + 6) +# define SYS_aio_write (__SYS_descriptors + 7) +# define SYS_aio_fsync (__SYS_descriptors + 8) +# define SYS_aio_cancel (__SYS_descriptors + 9) +# define __SYS_poll (__SYS_descriptors + 10) +#else +# define __SYS_poll (__SYS_descriptors + 6) +#endif + +#ifndef CONFIG_DISABLE_POLL +# define SYS_poll __SYS_poll +# define SYS_select (__SYS_poll + 1) +# ifndef CONFIG_DISABLE_SIGNALS +# define SYS_ppoll (__SYS_poll + 2) +# define SYS_pselect (__SYS_poll + 3) +# define __SYS_ifindex (__SYS_poll + 4) # else -# define SYS_ioctl (__SYS_descriptors + 1) -# endif -# define SYS_read (__SYS_descriptors + 2) -# define SYS_write (__SYS_descriptors + 3) -# define SYS_pread (__SYS_descriptors + 4) -# define SYS_pwrite (__SYS_descriptors + 5) -# ifdef CONFIG_FS_AIO -# define SYS_aio_read (__SYS_descriptors + 6) -# define SYS_aio_write (__SYS_descriptors + 7) -# define SYS_aio_fsync (__SYS_descriptors + 8) -# define SYS_aio_cancel (__SYS_descriptors + 9) -# define __SYS_poll (__SYS_descriptors + 10) -# else -# define __SYS_poll (__SYS_descriptors + 6) -# endif -# ifndef CONFIG_DISABLE_POLL -# define SYS_poll __SYS_poll -# define SYS_select (__SYS_poll + 1) -# ifndef CONFIG_DISABLE_SIGNALS -# define SYS_ppoll (__SYS_poll + 2) -# define SYS_pselect (__SYS_poll + 3) -# define __SYS_ifindex (__SYS_poll + 4) -# else -# define __SYS_ifindex (__SYS_poll + 2) -# endif -# else -# define __SYS_ifindex __SYS_poll -# endif -# ifdef CONFIG_NETDEV_IFINDEX -# define SYS_if_indextoname __SYS_ifindex -# define SYS_if_nametoindex (__SYS_ifindex + 1) -# define __SYS_termios (__SYS_ifindex + 2) -# else -# define __SYS_termios __SYS_ifindex -# endif -# ifdef CONFIG_SERIAL_TERMIOS -# define SYS_tcdrain __SYS_termios -# define __SYS_boardctl (__SYS_termios + 1) -# else -# define __SYS_boardctl __SYS_termios +# define __SYS_ifindex (__SYS_poll + 2) # endif #else -# define __SYS_boardctl __SYS_descriptors +# define __SYS_ifindex __SYS_poll +#endif + +#ifdef CONFIG_NETDEV_IFINDEX +# define SYS_if_indextoname __SYS_ifindex +# define SYS_if_nametoindex (__SYS_ifindex + 1) +# define __SYS_termios (__SYS_ifindex + 2) +#else +# define __SYS_termios __SYS_ifindex +#endif + +#ifdef CONFIG_SERIAL_TERMIOS +# define SYS_tcdrain __SYS_termios +# define __SYS_boardctl (__SYS_termios + 1) +#else +# define __SYS_boardctl __SYS_termios #endif /* Board support */ @@ -336,79 +338,74 @@ /* The following are defined if file descriptors are enabled */ -#if CONFIG_NFILE_DESCRIPTORS > 0 -# define SYS_closedir (__SYS_filedesc + 0) -# define SYS_dup (__SYS_filedesc + 1) -# define SYS_dup2 (__SYS_filedesc + 2) -# define SYS_fcntl (__SYS_filedesc + 3) -# define SYS_lseek (__SYS_filedesc + 4) -# define SYS_mmap (__SYS_filedesc + 5) -# define SYS_open (__SYS_filedesc + 6) -# define SYS_opendir (__SYS_filedesc + 7) -# define SYS_readdir (__SYS_filedesc + 8) -# define SYS_rewinddir (__SYS_filedesc + 9) -# define SYS_seekdir (__SYS_filedesc + 10) -# define SYS_stat (__SYS_filedesc + 11) -# define SYS_fstat (__SYS_filedesc + 12) -# define SYS_statfs (__SYS_filedesc + 13) -# define SYS_fstatfs (__SYS_filedesc + 14) -# define SYS_telldir (__SYS_filedesc + 15) - -# if defined(CONFIG_PSEUDOFS_SOFTLINKS) -# define SYS_link (__SYS_filedesc + 16) -# define SYS_readlink (__SYS_filedesc + 17) -# define __SYS_pipes (__SYS_filedesc + 18) -# else -# define __SYS_pipes (__SYS_filedesc + 16) -# endif - -# if defined(CONFIG_PIPES) && CONFIG_DEV_PIPE_SIZE > 0 -# define SYS_pipe2 (__SYS_pipes + 0) -# define __SYS_mkfifo2 (__SYS_pipes + 1) -# else -# define __SYS_mkfifo2 (__SYS_pipes + 0) -# endif - -# if defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0 -# define SYS_mkfifo2 (__SYS_mkfifo2 + 0) -# define __SYS_fs_fdopen (__SYS_mkfifo2 + 1) -# else -# define __SYS_fs_fdopen (__SYS_mkfifo2 + 0) -# endif - -# if CONFIG_NFILE_STREAMS > 0 -# define SYS_fs_fdopen (__SYS_fs_fdopen + 0) -# define SYS_sched_getstreams (__SYS_fs_fdopen + 1) -# define __SYS_sendfile (__SYS_fs_fdopen + 2) -# else -# define __SYS_sendfile (__SYS_fs_fdopen + 0) -# endif - -# if defined(CONFIG_NET_SENDFILE) -# define SYS_sendfile, __SYS_sendfile -# define __SYS_mountpoint (__SYS_sendfile + 1) -# else -# define __SYS_mountpoint __SYS_sendfile -# endif - -# if !defined(CONFIG_DISABLE_MOUNTPOINT) -# if defined(CONFIG_FS_READABLE) -# define SYS_mount (__SYS_mountpoint + 0) -# endif -# define SYS_fsync (__SYS_mountpoint + 1) -# define SYS_ftruncate (__SYS_mountpoint + 2) -# define SYS_mkdir (__SYS_mountpoint + 3) -# define SYS_rename (__SYS_mountpoint + 4) -# define SYS_rmdir (__SYS_mountpoint + 5) -# define SYS_umount2 (__SYS_mountpoint + 6) -# define SYS_unlink (__SYS_mountpoint + 7) -# define __SYS_shm (__SYS_mountpoint + 8) -# else -# define __SYS_shm __SYS_mountpoint -# endif +#define SYS_closedir (__SYS_filedesc + 0) +#define SYS_dup (__SYS_filedesc + 1) +#define SYS_dup2 (__SYS_filedesc + 2) +#define SYS_fcntl (__SYS_filedesc + 3) +#define SYS_lseek (__SYS_filedesc + 4) +#define SYS_mmap (__SYS_filedesc + 5) +#define SYS_open (__SYS_filedesc + 6) +#define SYS_opendir (__SYS_filedesc + 7) +#define SYS_readdir (__SYS_filedesc + 8) +#define SYS_rewinddir (__SYS_filedesc + 9) +#define SYS_seekdir (__SYS_filedesc + 10) +#define SYS_stat (__SYS_filedesc + 11) +#define SYS_fstat (__SYS_filedesc + 12) +#define SYS_statfs (__SYS_filedesc + 13) +#define SYS_fstatfs (__SYS_filedesc + 14) +#define SYS_telldir (__SYS_filedesc + 15) +#if defined(CONFIG_PSEUDOFS_SOFTLINKS) +# define SYS_link (__SYS_filedesc + 16) +# define SYS_readlink (__SYS_filedesc + 17) +# define __SYS_pipes (__SYS_filedesc + 18) #else -# define __SYS_shm __SYS_filedesc +# define __SYS_pipes (__SYS_filedesc + 16) +#endif + +#if defined(CONFIG_PIPES) && CONFIG_DEV_PIPE_SIZE > 0 +# define SYS_pipe2 (__SYS_pipes + 0) +# define __SYS_mkfifo2 (__SYS_pipes + 1) +#else +# define __SYS_mkfifo2 (__SYS_pipes + 0) +#endif + +#if defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0 +# define SYS_mkfifo2 (__SYS_mkfifo2 + 0) +# define __SYS_fs_fdopen (__SYS_mkfifo2 + 1) +#else +# define __SYS_fs_fdopen (__SYS_mkfifo2 + 0) +#endif + +#if CONFIG_NFILE_STREAMS > 0 +# define SYS_fs_fdopen (__SYS_fs_fdopen + 0) +# define SYS_sched_getstreams (__SYS_fs_fdopen + 1) +# define __SYS_sendfile (__SYS_fs_fdopen + 2) +#else +# define __SYS_sendfile (__SYS_fs_fdopen + 0) +#endif + +#if defined(CONFIG_NET_SENDFILE) +# define SYS_sendfile, __SYS_sendfile +# define __SYS_mountpoint (__SYS_sendfile + 1) +#else +# define __SYS_mountpoint __SYS_sendfile +#endif + +#if !defined(CONFIG_DISABLE_MOUNTPOINT) +#if defined(CONFIG_FS_READABLE) +# define SYS_mount (__SYS_mountpoint + 0) +#endif +# define SYS_fsync (__SYS_mountpoint + 1) +# define SYS_ftruncate (__SYS_mountpoint + 2) +# define SYS_mkdir (__SYS_mountpoint + 3) +# define SYS_rename (__SYS_mountpoint + 4) +# define SYS_rmdir (__SYS_mountpoint + 5) +# define SYS_umount2 (__SYS_mountpoint + 6) +# define SYS_unlink (__SYS_mountpoint + 7) +# define __SYS_shm (__SYS_mountpoint + 8) +#else +# define __SYS_shm __SYS_mountpoint #endif /* Shared memory interfaces */ diff --git a/libs/libc/dirent/Make.defs b/libs/libc/dirent/Make.defs index 7a36badd87f..96c09d4203f 100644 --- a/libs/libc/dirent/Make.defs +++ b/libs/libc/dirent/Make.defs @@ -33,8 +33,6 @@ # ############################################################################ -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) - # Add the dirent C files to the build CSRCS += lib_readdirr.c lib_telldir.c @@ -44,5 +42,3 @@ CSRCS += lib_readdirr.c lib_telldir.c DEPPATH += --dep-path dirent VPATH += :dirent -endif - diff --git a/libs/libc/libc.csv b/libs/libc/libc.csv index fdbfa5adeec..beb76079d1f 100644 --- a/libs/libc/libc.csv +++ b/libs/libc/libc.csv @@ -13,9 +13,9 @@ "b16sin","fixedmath.h","","b16_t","b16_t" "b16sqr","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","b16_t","b16_t" "basename","libgen.h","","FAR char","FAR char *" -"cfgetspeed","termios.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SERIAL_TERMIOS)","speed_t","FAR const struct termios *" -"cfsetspeed","termios.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SERIAL_TERMIOS)","int","FAR struct termios *","speed_t" -"chdir","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char *" +"cfgetspeed","termios.h","defined(CONFIG_SERIAL_TERMIOS)","speed_t","FAR const struct termios *" +"cfsetspeed","termios.h","defined(CONFIG_SERIAL_TERMIOS)","int","FAR struct termios *","speed_t" +"chdir","unistd.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char *" "clock","time.h","","clock_t" "crc32","crc32.h","","uint32_t","FAR const uint8_t *","size_t" "crc32part","crc32.h","","uint32_t","FAR const uint8_t *","size_t","uint32_t" @@ -29,30 +29,30 @@ "dq_remlast","queue.h","","FAR dq_entry_t","dq_queue_t *" "_err","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_ERROR)","int","FAR const char *","..." "ether_ntoa","netinet/ether.h","","FAR char","FAR const struct ether_addr *" -"fclose","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR FILE *" -"fdopen","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","FAR FILE","int","FAR const char *" -"fflush","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR FILE *" +"fclose","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *" +"fdopen","stdio.h","CONFIG_NFILE_STREAMS > 0","FAR FILE","int","FAR const char *" +"fflush","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *" "ffs","strings.h","","int","int" -"fgetc","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR FILE *" -"fgetpos","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR fpos_t *" -"fgets","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","FAR char","FAR char *","int","FAR FILE *" +"fgetc","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *" +"fgetpos","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR fpos_t *" +"fgets","stdio.h","CONFIG_NFILE_STREAMS > 0","FAR char","FAR char *","int","FAR FILE *" "fileno","stdio.h","","int","FAR FILE *" -"fopen","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","FAR FILE","FAR const char *","FAR const char *" -"fprintf","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR const char *","..." -"fputc","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","int c","FAR FILE *" -"fputs","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR const char *","FAR FILE *" -"fread","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","size_t","FAR void *","size_t","size_t","FAR FILE *" -"fseek","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","long int","int" -"fsetpos","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR fpos_t *" -"ftell","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","long","FAR FILE *" -"fwrite","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","size_t","FAR const void *","size_t","size_t","FAR FILE *" -"getcwd","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_ENVIRON)","FAR char","FAR char *","size_t" +"fopen","stdio.h","CONFIG_NFILE_STREAMS > 0","FAR FILE","FAR const char *","FAR const char *" +"fprintf","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR const char *","..." +"fputc","stdio.h","CONFIG_NFILE_STREAMS > 0","int","int c","FAR FILE *" +"fputs","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR const char *","FAR FILE *" +"fread","stdio.h","CONFIG_NFILE_STREAMS > 0","size_t","FAR void *","size_t","size_t","FAR FILE *" +"fseek","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","long int","int" +"fsetpos","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR fpos_t *" +"ftell","stdio.h","CONFIG_NFILE_STREAMS > 0","long","FAR FILE *" +"fwrite","stdio.h","CONFIG_NFILE_STREAMS > 0","size_t","FAR const void *","size_t","size_t","FAR FILE *" +"getcwd","unistd.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char","FAR char *","size_t" "gethostname","unistd.h","","int","FAR char*","size_t" "getopt","unistd.h","","int","int","FAR char *const[]","FAR const char *" "getoptargp","unistd.h","","FAR char *" "getoptindp","unistd.h","","int" "getoptoptp","unistd.h","","int" -"gets","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","FAR char","FAR char *" +"gets","stdio.h","CONFIG_NFILE_STREAMS > 0","FAR char","FAR char *" "gmtime","time.h","","struct tm","FAR const time_t *" "gmtime_r","time.h","","FAR struct tm","FAR const time_t *","FAR struct tm *" "htonl","arpa/inet.h","","uint32_t","uint32_t" @@ -89,12 +89,12 @@ "memcpy","string.h","","FAR void","FAR void *","FAR const void *","size_t" "memmove","string.h","","FAR void","FAR void *","FAR const void *","size_t" "memset","string.h","","FAR void","FAR void *","int c","size_t" -"mkfifo","sys/stat.h","CONFIG_NFILE_DESCRIPTORS > 0","int","FAR const char*","mode_t" +"mkfifo","sys/stat.h","","int","FAR const char*","mode_t" "mktime","time.h","","time_t","FAR const struct tm *" "ntohl","arpa/inet.h","","uint32_t","uint32_t" "ntohs","arpa/inet.h","","uint16_t","uint16_t" -"perror","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","void","FAR const char *" -"pipe","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int [2]|int*" +"perror","stdio.h","CONFIG_NFILE_STREAMS > 0","void","FAR const char *" +"pipe","unistd.h","","int","int [2]|int*" "printf","stdio.h","","int","FAR const char *","..." "pthread_attr_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_attr_t *" "pthread_attr_getinheritsched","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR const pthread_attr_t *","FAR int *" @@ -125,15 +125,15 @@ "pthread_mutexattr_settype","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_PTHREAD_MUTEX_TYPES)","int","pthread_mutexattr_t *","int" "pthread_once","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_once_t*","CODE void (*)(void)" "pthread_yield","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void" -"puts","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR const char *" +"puts","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR const char *" "qsort","stdlib.h","","void","void *","size_t","size_t","int(*)(const void *","FAR const void *)" "rand","stdlib.h","","int" -"readdir_r","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","int","FAR DIR *","FAR struct dirent *","FAR struct dirent **" +"readdir_r","dirent.h","","int","FAR DIR *","FAR struct dirent *","FAR struct dirent **" "sched_get_priority_max","sched.h","","int","int" "sched_get_priority_min","sched.h","","int","int" "sem_getvalue","semaphore.h","","int","FAR sem_t *","FAR int *" "sem_init","semaphore.h","","int","FAR sem_t *","int","unsigned int" -"sendfile","sys/sendfile.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","int","off_t","size_t" +"sendfile","sys/sendfile.h","","ssize_t","int","int","off_t","size_t" "setlocale","local.h","","FAR char *s","int","FAR const char *s" "setlogmask","syslog.h","","int","int" "sigaddset","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR sigset_t *","int" @@ -187,21 +187,21 @@ "swab","unistd.h","","void","int","FAR const void *","FAR void *","ssize_t" "swprintf","wchar.h","defined(CONFIG_LIBC_WCHAR)","int","FAR wchar_t *","size_t","FAR const wchar_t *","..." "syslog","syslog.h","","int","int","FAR const char *","..." -"tcflush","termios.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SERIAL_TERMIOS)","int","int","int" -"tcgetattr","termios.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SERIAL_TERMIOS)","int","int","FAR struct termios *" -"tcsetattr","termios.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SERIAL_TERMIOS)","int","int","int","FAR const struct termios *" -"telldir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","off_t","FAR DIR *" +"tcflush","termios.h","defined(CONFIG_SERIAL_TERMIOS)","int","int","int" +"tcgetattr","termios.h","defined(CONFIG_SERIAL_TERMIOS)","int","int","FAR struct termios *" +"tcsetattr","termios.h","defined(CONFIG_SERIAL_TERMIOS)","int","int","int","FAR const struct termios *" +"telldir","dirent.h","","off_t","FAR DIR *" "time","time.h","","time_t","time_t *" "towlower","wchar.h","defined(CONFIG_LIBC_WCHAR)","wint_t","wint_t" "towupper","wchar.h","defined(CONFIG_LIBC_WCHAR)","wint_t","wint_t" "ub16divub16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t","ub16_t" "ub16mulub16","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t","ub16_t" "ub16sqr","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t" -"ungetc","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","int","FAR FILE *" +"ungetc","stdio.h","CONFIG_NFILE_STREAMS > 0","int","int","FAR FILE *" "usleep","unistd.h","!defined(CONFIG_DISABLE_SIGNALS)","int","int","FAR FILE *" "_info","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_INFO)","int","FAR const char *","..." -"vfprintf","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR const char *","va_list" -"vprintf","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","int","FAR const char *","va_list" +"vfprintf","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR const char *","va_list" +"vprintf","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR const char *","va_list" "vsnprintf","stdio.h","","int","FAR char *","size_t","FAR const char *","va_list" "vsprintf","stdio.h","","int","FAR char *","FAR const char *","va_list" "vsscanf","stdio.h","","int","FAR char *","FAR const char *","va_list" diff --git a/libs/libc/misc/Make.defs b/libs/libc/misc/Make.defs index 1dc984c108f..230d289dc5f 100644 --- a/libs/libc/misc/Make.defs +++ b/libs/libc/misc/Make.defs @@ -50,8 +50,6 @@ CSRCS += lib_uadd32x64.c lib_uadd64.c lib_usub64x32.c lib_usub64.c # Add C files that depend on file OR socket descriptors -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) - CSRCS += lib_sendfile.c ifneq ($(CONFIG_NFILE_STREAMS),0) @@ -66,22 +64,6 @@ ifeq ($(CONFIG_PIPES),y) CSRCS += lib_mkfifo.c endif -else # CONFIG_NFILE_DESCRIPTORS > 0 -ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0) - -CSRCS += lib_sendfile.c - -ifneq ($(CONFIG_NFILE_STREAMS),0) -CSRCS += lib_streamsem.c -endif - -ifeq ($(CONFIG_LIBC_IOCTL_VARIADIC),y) -CSRCS += lib_ioctl.c -endif - -endif # CONFIG_NSOCKET_DESCRIPTORS > 0 -endif # CONFIG_NFILE_DESCRIPTORS > 0 - # Add the miscellaneous C files to the build CSRCS += lib_crc64.c lib_crc32.c lib_crc16.c lib_crc8.c lib_crc8ccitt.c diff --git a/libs/libc/misc/lib_ioctl.c b/libs/libc/misc/lib_ioctl.c index 1f30c023758..20127ef9d02 100644 --- a/libs/libc/misc/lib_ioctl.c +++ b/libs/libc/misc/lib_ioctl.c @@ -48,7 +48,7 @@ #include "libc.h" -#if defined(CONFIG_LIBC_IOCTL_VARIADIC) && CONFIG_NFILE_DESCRIPTORS > 0 +#ifdef CONFIG_LIBC_IOCTL_VARIADIC /**************************************************************************** * Public Functions @@ -114,4 +114,4 @@ int ioctl(int fd, int req, ...) return fs_ioctl(fd, req, arg); } -#endif /* CONFIG_LIBC_IOCTL_VARIADIC && CONFIG_NFILE_DESCRIPTORS > 0 */ +#endif /* CONFIG_LIBC_IOCTL_VARIADIC */ diff --git a/libs/libc/misc/lib_sendfile.c b/libs/libc/misc/lib_sendfile.c index 58b0595b4ca..157910547c9 100644 --- a/libs/libc/misc/lib_sendfile.c +++ b/libs/libc/misc/lib_sendfile.c @@ -49,8 +49,6 @@ #include "libc.h" -#if CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0 - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -294,4 +292,3 @@ ssize_t sendfile(int outfd, int infd, off_t *offset, size_t count) return ntransferred; } -#endif /* CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0 */ diff --git a/libs/libc/stdio/Make.defs b/libs/libc/stdio/Make.defs index c7804402d7e..74766ca28a2 100644 --- a/libs/libc/stdio/Make.defs +++ b/libs/libc/stdio/Make.defs @@ -63,8 +63,6 @@ endif # The remaining sources files depend upon file descriptors -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) - CSRCS += lib_rawinstream.c lib_rawoutstream.c lib_rawsistream.c CSRCS += lib_rawsostream.c lib_remove.c @@ -91,7 +89,6 @@ endif ifneq ($(CONFIG_STDIO_DISABLE_BUFFERING),y) CSRCS += lib_setbuf.c lib_setvbuf.c endif -endif # Other support that depends on specific, configured features. diff --git a/libs/libc/termios/Make.defs b/libs/libc/termios/Make.defs index 3d211b3a127..8503fbe97be 100644 --- a/libs/libc/termios/Make.defs +++ b/libs/libc/termios/Make.defs @@ -36,7 +36,6 @@ # termios.h support requires file descriptors and that CONFIG_SERIAL_TERMIOS # is defined -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) ifeq ($(CONFIG_SERIAL_TERMIOS),y) # Add the termios C files to the build @@ -50,5 +49,4 @@ DEPPATH += --dep-path termios VPATH += termios endif -endif diff --git a/libs/libc/unistd/Make.defs b/libs/libc/unistd/Make.defs index 8fbb351a65f..dd929a1685b 100644 --- a/libs/libc/unistd/Make.defs +++ b/libs/libc/unistd/Make.defs @@ -38,7 +38,6 @@ CSRCS += lib_access.c lib_daemon.c lib_swab.c lib_sysconf.c CSRCS += lib_getopt.c lib_getoptargp.c lib_getoptindp.c lib_getoptoptp.c -ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) ifneq ($(CONFIG_DISABLE_ENVIRON),y) CSRCS += lib_chdir.c lib_getcwd.c endif @@ -54,7 +53,6 @@ endif ifeq ($(CONFIG_PIPES),y) CSRCS += lib_pipe.c endif -endif ifneq ($(CONFIG_DISABLE_SIGNALS),y) CSRCS += lib_sleep.c lib_usleep.c diff --git a/libs/libc/unistd/lib_chdir.c b/libs/libc/unistd/lib_chdir.c index 44311cefedb..bec7cc414fc 100644 --- a/libs/libc/unistd/lib_chdir.c +++ b/libs/libc/unistd/lib_chdir.c @@ -47,11 +47,7 @@ #include "libc.h" -#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_ENVIRON) - -/**************************************************************************** - * Public Data - ****************************************************************************/ +#ifndef CONFIG_DISABLE_ENVIRON /**************************************************************************** * Private Functions @@ -176,4 +172,4 @@ errout: set_errno(errcode); return ERROR; } -#endif /* CONFIG_NFILE_DESCRIPTORS && !CONFIG_DISABLE_ENVIRON */ +#endif /* !CONFIG_DISABLE_ENVIRON */ diff --git a/libs/libc/unistd/lib_daemon.c b/libs/libc/unistd/lib_daemon.c index f39ef03449f..22924536626 100644 --- a/libs/libc/unistd/lib_daemon.c +++ b/libs/libc/unistd/lib_daemon.c @@ -124,7 +124,6 @@ int daemon(int nochdir, int noclose) } #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 if (noclose == 0) { int fd = open("/dev/null", O_RDWR); @@ -169,7 +168,6 @@ int daemon(int nochdir, int noclose) (void)close(fd); } } -#endif return OK; } diff --git a/libs/libc/unistd/lib_getcwd.c b/libs/libc/unistd/lib_getcwd.c index 88c8f2c64b7..7bbdd506c6c 100644 --- a/libs/libc/unistd/lib_getcwd.c +++ b/libs/libc/unistd/lib_getcwd.c @@ -47,15 +47,7 @@ #include "libc.h" -#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_ENVIRON) - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ +#ifndef CONFIG_DISABLE_ENVIRON /**************************************************************************** * Public Functions @@ -129,4 +121,4 @@ FAR char *getcwd(FAR char *buf, size_t size) sched_unlock(); return buf; } -#endif /* CONFIG_NFILE_DESCRIPTORS && !CONFIG_DISABLE_ENVIRON */ +#endif /* !CONFIG_DISABLE_ENVIRON */ diff --git a/net/socket/accept.c b/net/socket/accept.c index 9c6bc6e6f8c..a5decbe7d6b 100644 --- a/net/socket/accept.c +++ b/net/socket/accept.c @@ -258,13 +258,11 @@ int accept(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen) * in the wrong context. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 if ((unsigned int)sockfd < CONFIG_NFILE_DESCRIPTORS) { errcode = ENOTSOCK; } else -#endif { errcode = EBADF; } diff --git a/net/socket/listen.c b/net/socket/listen.c index 81bb537fae8..2b41d599b80 100644 --- a/net/socket/listen.c +++ b/net/socket/listen.c @@ -157,13 +157,11 @@ int listen(int sockfd, int backlog) * descriptor used in the wrong context. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 if ((unsigned int)sockfd < CONFIG_NFILE_DESCRIPTORS) { errcode = ENOTSOCK; } else -#endif { errcode = EBADF; } diff --git a/net/socket/net_checksd.c b/net/socket/net_checksd.c index 64a2f4df8ea..2a4873dedef 100644 --- a/net/socket/net_checksd.c +++ b/net/socket/net_checksd.c @@ -63,7 +63,6 @@ * ****************************************************************************/ -#if defined(CONFIG_NET) && CONFIG_NFILE_DESCRIPTORS > 0 int net_checksd(int sd, int oflags) { FAR struct socket *psock = sockfd_socket(sd); @@ -84,5 +83,4 @@ int net_checksd(int sd, int oflags) return OK; } -#endif /* CONIG_NET && CONFIG_NFILE_DESCRIPTORS > 0 */ diff --git a/net/socket/net_dupsd.c b/net/socket/net_dupsd.c index d9604a00ac3..07c96d66602 100644 --- a/net/socket/net_dupsd.c +++ b/net/socket/net_dupsd.c @@ -78,7 +78,6 @@ int psock_dupsd(FAR struct socket *psock, int minsd) * map it relative of the first socket descriptor. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 if (minsd >= CONFIG_NFILE_DESCRIPTORS) { minsd -= CONFIG_NFILE_DESCRIPTORS; @@ -87,7 +86,6 @@ int psock_dupsd(FAR struct socket *psock, int minsd) { minsd = 0; } -#endif /* Lock the scheduler throughout the following */ diff --git a/net/socket/net_dupsd2.c b/net/socket/net_dupsd2.c index c19d33dbf45..ae4a45252ad 100644 --- a/net/socket/net_dupsd2.c +++ b/net/socket/net_dupsd2.c @@ -69,11 +69,7 @@ * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 int net_dupsd2(int sockfd1, int sockfd2) -#else -int dup2(int sockfd1, int sockfd2) -#endif { FAR struct socket *psock1; FAR struct socket *psock2; @@ -116,4 +112,3 @@ errout: return ret; } -#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS > 0 */ diff --git a/sched/Kconfig b/sched/Kconfig index 91e9970c620..a37ab29526b 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -1081,6 +1081,7 @@ config SDCLONE_DISABLE config NFILE_DESCRIPTORS int "Maximum number of file descriptors per task" default 16 + range 3 99999 ---help--- The maximum number of file descriptors per task (one for each open) diff --git a/sched/group/group.h b/sched/group/group.h index f7f0bbee1f9..86c41013751 100644 --- a/sched/group/group.h +++ b/sched/group/group.h @@ -94,7 +94,6 @@ void weak_function task_initialize(void); /* Task group data structure management */ -#ifdef HAVE_TASK_GROUP int group_allocate(FAR struct task_tcb_s *tcb, uint8_t ttype); int group_initialize(FAR struct task_tcb_s *tcb); #ifndef CONFIG_DISABLE_PTHREAD @@ -137,7 +136,6 @@ FAR struct task_group_s *task_getgroup(pid_t pid); #ifndef CONFIG_DISABLE_SIGNALS int group_signal(FAR struct task_group_s *group, FAR siginfo_t *siginfo); #endif -#endif /* HAVE_TASK_GROUP */ /* Parent/child data management */ @@ -161,12 +159,10 @@ void group_removechildren(FAR struct task_group_s *group); /* Group data resource configuration */ -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 int group_setupidlefiles(FAR struct task_tcb_s *tcb); int group_setuptaskfiles(FAR struct task_tcb_s *tcb); #if CONFIG_NFILE_STREAMS > 0 int group_setupstreams(FAR struct task_tcb_s *tcb); #endif -#endif #endif /* __SCHED_GROUP_GROUP_H */ diff --git a/sched/group/group_create.c b/sched/group/group_create.c index 66ddc7868a3..3d43f0d95de 100644 --- a/sched/group/group_create.c +++ b/sched/group/group_create.c @@ -51,8 +51,6 @@ #include "environ/environ.h" #include "group/group.h" -#ifdef HAVE_TASK_GROUP - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -344,5 +342,3 @@ int group_initialize(FAR struct task_tcb_s *tcb) return OK; } -#endif /* HAVE_TASK_GROUP */ - diff --git a/sched/group/group_find.c b/sched/group/group_find.c index aafa313919e..df61d7f4064 100644 --- a/sched/group/group_find.c +++ b/sched/group/group_find.c @@ -50,8 +50,6 @@ #include "group/group.h" #include "environ/environ.h" -#ifdef HAVE_TASK_GROUP - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -149,4 +147,3 @@ FAR struct task_group_s *group_findbypid(pid_t pid) } #endif -#endif /* HAVE_TASK_GROUP */ diff --git a/sched/group/group_join.c b/sched/group/group_join.c index 70df963b42b..1f2c072e3ff 100644 --- a/sched/group/group_join.c +++ b/sched/group/group_join.c @@ -51,7 +51,7 @@ #include "group/group.h" #include "environ/environ.h" -#if defined(HAVE_TASK_GROUP) && !defined(CONFIG_DISABLE_PTHREAD) +#ifndef CONFIG_DISABLE_PTHREAD /**************************************************************************** * Pre-processor Definitions @@ -228,4 +228,4 @@ int group_join(FAR struct pthread_tcb_s *tcb) return OK; } -#endif /* HAVE_TASK_GROUP && !CONFIG_DISABLE_PTHREAD */ +#endif /* !CONFIG_DISABLE_PTHREAD */ diff --git a/sched/group/group_leave.c b/sched/group/group_leave.c index 5bfd83da635..aef9799a4fd 100644 --- a/sched/group/group_leave.c +++ b/sched/group/group_leave.c @@ -59,8 +59,6 @@ #include "mqueue/mqueue.h" #include "group/group.h" -#ifdef HAVE_TASK_GROUP - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -162,7 +160,6 @@ static inline void group_release(FAR struct task_group_s *group) pthread_release(group); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Free all file-related resources now. We really need to close files as * soon as possible while we still have a functioning task. */ @@ -177,7 +174,6 @@ static inline void group_release(FAR struct task_group_s *group) lib_stream_release(group); #endif /* CONFIG_NFILE_STREAMS */ -#endif /* CONFIG_NFILE_DESCRIPTORS */ #if CONFIG_NSOCKET_DESCRIPTORS > 0 /* Free resource held by the socket list */ @@ -449,4 +445,4 @@ void group_leave(FAR struct tcb_s *tcb) } #endif /* HAVE_GROUP_MEMBERS */ -#endif /* HAVE_TASK_GROUP */ + diff --git a/sched/group/group_setupidlefiles.c b/sched/group/group_setupidlefiles.c index 8aca4c750ac..3f418e27ef4 100644 --- a/sched/group/group_setupidlefiles.c +++ b/sched/group/group_setupidlefiles.c @@ -52,8 +52,6 @@ #include "group/group.h" -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -76,22 +74,16 @@ int group_setupidlefiles(FAR struct task_tcb_s *tcb) { -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 FAR struct task_group_s *group = tcb->cmn.group; -#endif -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_DEV_CONSOLE) +#ifdef CONFIG_DEV_CONSOLE int fd; #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 - DEBUGASSERT(group); -#endif + DEBUGASSERT(group != NULL); -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Initialize file descriptors for the TCB */ files_initlist(&group->tg_filelist); -#endif #if CONFIG_NSOCKET_DESCRIPTORS > 0 /* Allocate socket descriptors for the TCB */ @@ -104,7 +96,7 @@ int group_setupidlefiles(FAR struct task_tcb_s *tcb) * descriptor 0. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_DEV_CONSOLE) +#ifdef CONFIG_DEV_CONSOLE fd = nx_open("/dev/console", O_RDWR); if (fd == 0) { @@ -142,4 +134,3 @@ int group_setupidlefiles(FAR struct task_tcb_s *tcb) #endif } -#endif /* CONFIG_NFILE_DESCRIPTORS || CONFIG_NSOCKET_DESCRIPTORS */ diff --git a/sched/group/group_setupstreams.c b/sched/group/group_setupstreams.c index 996b9cec7bf..87201355bc8 100644 --- a/sched/group/group_setupstreams.c +++ b/sched/group/group_setupstreams.c @@ -52,7 +52,6 @@ * that some number of streams have been configured. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 #if CONFIG_NFILE_STREAMS > 0 /**************************************************************************** @@ -92,5 +91,4 @@ int group_setupstreams(FAR struct task_tcb_s *tcb) } #endif /* CONFIG_NFILE_STREAMS > 0 */ -#endif /* CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 */ diff --git a/sched/group/group_setuptaskfiles.c b/sched/group/group_setuptaskfiles.c index 6375e6efd17..2f63c3296bb 100644 --- a/sched/group/group_setuptaskfiles.c +++ b/sched/group/group_setuptaskfiles.c @@ -48,8 +48,6 @@ #include "sched/sched.h" #include "group/group.h" -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -84,7 +82,7 @@ * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_FDCLONE_DISABLE) +#ifndef CONFIG_FDCLONE_DISABLE static inline void sched_dupfiles(FAR struct task_tcb_s *tcb) { /* The parent task is the one at the head of the ready-to-run list */ @@ -124,9 +122,9 @@ static inline void sched_dupfiles(FAR struct task_tcb_s *tcb) } } } -#else /* CONFIG_NFILE_DESCRIPTORS && !CONFIG_FDCLONE_DISABLE */ +#else /* !CONFIG_FDCLONE_DISABLE */ # define sched_dupfiles(tcb) -#endif /* CONFIG_NFILE_DESCRIPTORS && !CONFIG_FDCLONE_DISABLE */ +#endif /* !CONFIG_FDCLONE_DISABLE */ /**************************************************************************** * Name: sched_dupsockets @@ -208,20 +206,16 @@ static inline void sched_dupsockets(FAR struct task_tcb_s *tcb) int group_setuptaskfiles(FAR struct task_tcb_s *tcb) { -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 FAR struct task_group_s *group = tcb->cmn.group; DEBUGASSERT(group); -#endif #ifndef CONFIG_DISABLE_PTHREAD DEBUGASSERT((tcb->cmn.flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_PTHREAD); #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Initialize file descriptors for the TCB */ files_initlist(&group->tg_filelist); -#endif #if CONFIG_NSOCKET_DESCRIPTORS > 0 /* Allocate socket descriptors for the TCB */ @@ -246,5 +240,3 @@ int group_setuptaskfiles(FAR struct task_tcb_s *tcb) #endif } -#endif /* CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 */ - diff --git a/sched/group/group_signal.c b/sched/group/group_signal.c index 938a98aaed5..6afdfcc48e7 100644 --- a/sched/group/group_signal.c +++ b/sched/group/group_signal.c @@ -49,7 +49,7 @@ #include "group/group.h" #include "signal/signal.h" -#if defined(HAVE_TASK_GROUP) && !defined(CONFIG_DISABLE_SIGNALS) +#ifndef CONFIG_DISABLE_SIGNALS /**************************************************************************** * Private Types @@ -275,4 +275,4 @@ errout: #endif } -#endif /* HAVE_TASK_GROUP && !CONFIG_DISABLE_SIGNALS */ +#endif /* !CONFIG_DISABLE_SIGNALS */ diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c index d6e4567ca3b..c4af03527f3 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -71,9 +71,7 @@ #include "clock/clock.h" #include "timer/timer.h" #include "irq/irq.h" -#ifdef HAVE_TASK_GROUP -# include "group/group.h" -#endif +#include "group/group.h" #include "init/init.h" /**************************************************************************** @@ -699,11 +697,9 @@ void nx_start(void) } #endif -#if CONFIG_NFILE_DESCRIPTORS > 0 /* Initialize the file system (needed to support device drivers) */ fs_initialize(); -#endif #ifdef CONFIG_NET /* Initialize the networking system */ @@ -752,13 +748,10 @@ void nx_start(void) for (cpu = 0; cpu < CONFIG_SMP_NCPUS; cpu++) #endif { -#ifdef HAVE_TASK_GROUP /* Allocate the IDLE group */ DEBUGVERIFY(group_allocate(&g_idletcb[cpu], g_idletcb[cpu].cmn.flags)); -#endif -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 #ifdef CONFIG_SMP if (cpu > 0) { @@ -776,16 +769,13 @@ void nx_start(void) DEBUGVERIFY(group_setupidlefiles(&g_idletcb[cpu])); } -#endif -#ifdef HAVE_TASK_GROUP /* Complete initialization of the IDLE group. Suppress retention * of child status in the IDLE group. */ DEBUGVERIFY(group_initialize(&g_idletcb[cpu])); g_idletcb[cpu].cmn.group->tg_flags = GROUP_FLAG_NOCLDWAIT; -#endif } /* Start SYSLOG ***********************************************************/ diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index d758ef044fe..1be784f69d9 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -248,9 +248,7 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, int errcode; pid_t pid; int ret; -#ifdef HAVE_TASK_GROUP bool group_joined = false; -#endif /* If attributes were not supplied, use the default attributes */ @@ -268,7 +266,6 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, return ENOMEM; } -#ifdef HAVE_TASK_GROUP /* Bind the parent's group to the new TCB (we have not yet joined the * group). */ @@ -279,7 +276,6 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, errcode = ENOMEM; goto errout_with_tcb; } -#endif #ifdef CONFIG_ARCH_ADDRENV /* Share the address environment of the parent task group. */ @@ -450,7 +446,6 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, pthread_argsetup(ptcb, arg); -#ifdef HAVE_TASK_GROUP /* Join the parent's task group */ ret = group_join(ptcb); @@ -461,7 +456,6 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, } group_joined = true; -#endif /* Attach the join info to the TCB. */ @@ -621,14 +615,12 @@ errout_with_join: ptcb->joininfo = NULL; errout_with_tcb: -#ifdef HAVE_TASK_GROUP /* Clear group binding */ if (ptcb && !group_joined) { ptcb->cmn.group = NULL; } -#endif sched_releasetcb((FAR struct tcb_s *)ptcb, TCB_FLAG_TTYPE_PTHREAD); return errcode; diff --git a/sched/sched/sched_getfiles.c b/sched/sched/sched_getfiles.c index ff0d7e5aa46..a2e0025e321 100644 --- a/sched/sched/sched_getfiles.c +++ b/sched/sched/sched_getfiles.c @@ -65,8 +65,6 @@ * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 - FAR struct filelist *sched_getfiles(void) { FAR struct tcb_s *rtcb = this_task(); @@ -88,4 +86,3 @@ FAR struct filelist *sched_getfiles(void) return NULL; } -#endif /* CONFIG_NFILE_DESCRIPTORS */ diff --git a/sched/sched/sched_getstreams.c b/sched/sched/sched_getstreams.c index 8416b924a55..3c727bffb71 100644 --- a/sched/sched/sched_getstreams.c +++ b/sched/sched/sched_getstreams.c @@ -61,7 +61,7 @@ * ****************************************************************************/ -#if CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0 +#if CONFIG_NFILE_STREAMS > 0 FAR struct streamlist *sched_getstreams(void) { @@ -78,4 +78,4 @@ FAR struct streamlist *sched_getstreams(void) #endif } -#endif /* CONFIG_NFILE_DESCRIPTORS && CONFIG_NFILE_STREAMS */ +#endif /* CONFIG_NFILE_STREAMS */ diff --git a/sched/sched/sched_releasetcb.c b/sched/sched/sched_releasetcb.c index 861c2321cbc..62e73a0caa5 100644 --- a/sched/sched/sched_releasetcb.c +++ b/sched/sched/sched_releasetcb.c @@ -193,11 +193,9 @@ int sched_releasetcb(FAR struct tcb_s *tcb, uint8_t ttype) ret = up_addrenv_detach(tcb->group, tcb); #endif -#ifdef HAVE_TASK_GROUP /* Leave the group (if we did not already leave in task_exithook.c) */ group_leave(tcb); -#endif /* And, finally, release the TCB itself */ diff --git a/sched/task/task_create.c b/sched/task/task_create.c index 21c261ec475..8a2a6876983 100644 --- a/sched/task/task_create.c +++ b/sched/task/task_create.c @@ -100,7 +100,6 @@ static int nxthread_create(FAR const char *name, uint8_t ttype, return -ENOMEM; } -#ifdef HAVE_TASK_GROUP /* Allocate a new task group with privileges appropriate for the parent * thread type. */ @@ -110,9 +109,7 @@ static int nxthread_create(FAR const char *name, uint8_t ttype, { goto errout_with_tcb; } -#endif -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 #if 0 /* No... there are side effects */ /* Associate file descriptors with the new task. Exclude kernel threads; * kernel threads do not have file or socket descriptors. They must use @@ -128,7 +125,6 @@ static int nxthread_create(FAR const char *name, uint8_t ttype, goto errout_with_tcb; } } -#endif /* Allocate the stack for the TCB */ @@ -150,7 +146,6 @@ static int nxthread_create(FAR const char *name, uint8_t ttype, (void)nxtask_argsetup(tcb, name, argv); -#ifdef HAVE_TASK_GROUP /* Now we have enough in place that we can join the group */ ret = group_initialize(tcb); @@ -158,7 +153,6 @@ static int nxthread_create(FAR const char *name, uint8_t ttype, { goto errout_with_tcb; } -#endif /* Get the assigned pid before we start the task */ diff --git a/sched/task/task_exithook.c b/sched/task/task_exithook.c index e56dc5c4f1d..ca717b999d1 100644 --- a/sched/task/task_exithook.c +++ b/sched/task/task_exithook.c @@ -694,13 +694,11 @@ void nxtask_exithook(FAR struct tcb_s *tcb, int status, bool nonblocking) nxtask_flushstreams(tcb); } -#ifdef HAVE_TASK_GROUP /* Leave the task group. Perhaps discarding any un-reaped child * status (no zombies here!) */ group_leave(tcb); -#endif #ifndef CONFIG_DISABLE_SIGNALS /* Deallocate anything left in the TCB's queues */ diff --git a/sched/task/task_getgroup.c b/sched/task/task_getgroup.c index 3f624a0d41d..7cf43d282d2 100644 --- a/sched/task/task_getgroup.c +++ b/sched/task/task_getgroup.c @@ -45,8 +45,6 @@ #include "group/group.h" #include "task/task.h" -#ifdef HAVE_TASK_GROUP - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -83,4 +81,3 @@ FAR struct task_group_s *task_getgroup(pid_t pid) return NULL; } -#endif /* HAVE_TASK_GROUP */ diff --git a/sched/task/task_init.c b/sched/task/task_init.c index 864fdc57c0e..d5c18807249 100644 --- a/sched/task/task_init.c +++ b/sched/task/task_init.c @@ -103,25 +103,21 @@ int task_init(FAR struct tcb_s *tcb, const char *name, int priority, /* Create a new task group */ -#ifdef HAVE_TASK_GROUP ret = group_allocate(ttcb, tcb->flags); if (ret < 0) { errcode = -ret; goto errout; } -#endif /* Associate file descriptors with the new task */ -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 ret = group_setuptaskfiles(ttcb); if (ret < 0) { errcode = -ret; goto errout_with_group; } -#endif /* Configure the user provided stack region */ @@ -143,22 +139,19 @@ int task_init(FAR struct tcb_s *tcb, const char *name, int priority, /* Now we have enough in place that we can join the group */ -#ifdef HAVE_TASK_GROUP ret = group_initialize(ttcb); if (ret < 0) { errcode = -ret; goto errout_with_group; } -#endif + return OK; errout_with_group: -#ifdef HAVE_TASK_GROUP group_leave(tcb); errout: -#endif set_errno(errcode); return ERROR; } diff --git a/sched/task/task_vfork.c b/sched/task/task_vfork.c index 193b9c524c3..69999366a30 100644 --- a/sched/task/task_vfork.c +++ b/sched/task/task_vfork.c @@ -317,23 +317,19 @@ FAR struct task_tcb_s *nxtask_vforksetup(start_t retaddr, size_t *argsize) /* Allocate a new task group with the same privileges as the parent */ -#ifdef HAVE_TASK_GROUP ret = group_allocate(child, parent->flags); if (ret < 0) { goto errout_with_tcb; } -#endif /* Associate file descriptors with the new task */ -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 ret = group_setuptaskfiles(child); if (ret < OK) { goto errout_with_tcb; } -#endif /* Get the priority of the parent task */ @@ -430,14 +426,12 @@ pid_t nxtask_vforkstart(FAR struct task_tcb_s *child) /* Now we have enough in place that we can join the group */ -#ifdef HAVE_TASK_GROUP ret = group_initialize(child); if (ret < 0) { nxtask_vforkabort(child, -ret); return ERROR; } -#endif /* Get the assigned pid before we start the task */ diff --git a/syscall/syscall.csv b/syscall/syscall.csv index 86cd4cc2236..7129bfb1ece 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -14,21 +14,21 @@ "clock_gettime","time.h","","int","clockid_t","struct timespec*" "clock_nanosleep","time.h","!defined(CONFIG_DISABLE_SIGNALS)","int","clockid_t","int","FAR const struct timespec *", "FAR struct timespec*" "clock_settime","time.h","","int","clockid_t","const struct timespec*" -"close","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","int","int" -"closedir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","int","FAR DIR*" +"close","unistd.h","","int","int" +"closedir","dirent.h","","int","FAR DIR*" "connect","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","FAR const struct sockaddr*","socklen_t" -"dup","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int" -"dup2","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int","int" +"dup","unistd.h","","int","int" +"dup2","unistd.h","","int","int","int" "exec","nuttx/binfmt/binfmt.h","!defined(CONFIG_BINFMT_DISABLE) && !defined(CONFIG_BUILD_KERNEL)","int","FAR const char *","FAR char * const *","FAR const struct symtab_s *","int" "execv","unistd.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS)","int","FAR const char *","FAR char *const []|FAR char *const *" "exit","stdlib.h","","void","int" -"fcntl","fcntl.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int","int","..." -"fs_fdopen","nuttx/fs/fs.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","FAR struct file_struct*","int","int","FAR struct tcb_s*" -"fs_ioctl","nuttx/fs/fs.h","defined(CONFIG_LIBC_IOCTL_VARIADIC) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","int","int","unsigned long" -"fstat","sys/stat.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int","FAR struct stat*" -"fstatfs","sys/statfs.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int","FAR struct statfs*" -"fsync","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","int" -"ftruncate","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","int","off_t" +"fcntl","fcntl.h","","int","int","int","..." +"fs_fdopen","nuttx/fs/fs.h","CONFIG_NFILE_STREAMS > 0","FAR struct file_struct*","int","int","FAR struct tcb_s*" +"fs_ioctl","nuttx/fs/fs.h","defined(CONFIG_LIBC_IOCTL_VARIADIC)","int","int","int","unsigned long" +"fstat","sys/stat.h","","int","int","FAR struct stat*" +"fstatfs","sys/statfs.h","","int","int","FAR struct statfs*" +"fsync","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","int" +"ftruncate","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","int","off_t" "get_errno","errno.h","!defined(__DIRECT_ERRNO_ACCESS)","int" "get_errno_ptr","errno.h","defined(__DIRECT_ERRNO_ACCESS)","FAR int*" "getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char*","FAR const char*" @@ -40,16 +40,16 @@ "if_indextoname","net/if.h","defined(CONFIG_NETDEV_IFINDEX)","FAR char *","unsigned int","FAR char *" "if_nametoindex","net/if.h","defined(CONFIG_NETDEV_IFINDEX)","unsigned int","FAR const char *" "insmod","nuttx/module.h","defined(CONFIG_MODULE)","FAR void *","FAR const char *","FAR const char *" -"ioctl","sys/ioctl.h","!defined(CONFIG_LIBC_IOCTL_VARIADIC) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","int","int","unsigned long" +"ioctl","sys/ioctl.h","!defined(CONFIG_LIBC_IOCTL_VARIADIC)","int","int","int","unsigned long" "kill","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","pid_t","int" "link","unistd.h","defined(CONFIG_PSEUDOFS_SOFTLINKS)","int","FAR const char *","FAR const char *" "listen","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int" -"lseek","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0","off_t","int","off_t","int" -"mkdir","sys/stat.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*","mode_t" +"lseek","unistd.h","","off_t","int","off_t","int" +"mkdir","sys/stat.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*","mode_t" "mkfifo2","nuttx/drivers/drivers.h","defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0","int","FAR const char*","mode_t","size_t" -"mmap","sys/mman.h","CONFIG_NFILE_DESCRIPTORS > 0","FAR void*","FAR void*","size_t","int","int","int","off_t" +"mmap","sys/mman.h","","FAR void*","FAR void*","size_t","int","int","int","off_t" "modhandle","nuttx/module.h","defined(CONFIG_MODULE)","FAR void *","FAR const char *" -"mount","sys/mount.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE)","int","const char*","const char*","const char*","unsigned long","const void*" +"mount","sys/mount.h","!defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE)","int","const char*","const char*","const char*","unsigned long","const void*" "mq_close","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t" "mq_getattr","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","struct mq_attr *" "mq_notify","mqueue.h","!defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","const struct sigevent*" @@ -62,16 +62,16 @@ "mq_unlink","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","const char*" "nx_vsyslog","nuttx/syslog/syslog.h","","int","int","FAR const IPTR char*","FAR va_list*" "on_exit","stdlib.h","defined(CONFIG_SCHED_ONEXIT)","int","CODE void (*)(int, FAR void *)","FAR void *" -"open","fcntl.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","int","..." -"opendir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","FAR DIR*","FAR const char*" +"open","fcntl.h","","int","const char*","int","..." +"opendir","dirent.h","","FAR DIR*","FAR const char*" "pgalloc", "nuttx/arch.h", "defined(CONFIG_BUILD_KERNEL)", "uintptr_t", "uintptr_t", "unsigned int" "pipe2","nuttx/drivers/drivers.h","defined(CONFIG_PIPES) && CONFIG_DEV_PIPE_SIZE > 0","int","int [2]|int*","size_t" -"poll","poll.h","!defined(CONFIG_DISABLE_POLL) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","FAR struct pollfd*","nfds_t","int" -"ppoll","poll.h","!defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_POLL) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","FAR struct pollfd*","nfds_t","FAR const struct timespec *","FAR const sigset_t *" +"poll","poll.h","!defined(CONFIG_DISABLE_POLL)","int","FAR struct pollfd*","nfds_t","int" +"ppoll","poll.h","!defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_POLL)","int","FAR struct pollfd*","nfds_t","FAR const struct timespec *","FAR const sigset_t *" "prctl","sys/prctl.h", "CONFIG_TASK_NAME_SIZE > 0","int","int","..." -"pread","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR void*","size_t","off_t" -"pselect","sys/select.h","!defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_POLL) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","int","FAR fd_set*","FAR fd_set*","FAR fd_set*","FAR const struct timespec *","FAR const sigset_t *" -"pwrite","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR const void*","size_t","off_t" +"pread","unistd.h","","ssize_t","int","FAR void*","size_t","off_t" +"pselect","sys/select.h","!defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_POLL)","int","int","FAR fd_set*","FAR fd_set*","FAR fd_set*","FAR const struct timespec *","FAR const sigset_t *" +"pwrite","unistd.h","","ssize_t","int","FAR const void*","size_t","off_t" "posix_spawnp","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_LIB_ENVPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []|FAR char *const *" "posix_spawn","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && !defined(CONFIG_LIB_ENVPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []|FAR char *const *","FAR char *const []|FAR char *const *" "pthread_cancel","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t" @@ -103,18 +103,18 @@ "pthread_setspecific","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_key_t","FAR const void*" "pthread_sigmask","pthread.h","!defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_PTHREAD)","int","int","FAR const sigset_t*","FAR sigset_t*" "putenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char*" -"read","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR void*","size_t" -"readdir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","FAR struct dirent*","FAR DIR*" +"read","unistd.h","","ssize_t","int","FAR void*","size_t" +"readdir","dirent.h","","FAR struct dirent*","FAR DIR*" "readlink","unistd.h","defined(CONFIG_PSEUDOFS_SOFTLINKS)","ssize_t","FAR const char *","FAR char *","size_t" "recv","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR void*","size_t","int" "recvfrom","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR void*","size_t","int","FAR struct sockaddr*","FAR socklen_t*" -"rename","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*","FAR const char*" -"rewinddir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","void","FAR DIR*" -"rmdir","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*" +"rename","stdio.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*","FAR const char*" +"rewinddir","dirent.h","","void","FAR DIR*" +"rmdir","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*" "rmmod","nuttx/module.h","defined(CONFIG_MODULE)","int","FAR void *" "sched_getparam","sched.h","","int","pid_t","struct sched_param*" "sched_getscheduler","sched.h","","int","pid_t" -"sched_getstreams","nuttx/sched.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","FAR struct streamlist*" +"sched_getstreams","nuttx/sched.h","CONFIG_NFILE_STREAMS > 0","FAR struct streamlist*" "sched_lock","sched.h","","int" "sched_lockcount","sched.h","","int32_t" "sched_rr_get_interval","sched.h","","int","pid_t","struct timespec*" @@ -122,8 +122,8 @@ "sched_setscheduler","sched.h","","int","pid_t","int","const struct sched_param*" "sched_unlock","sched.h","","int" "sched_yield","sched.h","","int" -"seekdir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","void","FAR DIR*","off_t" -"select","sys/select.h","!defined(CONFIG_DISABLE_POLL) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","int","FAR fd_set*","FAR fd_set*","FAR fd_set*","FAR struct timeval*" +"seekdir","dirent.h","","void","FAR DIR*","off_t" +"select","sys/select.h","!defined(CONFIG_DISABLE_POLL)","int","int","FAR fd_set*","FAR fd_set*","FAR fd_set*","FAR struct timeval*" "sem_close","semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","int","FAR sem_t*" "sem_destroy","semaphore.h","","int","FAR sem_t*" "sem_open","semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","FAR sem_t*","FAR const char*","int","..." @@ -134,7 +134,7 @@ "sem_unlink","semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","int","FAR const char*" "sem_wait","semaphore.h","","int","FAR sem_t*" "send","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int" -"sendfile","sys/sendfile.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_NET_SENDFILE)","ssize_t","int","int","FAR off_t*","size_t" +"sendfile","sys/sendfile.h","defined(CONFIG_NET_SENDFILE)","ssize_t","int","int","FAR off_t*","size_t" "sendto","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int","FAR const struct sockaddr*","socklen_t" "set_errno","errno.h","!defined(__DIRECT_ERRNO_ACCESS)","void","int" "setenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char*","FAR const char*","int" @@ -152,8 +152,8 @@ "sigtimedwait","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const sigset_t*","FAR struct siginfo*","FAR const struct timespec*" "sigwaitinfo","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const sigset_t*","FAR struct siginfo*" "socket","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int","int" -"stat","sys/stat.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","FAR struct stat*" -"statfs","sys/statfs.h","CONFIG_NFILE_DESCRIPTORS > 0","int","FAR const char*","FAR struct statfs*" +"stat","sys/stat.h","","int","const char*","FAR struct stat*" +"statfs","sys/statfs.h","","int","FAR const char*","FAR struct statfs*" "task_create","sched.h","!defined(CONFIG_BUILD_KERNEL)", "int","FAR const char*","int","int","main_t","FAR char * const []|FAR char * const *" #"task_create","sched.h","","int","const char*","int","main_t","FAR char * const []|FAR char * const *" "task_delete","sched.h","","int","pid_t" @@ -162,15 +162,15 @@ "task_setcanceltype","sched.h","defined(CONFIG_CANCELLATION_POINTS)","int","int","FAR int*" "task_testcancel","pthread.h","defined(CONFIG_CANCELLATION_POINTS)","void" "tcdrain","termios.h","defined(CONFIG_SERIAL_TERMIOS)","int","int" -"telldir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","off_t","FAR DIR*" +"telldir","dirent.h","","off_t","FAR DIR*" "timer_create","time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","clockid_t","FAR struct sigevent*","FAR timer_t*" "timer_delete","time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","timer_t" "timer_getoverrun","time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","timer_t" "timer_gettime","time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","timer_t","FAR struct itimerspec*" "timer_settime","time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","timer_t","int","FAR const struct itimerspec*","FAR struct itimerspec*" -"umount2","sys/mount.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*","unsigned int" +"umount2","sys/mount.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*","unsigned int" "uname","sys/utsname.h","","int","FAR struct utsname*" -"unlink","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*" +"unlink","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*" "unsetenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","const char*" "up_assert","assert.h","","void","FAR const uint8_t*","int" #"up_assert","assert.h","","void" @@ -178,4 +178,4 @@ "wait","sys/wait.h","defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)","pid_t","int*" "waitid","sys/wait.h","defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)","int","idtype_t","id_t"," FAR siginfo_t *","int" "waitpid","sys/wait.h","defined(CONFIG_SCHED_WAITPID)","pid_t","pid_t","int*","int" -"write","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","ssize_t","int","FAR const void*","size_t" +"write","unistd.h","","ssize_t","int","FAR const void*","size_t" diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h index 679d6c4c2ed..17f17e92447 100644 --- a/syscall/syscall_lookup.h +++ b/syscall/syscall_lookup.h @@ -190,36 +190,34 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) * enabled. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 SYSCALL_LOOKUP(close, 1, STUB_close) -# ifdef CONFIG_LIBC_IOCTL_VARIADIC +#ifdef CONFIG_LIBC_IOCTL_VARIADIC SYSCALL_LOOKUP(fs_ioctl, 3, STUB_fs_ioctl) -# else +#else SYSCALL_LOOKUP(ioctl, 3, STUB_ioctl) -# endif +#endif SYSCALL_LOOKUP(read, 3, STUB_read) SYSCALL_LOOKUP(write, 3, STUB_write) SYSCALL_LOOKUP(pread, 4, STUB_pread) SYSCALL_LOOKUP(pwrite, 4, STUB_pwrite) -# ifdef CONFIG_FS_AIO +#ifdef CONFIG_FS_AIO SYSCALL_LOOKUP(aio_read, 1, STUB_aio_read) SYSCALL_LOOKUP(aio_write, 1, STUB_aio_write) SYSCALL_LOOKUP(aio_fsync, 2, STUB_aio_fsync) SYSCALL_LOOKUP(aio_cancel, 2, STUB_aio_cancel) -# endif -# ifndef CONFIG_DISABLE_POLL +#endif +#ifndef CONFIG_DISABLE_POLL SYSCALL_LOOKUP(poll, 3, STUB_poll) SYSCALL_LOOKUP(select, 5, STUB_select) SYSCALL_LOOKUP(ppoll, 4, STUB_ppoll) SYSCALL_LOOKUP(pselect, 6, STUB_pselect) -# endif -# ifdef CONFIG_NETDEV_IFINDEX +#endif +#ifdef CONFIG_NETDEV_IFINDEX SYSCALL_LOOKUP(if_indextoname, 2, STUB_if_indextoname) SYSCALL_LOOKUP(if_nametoindex, 1, STUB_if_nametoindex) -# endif -# ifdef CONFIG_SERIAL_TERMIOS +#endif +#ifdef CONFIG_SERIAL_TERMIOS SYSCALL_LOOKUP(tcdrain, 1, STUB_tcdrain) -# endif #endif /* Board support */ @@ -230,7 +228,6 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) /* The following are defined if file descriptors are enabled */ -#if CONFIG_NFILE_DESCRIPTORS > 0 SYSCALL_LOOKUP(closedir, 1, STUB_closedir) SYSCALL_LOOKUP(dup, 1, STUB_dup) SYSCALL_LOOKUP(dup2, 2, STUB_dup2) @@ -248,32 +245,32 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) SYSCALL_LOOKUP(fstatfs, 2, STUB_fstatfs) SYSCALL_LOOKUP(telldir, 1, STUB_telldir) -# if defined(CONFIG_PSEUDOFS_SOFTLINKS) +#if defined(CONFIG_PSEUDOFS_SOFTLINKS) SYSCALL_LOOKUP(link, 2, STUB_link) SYSCALL_LOOKUP(readlink, 3, STUB_readlink) -# endif +#endif -# if defined(CONFIG_PIPES) && CONFIG_DEV_PIPE_SIZE > 0 +#if defined(CONFIG_PIPES) && CONFIG_DEV_PIPE_SIZE > 0 SYSCALL_LOOKUP(pipe2, 2, STUB_pipe2) -# endif +#endif -# if defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0 +#if defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0 SYSCALL_LOOKUP(mkfifo2, 3, STUB_mkfifo2) -# endif +#endif -# if CONFIG_NFILE_STREAMS > 0 +#if CONFIG_NFILE_STREAMS > 0 SYSCALL_LOOKUP(fdopen, 3, STUB_fs_fdopen) SYSCALL_LOOKUP(sched_getstreams, 0, STUB_sched_getstreams) -# endif +#endif -# if defined(CONFIG_NET_SENDFILE) +#if defined(CONFIG_NET_SENDFILE) SYSCALL_LOOKUP(sendfile, 4, STUB_fs_sendifile) -# endif +#endif -# if !defined(CONFIG_DISABLE_MOUNTPOINT) -# if defined(CONFIG_FS_READABLE) +#if !defined(CONFIG_DISABLE_MOUNTPOINT) +# if defined(CONFIG_FS_READABLE) SYSCALL_LOOKUP(mount, 5, STUB_mount) -# endif +# endif SYSCALL_LOOKUP(fsync, 1, STUB_fsync) SYSCALL_LOOKUP(ftruncate, 2, STUB_ftruncate) SYSCALL_LOOKUP(mkdir, 2, STUB_mkdir) @@ -281,7 +278,6 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) SYSCALL_LOOKUP(rmdir, 1, STUB_rmdir) SYSCALL_LOOKUP(umount2, 2, STUB_umount2) SYSCALL_LOOKUP(unlink, 1, STUB_unlink) -# endif #endif /* Shared memory interfaces */ diff --git a/tools/Directories.mk b/tools/Directories.mk index ac31651cc3d..7c175107899 100644 --- a/tools/Directories.mk +++ b/tools/Directories.mk @@ -170,16 +170,7 @@ USERDEPDIRS = $(USERDIRS) # Add file system directories to KERNDEPDIRS (they are already in CLEANDIRS) -ifeq ($(CONFIG_NFILE_DESCRIPTORS),0) -ifeq ($(CONFIG_NET),y) -ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0) -KERNDEPDIRS += fs -endif -KERNDEPDIRS += drivers -endif -else KERNDEPDIRS += $(FSDIRS) -endif # Add networking directories to KERNDEPDIRS and CLEANDIRS diff --git a/tools/FlatLibs.mk b/tools/FlatLibs.mk index 6b15d3d1cc1..0ad2cc335b2 100644 --- a/tools/FlatLibs.mk +++ b/tools/FlatLibs.mk @@ -101,13 +101,7 @@ endif # Add libraries for file system support -ifeq ($(CONFIG_NFILE_DESCRIPTORS),0) -ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0) -NUTTXLIBS += staging$(DELIM)libfs$(LIBEXT) -endif -else NUTTXLIBS += staging$(DELIM)libfs$(LIBEXT) staging$(DELIM)libbinfmt$(LIBEXT) -endif # Add libraries for the NX graphics sub-system diff --git a/tools/KernelLibs.mk b/tools/KernelLibs.mk index fe79a3e6872..f36d8d6ce5e 100644 --- a/tools/KernelLibs.mk +++ b/tools/KernelLibs.mk @@ -93,13 +93,7 @@ endif # Add libraries for file system support -ifeq ($(CONFIG_NFILE_DESCRIPTORS),0) -ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0) -NUTTXLIBS += staging$(DELIM)libfs$(LIBEXT) -endif -else NUTTXLIBS += staging$(DELIM)libfs$(LIBEXT) staging$(DELIM)libbinfmt$(LIBEXT) -endif # Add libraries for the NX graphics sub-system diff --git a/tools/ProtectedLibs.mk b/tools/ProtectedLibs.mk index 01320c887a9..4bb3d194248 100644 --- a/tools/ProtectedLibs.mk +++ b/tools/ProtectedLibs.mk @@ -100,13 +100,7 @@ endif # Add libraries for file system support -ifeq ($(CONFIG_NFILE_DESCRIPTORS),0) -ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0) -NUTTXLIBS += staging$(DELIM)libfs$(LIBEXT) -endif -else NUTTXLIBS += staging$(DELIM)libfs$(LIBEXT) staging$(DELIM)libbinfmt$(LIBEXT) -endif # Add libraries for the NX graphics sub-system diff --git a/tools/mkconfig.c b/tools/mkconfig.c index a5a8917a626..c880e7429ca 100644 --- a/tools/mkconfig.c +++ b/tools/mkconfig.c @@ -136,21 +136,6 @@ int main(int argc, char **argv, char **envp) printf("# define CONFIG_RR_INTERVAL 0\n"); printf("#endif\n\n"); - printf("/* The correct way to disable filesystem support is to set the number of\n"); - printf(" * file descriptors to zero.\n"); - printf(" */\n\n"); - printf("#ifndef CONFIG_NFILE_DESCRIPTORS\n"); - printf("# define CONFIG_NFILE_DESCRIPTORS 0\n"); - printf("#endif\n\n"); - - printf("/* If no file descriptors are configured, then make certain no streams\n"); - printf(" * are configured either.\n"); - printf(" */\n\n"); - printf("#if CONFIG_NFILE_DESCRIPTORS == 0\n"); - printf("# undef CONFIG_NFILE_STREAMS\n"); - printf("# define CONFIG_NFILE_STREAMS 0\n"); - printf("#endif\n\n"); - printf("/* The correct way to disable stream support is to set the number of\n"); printf(" * streamd to zero.\n"); printf(" */\n\n"); @@ -158,31 +143,6 @@ int main(int argc, char **argv, char **envp) printf("# define CONFIG_NFILE_STREAMS 0\n"); printf("#endif\n\n"); - printf("/* If a console is selected, then make sure that there are resources for\n"); - printf(" * three file descriptors and, if any streams are selected, also for three\n"); - printf(" * file streams.\n"); - printf(" *\n"); - printf(" * CONFIG_DEV_CONSOLE means that a builtin console device exists at /dev/console\n"); - printf(" * and can be opened during boot-up. Other consoles, such as USB consoles, may\n"); - printf(" * not exist at boot-upand have to be handled in a different way. Three file\n"); - printf(" * descriptors and three file streams are still needed.\n"); - printf(" */\n\n"); - printf("#if defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_CDCACM_CONSOLE) || \\\n"); - printf(" defined(CONFIG_PL2303_CONSOLE)\n"); - printf("# if CONFIG_NFILE_DESCRIPTORS < 3\n"); - printf("# undef CONFIG_NFILE_DESCRIPTORS\n"); - printf("# define CONFIG_NFILE_DESCRIPTORS 3\n"); - printf("# endif\n\n"); - printf("# if CONFIG_NFILE_STREAMS > 0 && CONFIG_NFILE_STREAMS < 3\n"); - printf("# undef CONFIG_NFILE_STREAMS\n"); - printf("# define CONFIG_NFILE_STREAMS 3\n"); - printf("# endif\n\n"); - printf("/* If no console is selected, then disable all builtin console devices */\n\n"); - printf("#else\n"); - printf("# undef CONFIG_DEV_LOWCONSOLE\n"); - printf("# undef CONFIG_RAMLOG_CONSOLE\n"); - printf("#endif\n\n"); - printf("/* If no file streams are configured, then make certain that buffered I/O\n"); printf(" * support is disabled\n"); printf(" */\n\n"); diff --git a/tools/mkromfsimg.sh b/tools/mkromfsimg.sh index e543f59892e..f8530718007 100755 --- a/tools/mkromfsimg.sh +++ b/tools/mkromfsimg.sh @@ -115,26 +115,13 @@ if [ "X$disablescript" = "Xy" ]; then exit 1 fi -# We need at least 2 file descriptors 1 for the ROMFS mount and one for -# FAT mount performed in rcS. That still wouldn't be enough to to do much -# with NSH +# We need at least 5 file descriptors: One for the ROMFS mount and one for +# FAT mount performed in rcS, plus three for stdio. -if [ -z "$ndescriptors" -o "$ndescriptors" -lt 2 ]; then - echo "No file descriptors have been allocated" - if [ "X$devconsole" = "Xy" ]; then - echo "Set CONFIG_NFILE_DESCRIPTORS to value greater than 4" - else - echo "Set CONFIG_NFILE_DESCRIPTORS to value greater than 1" - fi - exit 1 -fi - -# If a console is enabled, then three more file descriptors are required -# for stdin, stdout, and stderr - -if [ "X$devconsole" = "Xy" -a "$ndescriptors" -lt 5 ]; then +if [ -z "$ndescriptors" -o "$ndescriptors" -lt 5 ]; then echo "Insufficient file descriptors have been allocated" echo "Set CONFIG_NFILE_DESCRIPTORS to value greater than 4" + exit 1 fi # ROMFS support is required, of course