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

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

commit cd404ced5b1c490d457e40da9248a626f20b8b4e
Author: Marco Casaroli <[email protected]>
AuthorDate: Fri Oct 23 16:38:37 2026 +0200

    Documentation: Describe glob() and its flags.
    
    No page described glob() and globfree().  Add them to the file system
    interfaces, with the POSIX flags and the GLOB_TILDE extensions.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 Documentation/reference/user/10_filesystem.rst | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Documentation/reference/user/10_filesystem.rst 
b/Documentation/reference/user/10_filesystem.rst
index 2eb42f0895b..73208a50dd0 100644
--- a/Documentation/reference/user/10_filesystem.rst
+++ b/Documentation/reference/user/10_filesystem.rst
@@ -351,6 +351,31 @@ However, the following may also be considered as file 
system interfaces:
 .. c:function:: int mktemp(FAR char *template);
 .. c:function:: int mkstemp(FAR char *template);
 
+Pathname Pattern Matching (``glob.h``)
+--------------------------------------
+
+.. code-block:: c
+
+  #include <glob.h>
+
+  int  glob(FAR const char *pattern, int flags,
+            CODE int (*errfunc)(FAR const char *epath, int eerrno),
+            FAR glob_t *pglob);
+  void globfree(FAR glob_t *pglob);
+
+``glob()`` finds the pathnames that match ``pattern`` (the rules of
+``fnmatch()``) and puts them in ``pglob->gl_pathv``. The POSIX flags are
+``GLOB_APPEND``, ``GLOB_DOOFFS``, ``GLOB_ERR``, ``GLOB_MARK``,
+``GLOB_NOCHECK``, ``GLOB_NOESCAPE`` and ``GLOB_NOSORT``. Two extensions of
+other C libraries are also available:
+
+- ``GLOB_TILDE``: a ``~`` at the start of the pattern is the home directory
+  (``HOME``, else the home directory of the user in the password database),
+  and ``~name`` is the home directory of the user ``name``. When the home
+  directory is not known, the pattern is used as it is.
+- ``GLOB_TILDE_CHECK``: the same, but ``glob()`` returns ``GLOB_NOMATCH`` when
+  the home directory is not known.
+
 Asynchronous I/O
 ----------------
 

Reply via email to