[Petter Reinholdtsen]
Hi. I notice that the latest insserv package fail to build on
kfreebsd, because several posix_fadvise() arguments are unknown. The
code in question is protected with #ifdefs like this:
#if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 600
else if ((dfd = dirfd(rcdir)) != 0) {
(void)posix_fadvise(dfd, 0, 0, POSIX_FADV_WILLNEED);
(void)posix_fadvise(dfd, 0, 0, POSIX_FADV_SEQUENTIAL);
}
#endif
Why is this test not sufficient on kfreebsd? Can any of you provide
patches to get insserv working on kfreebsd? I hope to make
dependency based boot sequencing a core part of the boot system in
Debian and then insserv should work on all archs.
I made this patch based on the changes done to startpar in sysvinit,
but fail to understand why this is needed. Can anyone confirm that
this work on kfreebsd?
--- insserv-1.12.0.orig/insserv.c
+++ insserv-1.12.0/insserv.c
@@ -40,6 +40,13 @@
#endif /* USE_RPMLIB */
#include "listing.h"
+#if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 600
+/* kfreebsd fail to provide working posix_fadvise
+# ifndef POSIX_FADV_SEQUENTIAL
+# define posix_fadvise(fd, off, len, adv) (-1)
+# endif
+#endif
+
#ifdef SUSE
# define DEFAULT_START_LVL "3 5"
# define DEFAULT_STOP_LVL "3 5"