aboutsummaryrefslogtreecommitdiff
path: root/win32/mntent.h
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-06-27 13:40:07 +0100
committerRon Yorston <rmy@pobox.com>2021-06-27 14:05:33 +0100
commit0fdf99bee07b6c38795eb5415b5e337ab82cfba8 (patch)
tree09409cdc12b08bd3e37c942738525666ed759a02 /win32/mntent.h
parent6d6856355aec9ed6c9b8039b9b1ec8f997395c9e (diff)
downloadbusybox-w32-0fdf99bee07b6c38795eb5415b5e337ab82cfba8.tar.gz
busybox-w32-0fdf99bee07b6c38795eb5415b5e337ab82cfba8.tar.bz2
busybox-w32-0fdf99bee07b6c38795eb5415b5e337ab82cfba8.zip
win32: changes to mntent implementation
Make the structure returned by getmntent(3) static so it persists after endmntent(3) closes the stream. No current caller in the WIN32 port needs this functionality but it's good to match the documented behaviour. Populate more fields of the mntent structure in find_mount_point(). This is required to support the df -t and -T flags recently added upstream. The static structures used here are allocated on demand. Separate static structures are used in each case because df iterates through mounts calling statfs(2) on each and the WIN32 implementation of statfs(2) calls find_mount_point().
Diffstat (limited to '')
-rw-r--r--win32/mntent.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/win32/mntent.h b/win32/mntent.h
index 8bdf3d45e..029f18b96 100644
--- a/win32/mntent.h
+++ b/win32/mntent.h
@@ -16,6 +16,18 @@ extern FILE *mingw_setmntent(void);
16extern struct mntent *getmntent(FILE *stream); 16extern struct mntent *getmntent(FILE *stream);
17extern int endmntent(FILE *stream); 17extern int endmntent(FILE *stream);
18 18
19# if defined(MNTENT_PRIVATE)
20struct mntdata {
21 struct mntent me;
22 char mnt_fsname[PATH_MAX];
23 char mnt_dir[4];
24 char mnt_type[100];
25 char mnt_opts[4];
26};
27
28extern int fill_mntdata(struct mntdata *data, int index);
29# endif
30
19#define setmntent(f, m) mingw_setmntent() 31#define setmntent(f, m) mingw_setmntent()
20 32
21#endif 33#endif