aboutsummaryrefslogtreecommitdiff
path: root/win32/dirent.h
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-06-13 08:13:25 +0100
committerRon Yorston <rmy@pobox.com>2021-06-13 08:13:25 +0100
commitf7e4fe39a69b82bcef1aaa68111ccfa68b209ada (patch)
tree23d63dd3d27f4fdb6e475c35e348b3c8299e6e6c /win32/dirent.h
parentcfac1da2aaccaf45a669b0a53c82a32c8231827c (diff)
downloadbusybox-w32-f7e4fe39a69b82bcef1aaa68111ccfa68b209ada.tar.gz
busybox-w32-f7e4fe39a69b82bcef1aaa68111ccfa68b209ada.tar.bz2
busybox-w32-f7e4fe39a69b82bcef1aaa68111ccfa68b209ada.zip
win32: add local dirent implementation
Add a cut down version of the dirent implementation from git. The git developers said: The mingw-runtime implemenation of opendir, readdir and closedir sets errno to 0 on success, something that POSIX explicitly forbids. This also avoids having to link against libssp.a (commit 13eb34205) and reduces the size of the binary by 2KB.
Diffstat (limited to 'win32/dirent.h')
-rw-r--r--win32/dirent.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/win32/dirent.h b/win32/dirent.h
new file mode 100644
index 000000000..b38d0d133
--- /dev/null
+++ b/win32/dirent.h
@@ -0,0 +1,19 @@
1#ifndef DIRENT_H
2#define DIRENT_H
3
4typedef struct DIR DIR;
5
6#define DT_UNKNOWN 0
7#define DT_DIR 1
8#define DT_REG 2
9#define DT_LNK 3
10
11struct dirent {
12 char d_name[PATH_MAX]; // file name
13};
14
15DIR *opendir(const char *dirname);
16struct dirent *readdir(DIR *dir);
17int closedir(DIR *dir);
18
19#endif /* DIRENT_H */