aboutsummaryrefslogtreecommitdiff
path: root/win32/dirent.h
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2022-05-15 08:52:26 +0100
committerRon Yorston <rmy@pobox.com>2022-05-15 08:52:26 +0100
commit7fb95a2a569ca6d68dad4cef5b7b299e9fe68e2b (patch)
tree53e4d681990f6cc64b97e1f6d81f7e52cdb214bb /win32/dirent.h
parentb0696b94ab963fe0dd47f5c1ed6327a4337afa09 (diff)
downloadbusybox-w32-7fb95a2a569ca6d68dad4cef5b7b299e9fe68e2b.tar.gz
busybox-w32-7fb95a2a569ca6d68dad4cef5b7b299e9fe68e2b.tar.bz2
busybox-w32-7fb95a2a569ca6d68dad4cef5b7b299e9fe68e2b.zip
win32: try to get link count for directories
On Unix the link count of a directory reflects the number of subdirectories it contains. Enhance readdir(3) to return file types and use this to count subdirectories when stat(2) is called for a directory. As with other features that might slow down stat(2) this is controlled by the build-time setting FEATURE_EXTRA_FILE_DATA. (Commit d82db8e9a 'win32: make stat(2) fetch additional metadata'). (GitHub issue #254)
Diffstat (limited to 'win32/dirent.h')
-rw-r--r--win32/dirent.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/win32/dirent.h b/win32/dirent.h
index b38d0d133..214f80547 100644
--- a/win32/dirent.h
+++ b/win32/dirent.h
@@ -9,6 +9,9 @@ typedef struct DIR DIR;
9#define DT_LNK 3 9#define DT_LNK 3
10 10
11struct dirent { 11struct dirent {
12#if ENABLE_FEATURE_EXTRA_FILE_DATA
13 unsigned char d_type;
14#endif
12 char d_name[PATH_MAX]; // file name 15 char d_name[PATH_MAX]; // file name
13}; 16};
14 17