This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 840bc5724a7 Documentation/nsh: Describe the ulimit command.
840bc5724a7 is described below

commit 840bc5724a7fb1ec1a23e8ba1e00188c3bd7a7b3
Author: Marco Casaroli <[email protected]>
AuthorDate: Sun Oct 18 20:15:07 2026 +0200

    Documentation/nsh: Describe the ulimit command.
    
    Describe the new NSH ulimit command and its CONFIG_NSH_DISABLE_ULIMIT
    option.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 Documentation/applications/nsh/commands.rst | 42 +++++++++++++++++++++++++++++
 Documentation/applications/nsh/config.rst   |  1 +
 2 files changed, 43 insertions(+)

diff --git a/Documentation/applications/nsh/commands.rst 
b/Documentation/applications/nsh/commands.rst
index 9ef0824e374..652e07bd5ed 100644
--- a/Documentation/applications/nsh/commands.rst
+++ b/Documentation/applications/nsh/commands.rst
@@ -2096,6 +2096,48 @@ If a <file-path> is larger than the specified size, the 
extra data is
 lost. If a <file-path> is shorter, it is extended and the extended part
 reads as zero bytes.
 
+.. _cmdulimit:
+
+``ulimit`` Show or Set Resource Limits
+======================================
+
+**Command Syntax**::
+
+  ulimit [-H|-S] [-a|-c|-d|-f|-l|-n|-s|-t|-v] [<limit>|unlimited]
+
+**Synopsis**. Show or set a resource limit of NSH. The programs that NSH
+starts get the same limits. Without ``<limit>``, ``ulimit`` shows the soft
+limit, or the hard limit with ``-H``. With ``<limit>``, it sets the soft
+limit with ``-S``, the hard limit with ``-H``, and both without these
+options. Sizes are in KiB, ``-n`` is a number of files and ``-t`` is in
+seconds. Without a resource option, ``ulimit`` uses ``-f``, as POSIX says.
+NuttX enforces ``-n`` and ``-s`` only; setting another limit fails.
+
+**Options**
+
+======  ======================================================
+``-H``  The hard limit.
+``-S``  The soft limit.
+``-a``  Show all limits.
+``-c``  Core file size.
+``-d``  Data segment size.
+``-f``  File size.
+``-l``  Locked memory size.
+``-n``  Number of open files.
+``-s``  Stack size: the default stack size of new threads and
+        programs.
+``-t``  CPU time.
+``-v``  Virtual memory size.
+======  ======================================================
+
+**Example**::
+
+  nsh> ulimit -S -s 64
+  nsh> ulimit -s
+  64
+  nsh> ulimit -H -s
+  unlimited
+
 .. _cmdumount:
 
 ``umount`` Unmount a File System
diff --git a/Documentation/applications/nsh/config.rst 
b/Documentation/applications/nsh/config.rst
index 31816b97981..01e4bcae1b2 100644
--- a/Documentation/applications/nsh/config.rst
+++ b/Documentation/applications/nsh/config.rst
@@ -134,6 +134,7 @@ Command                Depends on Configuration             
       Can Be Disabl
 :ref:`cmdtest`         !  ``CONFIG_NSH_DISABLESCRIPT``             
``CONFIG_NSH_DISABLE_TEST``
 :ref:`cmdtime`         .                                           
``CONFIG_NSH_DISABLE_TIME``
 :ref:`cmdtruncate`     ! ``CONFIG_DISABLE_MOUNTPOINT``             
``CONFIG_NSH_DISABLE_TRUNCATE``
+:ref:`cmdulimit`       .                                           
``CONFIG_NSH_DISABLE_ULIMIT``
 :ref:`cmdumount`       !  ``CONFIG_DISABLE_MOUNTPOINT``            
``CONFIG_NSH_DISABLE_UMOUNT``
 :ref:`cmduname`        .                                           
``CONFIG_NSH_DISABLE_UNAME``
 :ref:`cmdunset`        ``CONFIG_NSH_VARS`` \|\|                    
``CONFIG_NSH_DISABLE_UNSET``

Reply via email to