Util-Linux package development
 help / color / mirror / Atom feed
From: "Rüdiger Meier" <sweet_f_a@gmx.de>
To: "Yuriy M. Kaminskiy" <yumkam@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH] Proper fallback for systems that lacks O_CLOEXEC (was: [PATCH 12/14] lib: provide mkostemp fallback function)
Date: Sat, 27 Feb 2016 20:40:09 +0100	[thread overview]
Message-ID: <201602272040.09740.sweet_f_a@gmx.de> (raw)
In-Reply-To: <m3y4a7msnj.fsf_-_@gmail.com>

On Friday 26 February 2016 15:51:28 Yuriy M. Kaminskiy wrote:
> yumkam@gmail.com (Yuriy M. Kaminskiy)
>
> writes:
> > Ruediger Meier <sweet_f_a@gmx.de> writes:
> >> From: Ruediger Meier <ruediger.meier@ga-group.nl>
>
> [...]
>
> > `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

  reply	other threads:[~2016-02-27 19:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26  3:03 [PATCH 00/14] some fixes, cleanup and portability issues Ruediger Meier
2016-02-26  3:03 ` [PATCH 01/14] logger: use SCM_CREDENTIALS on LINUX only Ruediger Meier
2016-02-26  3:03 ` [PATCH 02/14] build-sys: add openat build conditional Ruediger Meier
2016-02-26  3:03 ` [PATCH 03/14] fdisk: fix warning, incompatible pointer types passing 'uint64_t *' Ruediger Meier
2016-02-26  3:03 ` [PATCH 04/14] libsmartcols: fix uninitialized variable Ruediger Meier
2016-02-26  3:03 ` [PATCH 05/14] misc: fix some includes Ruediger Meier
2016-02-26 11:37   ` Ruediger Meier
2016-02-26  3:03 ` [PATCH 06/14] newgrp: rename memset_s() Ruediger Meier
2016-02-26 12:29   ` Yuriy M. Kaminskiy
2016-02-26 12:47     ` Ruediger Meier
2016-02-26  3:03 ` [PATCH 07/14] build-sys: build_init should check for flock Ruediger Meier
2016-02-26  3:03 ` [PATCH 08/14] login-utils: minor utmp cleanup Ruediger Meier
2016-02-26  3:03 ` [PATCH 09/14] build-sys: disable login-utils if shadow.h or utmp.h is missing Ruediger Meier
2016-02-26  3:08 ` [PATCH 10/14] build-sys: add --disable-ipcrm --disable-ipcs Ruediger Meier
2016-02-26  3:08   ` [PATCH 11/14] build-sys: chrt requires a sched_set* function Ruediger Meier
2016-02-26  3:08   ` [PATCH 12/14] lib: provide mkostemp fallback function Ruediger Meier
2016-02-26 12:51     ` Yuriy M. Kaminskiy
2016-02-26 13:50       ` Ruediger Meier
2016-02-26 14:51       ` [PATCH] Proper fallback for systems that lacks O_CLOEXEC (was: [PATCH 12/14] lib: provide mkostemp fallback function) Yuriy M. Kaminskiy
2016-02-27 19:40         ` Rüdiger Meier [this message]
2016-03-07 13:50         ` Karel Zak
2016-02-27 20:02     ` [PATCH v2 12/14] lib: provide fallback if mkostemp(3) missing Ruediger Meier
2016-02-26  3:08   ` [PATCH 13/14] build-sys: remove duplicate cal sources Ruediger Meier
2016-02-26  3:08   ` [PATCH 14/14] lib: include strutils.h for mempcpy() Ruediger Meier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201602272040.09740.sweet_f_a@gmx.de \
    --to=sweet_f_a@gmx.de \
    --cc=util-linux@vger.kernel.org \
    --cc=yumkam@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox