From: Tomohiro Kusumi Date: Mon, 17 Oct 2016 14:17:41 +0000 (+0900) Subject: Add device_is_mounted() support for NetBSD X-Git-Tag: fio-2.15~12 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=b765bec0be97ef05e5af6cfbf4e0a2c8b7596a03;hp=b765bec0be97ef05e5af6cfbf4e0a2c8b7596a03 Add device_is_mounted() support for NetBSD This commit is NetBSD version of e7e136da in 2015. It's basically the same as the one for FreeBSD/DragonFlyBSD, but NetBSD takes statvfs instead of statfs, so I had to add CONFIG_GETMNTINFO_STATVFS to differentiate from CONFIG_GETMNTINFO. It could be renamed if there is any better name, as it sounds strange. compile_prog() takes -Werror for local CFLAGS. Without -Werror, the existing getmntinfo(3) test code for FreeBSD/DragonFlyBSD only gives a warning on NetBSD and results in trying to compile wrong device_is_mounted(). (The reason this hasn't been reported as a problem is because of the ./configure bug fixed by the previous commit. It fails to compile the test code unless st is a pointer.) The remaining one, OpenBSD seems to have the same interface as FreeBSD/DragonFlyBSD, so the existing test code will probably work, but fio doesn't compile on OpenBSD 5.9 due to other compile time errors (lex error) that have nothing to do with this. -- # uname NetBSD # cat ./test1.c #include #include "./lib/mountcheck.h" int main(int argc, char *argv[]) { printf("%s %d\n", argv[1], device_is_mounted(argv[1])); return 0; } # gcc -Wall -g ./test1.c ./lib/mountcheck.o -o ./test1 # ./test1 /dev/wd0a /* UFS */ /dev/wd0a 1 # ./test1 procfs /* procfs */ procfs 1 # ./test1 tmpfs /* tmpfs */ tmpfs 1 # ./test1 invalid /* irrelevant string */ invalid 0 Signed-off-by: Tomohiro Kusumi Signed-off-by: Jens Axboe ---