Add runtime handlers for 97900ebf for FreeBSD/DragonFlyBSD
authorTomohiro Kusumi <tkusumi@tuxera.com>
Tue, 7 Mar 2017 20:12:52 +0000 (22:12 +0200)
committerJens Axboe <axboe@fb.com>
Fri, 10 Mar 2017 21:43:37 +0000 (14:43 -0700)
As 97900ebf itself explains, this is a runtime tunable on FreeBSD
and DragonFlyBSD, so they need to check the sysctl on runtime.

Not sure if OpenBSD has any tunable for this as the original commit
only says about >=5.1, but afaik recent versions of OpenBSD can't
even compile fio anyway. Also not sure how it works on NetBSD, and
the original commit said nothing about it too. Also see below url.

http://www.spinics.net/lists/fio/msg05586.html
http://www.spinics.net/lists/fio/msg05588.html

--
 # uname -r
 11.0-RELEASE-p1
 # cat ./test1.c
 #include <stdio.h>
 #include "./os/os-freebsd.h"
 int main(void) {
         printf("%d\n", shm_attach_to_open_removed());
         return 0;
 }
 # clang -Wall -g ./test1.c
 # sysctl kern.ipc.shm_allow_removed
 kern.ipc.shm_allow_removed: 1
 # ./a.out
 1
 # sysctl kern.ipc.shm_allow_removed=123
 kern.ipc.shm_allow_removed: 1 -> 123
 # ./a.out
 1
 # sysctl kern.ipc.shm_allow_removed=0
 kern.ipc.shm_allow_removed: 123 -> 0
 # ./a.out
 0

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>

No differences found