We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 797799d commit 161a35dCopy full SHA for 161a35d
1 file changed
getdents/_getdents.c
@@ -4,6 +4,7 @@
4
#include <stddef.h>
5
#include <stdbool.h>
6
#include <stdio.h>
7
+#include <limits.h>
8
#include <unistd.h>
9
#include <stdlib.h>
10
#include <sys/stat.h>
@@ -32,7 +33,11 @@ struct getdents_state {
32
33
#endif
34
35
#ifndef MIN_GETDENTS_BUFF_SIZE
-# define MIN_GETDENTS_BUFF_SIZE (MAXNAMLEN + sizeof(struct linux_dirent64))
36
+# ifdef NAME_MAX
37
+# define MIN_GETDENTS_BUFF_SIZE (NAME_MAX + sizeof(struct linux_dirent64))
38
+# else
39
+# define MIN_GETDENTS_BUFF_SIZE (MAXNAMLEN + sizeof(struct linux_dirent64))
40
+# endif
41
42
43
static PyObject *
0 commit comments