diff options
author | Ron Yorston <rmy@pobox.com> | 2022-05-15 08:52:26 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2022-05-15 08:52:26 +0100 |
commit | 7fb95a2a569ca6d68dad4cef5b7b299e9fe68e2b (patch) | |
tree | 53e4d681990f6cc64b97e1f6d81f7e52cdb214bb /win32/dirent.h | |
parent | b0696b94ab963fe0dd47f5c1ed6327a4337afa09 (diff) | |
download | busybox-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.h | 3 |
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 | ||
11 | struct dirent { | 11 | struct 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 | ||