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

Re: Bug#677865: Re: Bug#677865: dpkg-gencontrol warns about 'File::FcntlLock not available'



Hi,

On Fri, May 16, 2014 at 11:06:17PM +0300, Niko Tyni wrote:
> > > Unfortunately, I also
> > > don't see any way to do things without XS since the flock
> > > structure that must be passed to fcntl(2) can be quite dif-
> > > ferent on different systems, both concerning the number and
> > > ordering of its members as well as the sizes of them:-( I
> > > would love to hear ideas on how to do it differently, i.e.
> > > with Perl-only methods!
> 
> Would it be possible to probe for the contents of the flock struct with C
> code at build time, and then use that information to write out a pure perl
> module that regenerates the structs at run time (probably with pack())?
> 
> It would still be architecture dependent (and thus go in
> vendorarch/sitearch) but it wouldn't need a rebuild across Perl upgrades.

It should be possible to write a C program that determines the
relevant bits of the structure (i.e., overall size, positions
and sizes of the relevant members) and, given that information,
one should be able to automatically write out a pure Perl module.
Good idea! Never considered that since I thought when having to
use the C compiler anyway XS is the way to go (and it makes things
a bit easier). If you think this will help I'll give it a try!

                           Best regards, Jens
-- 
  \   Jens Thoms Toerring  ________      jt@toerring.de
   \_______________________________      http://toerring.de


Reply to: