On Debian GNU/kFreeBSD (FreeBSD kernel plus glibc), the BSD flavour of
sendfile is not usable (struct sf_hdtr is declared with -D_BSD_SOURCE=1,
but has no definition), and the Linux flavour doesn't work either since
MSG_MORE is absent. However, the fallback version works fine.
Unfortunately, Cabal treats kfreebsdgnu as os(freebsd), and
os(kfreebsdgnu) doesn't work. So, to make it possible to select the
fallback implementation on GNU/kFreeBSD, I believe a flag is necessary.
On Debian GNU/kFreeBSD (FreeBSD kernel plus glibc), the BSD flavour of sendfile is not usable (struct sf_hdtr is declared with -D_BSD_SOURCE=1, but has no definition), and the Linux flavour doesn't work either since MSG_MORE is absent. However, the fallback version works fine.
Unfortunately, Cabal treats kfreebsdgnu as os(freebsd), and os(kfreebsdgnu) doesn't work. So, to make it possible to select the fallback implementation on GNU/kFreeBSD, I believe a flag is necessary.