Re: [PATCH v2] flock: add support for using fcntl() with open file description locks

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

 



On Thu, Apr 25, 2024 at 09:36:06AM +0200, Rasmus Villemoes wrote:
> Hm, actually, since the values of F_OFD_ are the same across all
> architectures, and the API is pretty old already, I think it would be
> simpler to just drop the configure time probing and all the HAVE_
> guards, and simply add five lines
> 
> #ifndef F_OFD_GETLK
> #define F_OFD_GETLK     36
> #define F_OFD_SETLK     37
> #define F_OFD_SETLKW    38
> #endif
> 
> after the #include s. After all, whether or not the constants are in the
> headers util-linux is being built against doesn't really say whether the
> kernel it ends up being run on has support or not. Then I'll just
> include a note in the documentation that use of --fcntl only works on
> kernels >= 3.14 (besides, it would be really cumbersome, maybe even
> impossible, to have the man page not mention --fcntl even if flock was
> built without that option in its --help output).

I agree, it is usually better to not affect the --help output and
options parsing (using getopt_long() functions) with #ifdefs.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com





[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux