From be04158e4f2db8e4be4f6584e0733656a692251c Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 11 Feb 2008 05:48:05 +0000 Subject: [PATCH] [SIGAR-86] Add options field to sigar_file_system_t --- src/os/win32/win32_sigar.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/os/win32/win32_sigar.c b/src/os/win32/win32_sigar.c index c0b059b3..39dd60fb 100644 --- a/src/os/win32/win32_sigar.c +++ b/src/os/win32/win32_sigar.c @@ -1662,6 +1662,42 @@ int sigar_os_fs_type_get(sigar_file_system_t *fsp) return fsp->type; } +#ifndef FILE_READ_ONLY_VOLUME +#define FILE_READ_ONLY_VOLUME 0x00080000 +#endif +#ifndef FILE_NAMED_STREAMS +#define FILE_NAMED_STREAMS 0x00040000 +#endif +#ifndef FILE_SEQUENTIAL_WRITE_ONCE +#define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000 +#endif +#ifndef FILE_SUPPORTS_TRANSACTIONS +#define FILE_SUPPORTS_TRANSACTIONS 0x00200000 +#endif + +static void get_fs_options(char *opts, int osize, long flags) +{ + *opts = '\0'; + if (flags & FILE_READ_ONLY_VOLUME) strncat(opts, "ro", osize); + else strncat(opts, "rw", osize); +#if 0 /*XXX*/ + if (flags & FILE_CASE_PRESERVED_NAMES) strncat(opts, ",casepn", osize); + if (flags & FILE_CASE_SENSITIVE_SEARCH) strncat(opts, ",casess", osize); + if (flags & FILE_FILE_COMPRESSION) strncat(opts, ",fcomp", osize); + if (flags & FILE_NAMED_STREAMS) strncat(opts, ",streams", osize); + if (flags & FILE_PERSISTENT_ACLS) strncat(opts, ",acls", osize); + if (flags & FILE_SEQUENTIAL_WRITE_ONCE) strncat(opts, ",wronce", osize); + if (flags & FILE_SUPPORTS_ENCRYPTION) strncat(opts, ",efs", osize); + if (flags & FILE_SUPPORTS_OBJECT_IDS) strncat(opts, ",oids", osize); + if (flags & FILE_SUPPORTS_REPARSE_POINTS) strncat(opts, ",reparse", osize); + if (flags & FILE_SUPPORTS_SPARSE_FILES) strncat(opts, ",sparse", osize); + if (flags & FILE_SUPPORTS_TRANSACTIONS) strncat(opts, ",trans", osize); + if (flags & FILE_UNICODE_ON_DISK) strncat(opts, ",unicode", osize); + if (flags & FILE_VOLUME_IS_COMPRESSED) strncat(opts, ",vcomp", osize); + if (flags & FILE_VOLUME_QUOTAS) strncat(opts, ",quota", osize); +#endif +} + SIGAR_DECLARE(int) sigar_file_system_list_get(sigar_t *sigar, sigar_file_system_list_t *fslist) { @@ -1733,7 +1769,7 @@ SIGAR_DECLARE(int) sigar_file_system_list_get(sigar_t *sigar, SIGAR_SSTRCPY(fsp->sys_type_name, fsname); /* CDFS, NTFS, etc */ } - fsp->options[0] = '\0'; /*XXX*/ + get_fs_options(fsp->options, sizeof(fsp->options)-1, flags); ptr += strlen(ptr)+1; }