From a7127af09b6fd6ff3b389c268e32a88b184b3145 Mon Sep 17 00:00:00 2001 From: chao an Date: Wed, 15 Jan 2025 09:56:44 +0800 Subject: [PATCH 1/2] Documentation: clean up of CONFIG_NSH_LINELEN define Signed-off-by: chao an --- Documentation/applications/nsh/config.rst | 3 --- Documentation/guides/pysimcoder.rst | 2 +- Documentation/platforms/sim/sim/boards/sim/index.rst | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Documentation/applications/nsh/config.rst b/Documentation/applications/nsh/config.rst index 93a0b19571e0a..b58571676585f 100644 --- a/Documentation/applications/nsh/config.rst +++ b/Documentation/applications/nsh/config.rst @@ -202,9 +202,6 @@ Configuration Description setting is *y*. This setting depends upon the ``strerror()`` having been enabled with ``CONFIG_LIBC_STRERROR``. - ``CONFIG_NSH_LINELEN`` The maximum length of one command line and of one output line. - Default: 80 - ``CONFIG_NSH_DISABLE_SEMICOLON`` By default, you can enter multiple NSH commands on a line with each command separated by a semicolon. You can disable this feature to save a little memory on FLASH challenged platforms. diff --git a/Documentation/guides/pysimcoder.rst b/Documentation/guides/pysimcoder.rst index a117fbafa4d3d..b3a2c7720b4e8 100644 --- a/Documentation/guides/pysimcoder.rst +++ b/Documentation/guides/pysimcoder.rst @@ -47,7 +47,7 @@ with NuttX. The list is the following: ==================================== ===================================== ``CONFIG_ARCH_RAMVECTORS=y`` ``CONFIG_NSH_FILE_APPS=y`` -``CONFIG_BOARDCTL_APP_SYMTAB=y`` ``CONFIG_NSH_LINELEN=64`` +``CONFIG_BOARDCTL_APP_SYMTAB=y`` ``CONFIG_LINE_MAX=64`` ``CONFIG_BOARDCTL_OS_SYMTAB=y`` ``CONFIG_NSH_READLINE=y`` ``CONFIG_BUILTIN=y`` ``CONFIG_ETC_ROMFS=y`` ``CONFIG_ELF=y`` ``CONFIG_PSEUDOTERM=y`` diff --git a/Documentation/platforms/sim/sim/boards/sim/index.rst b/Documentation/platforms/sim/sim/boards/sim/index.rst index f3e3abb717e6e..7954973d761e8 100644 --- a/Documentation/platforms/sim/sim/boards/sim/index.rst +++ b/Documentation/platforms/sim/sim/boards/sim/index.rst @@ -1049,7 +1049,7 @@ NOTES - +sleep(2); // REMOVE ME +#if 0 // REMOVE ME - ret = readline(pstate->cn_line, CONFIG_NSH_LINELEN, + ret = readline(pstate->cn_line, LINE_MAX, INSTREAM(pstate), OUTSTREAM(pstate)); if (ret > 0) @@ -153,6 +155,7 @@ From 9cb011ce2f4445cad830b5c5abb8464bc1dda5fd Mon Sep 17 00:00:00 2001 From: chao an Date: Wed, 15 Jan 2025 10:02:38 +0800 Subject: [PATCH 2/2] libc/unistd: move NAME_MAX/LINE_MAX/PATH_MAX define to unistd These options are unistd-specific and should not be filesystem dependent, and also not suitable for define in the sched directory. Signed-off-by: chao an --- libs/libc/unistd/Kconfig | 22 ++++++++++++++++++++++ sched/Kconfig | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/libs/libc/unistd/Kconfig b/libs/libc/unistd/Kconfig index 1c1ee3e1ee865..be16a529ef5f1 100644 --- a/libs/libc/unistd/Kconfig +++ b/libs/libc/unistd/Kconfig @@ -117,3 +117,25 @@ config LIBC_OPEN_MAX ---help--- The maximum number of files that a process can have open at any time. Must not be less than _POSIX_OPEN_MAX. + +config NAME_MAX + int "Maximum size of a file name" + default 32 + ---help--- + The maximum size of a file name. + +config PATH_MAX + int "Maximum size of path name" + default 256 + ---help--- + The maximum size of path name. + +config LINE_MAX + int "Maximum size of line" + default 64 if DEFAULT_SMALL + default 80 if !DEFAULT_SMALL + ---help--- + The maximum size of line. Unless otherwise noted, the maximum length, in bytes, + of a utility's input line (either standard input or another file), when the + utility is described as processing text files. The length includes room for + the trailing newline. diff --git a/sched/Kconfig b/sched/Kconfig index e9eaf21fc587b..9350b8db0f0f7 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -1400,28 +1400,6 @@ config FILE_STREAM ---help--- Enable the standard buffered input/output support -config NAME_MAX - int "Maximum size of a file name" - default 32 - ---help--- - The maximum size of a file name. - -config PATH_MAX - int "Maximum size of path name" - default 256 - ---help--- - The maximum size of path name. - -config LINE_MAX - int "Maximum size of line" - default 64 if DEFAULT_SMALL - default 80 if !DEFAULT_SMALL - ---help--- - The maximum size of line. Unless otherwise noted, the maximum length, in bytes, - of a utility's input line (either standard input or another file), when the - utility is described as processing text files. The length includes room for - the trailing newline. - endmenu # Files and I/O menuconfig PRIORITY_INHERITANCE