public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] man/man3/opendir.3: document that long file names result in ENAMETOOLONG
@ 2025-10-17  8:18 Collin Funk
  2025-10-17  8:45 ` Jakub Wilk
  0 siblings, 1 reply; 4+ messages in thread
From: Collin Funk @ 2025-10-17  8:18 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: Collin Funk, linux-man

This behavior can be see with the following example program:

    $ cat main.c
    #include <string.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <dirent.h>
    #include <errno.h>
    int
    main (int argc, char **argv)
    {
      if (argc < 2)
        return EXIT_FAILURE;
      DIR *dir = opendir (argv[1]);
      if (dir == NULL)
        {
          fprintf (stderr, "%s\n", strerror (errno));
          return EXIT_FAILURE;
        }
      closedir (dir);
      return EXIT_SUCCESS;
    }
    $ gcc main.c
    $ mkdir -p `python3 -c 'print("./" + "a/" * 32768)'`
    $ ./a.out `python3 -c 'print("./" + "a/" * 32768)'`
    File name too long

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
---
 man/man3/opendir.3 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/man/man3/opendir.3 b/man/man3/opendir.3
index a9af16269..6a5c7880f 100644
--- a/man/man3/opendir.3
+++ b/man/man3/opendir.3
@@ -73,6 +73,10 @@ .SH ERRORS
 .B EMFILE
 The per-process limit on the number of open file descriptors has been reached.
 .TP
+.B ENAMETOOLONG
+.I name
+was too long.
+.TP
 .B ENFILE
 The system-wide limit on the total number of open files has been reached.
 .TP
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-29  0:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17  8:18 [PATCH] man/man3/opendir.3: document that long file names result in ENAMETOOLONG Collin Funk
2025-10-17  8:45 ` Jakub Wilk
2025-10-28 23:37   ` Alejandro Colomar
2025-10-29  0:29     ` Collin Funk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox