public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: Jamie Lokier <jamie@shareable.org>
Cc: "linux-kern >> Linux Kernel" <linux-kernel@vger.kernel.org>
Subject: Re: For the almost 4-year anniversary: O_CLOEXEC again
Date: Mon, 29 Mar 2004 10:59:08 -0800	[thread overview]
Message-ID: <406871FC.1070700@redhat.com> (raw)
In-Reply-To: <20040329131819.GF4984@mail.shareable.org>

Jamie Lokier wrote:

> Since O_CLOEXEC is non-portable, why not implement the per-thread
> switch?
> 
> Signal handlers that call open() will have to be aware of it, but
> that's ok: an application will only set the switch if it knows what
> that implies.

It's not OK since library functions can install signal handlers and they
need not be aware of everything the application does.

Any globally visible change in the behavior can have negative effects.

Yes, there are other calls but open() is far more critical since it is
now promoted not only to an interface to actually do work.  We are
supported to read kernel and system informatino from /proc which
requires open().

And no, oen() is not the only signal-safe function.  If you don't have
the POSIX specs handy, look at a recent signal(2) man page which lists
the signal-safe functions.  accept(), socket() are on the list among others.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

      reply	other threads:[~2004-03-29 18:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-29  1:34 For the almost 4-year anniversary: O_CLOEXEC again Ulrich Drepper
2004-03-29  3:14 ` Davide Libenzi
2004-03-29  4:23 ` dean gaudet
2004-03-29 13:18 ` Jamie Lokier
2004-03-29 18:59   ` Ulrich Drepper [this message]

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=406871FC.1070700@redhat.com \
    --to=drepper@redhat.com \
    --cc=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    /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