[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Port insserv to kfreebsd?



Hi!

[ Redirecting to debian-bsd as glibc-bsd-devel is not used anymore,
  and reinclucing the whole initial mail in quotes for context. ]

On Sun, 2009-06-28 at 13:27:50 +0200, Petter Reinholdtsen wrote:
> [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"

posix_fadvise is optional per POSIX, so checking that that builds if
you use autoconf or for the macro is better. You should also probably
return ENOSYS instead.

regards,
guillem


Reply to: