Re: [PATCH] Proper fallback for systems that lacks O_CLOEXEC (was: [PATCH 12/14] lib: provide mkostemp fallback function)

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

 



On Friday 26 February 2016 15:51:28 Yuriy M. Kaminskiy wrote:
> yumkam@xxxxxxxxx (Yuriy M. Kaminskiy)
>
> writes:
> > Ruediger Meier <sweet_f_a@xxxxxx> writes:
> >> From: Ruediger Meier <ruediger.meier@xxxxxxxxxxx>
>
> [...]
>
> > `O_CREAT`, etc; most notable, `O_CLOEXEC`; however, if `O_CLOEXEC` is
> > missing on system, "c.h" defines it as 0, so it is silently ignored on
> > those systems, instead of being emulated; so, whenever it matters,
> > callers must call **both** `open(O_CLOEXEC)` and
> > `fcntl(F_SETFD,FD_CLOEXEC)`]).
>
> ... something like attached below. In some cases it is maybe
> unnecessary, but better safe than sorry.

I'm not sure whether we should add all these fcntl lines just for a few old 
non-Linux systems. That's probably why Karel simply added quick and dirty 
this unsafe fallback defining O_CLOEXEC to 0.

We are using this fallback already since 2011 and and now 2016 we have even 
less systems where O_CLOEXEC is not available. BTW we are using mkostemp 
(which is a real showstopper for the build!) since 3 years and nobody 
complained. I assume any system with mkostemp will also have O_CLOEXEC.

I'm going to add another hopefully correct patch for case mkostemp only.

cu,
Rudi
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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