aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2012-05-15 14:04:17 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2012-05-15 14:04:17 -0700
commit761b6499b9f9d333ef4860e95d1e2539c0326ec3 (patch)
tree60b559ede524249b86749ed5755eab78b0a56ed1
parente63d2ad42dc930e453b39cd5c27b30554d5ba6ec (diff)
downloadklibc-761b6499b9f9d333ef4860e95d1e2539c0326ec3.tar.gz
[klibc] readdir(): use _KLIBC_BUFSIZ to size the dirent buffer
If _KLIBC_BUFSIZ is good enough for stdio it should be good enough for readdir() too... Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--usr/include/dirent.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr/include/dirent.h b/usr/include/dirent.h
index 725452e45ee5e..d36e9749d71fe 100644
--- a/usr/include/dirent.h
+++ b/usr/include/dirent.h
@@ -6,6 +6,7 @@
#define _DIRENT_H
#include <klibc/extern.h>
+#include <klibc/sysconfig.h>
#include <sys/dirent.h>
struct _IO_dir {
@@ -17,7 +18,7 @@ struct _IO_dir {
size_t bytes_left;
struct dirent *next;
/* Declaring this as an array of struct enforces correct alignment */
- struct dirent buffer[15]; /* 15 times max dirent size =~ 4K */
+ struct dirent buffer[_KLIBC_BUFSIZ / sizeof(struct dirent)];
#endif
};
typedef struct _IO_dir DIR;