Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: close-on-exec internal file descriptors
Date: Sat, 06 Dec 2008 15:26:00 -0000	[thread overview]
Message-ID: <20081206152551.GA3047@caradoc.them.org> (raw)
In-Reply-To: <m3skp2w32i.fsf@fleche.redhat.com>

On Fri, Dec 05, 2008 at 05:38:13PM -0700, Tom Tromey wrote:
> +/* Like open, but ensure that the resulting file descriptor is marked
> +   close-on-exec, if possible.  */
> +int
> +open_cloexec (const char *path, int flags, int mode)
> +{
> +#ifdef O_CLOEXEC
> +  return open (path, flags | O_CLOEXEC, mode);

If you build with headers that include O_CLOEXEC support, but the
running kernel is too old, will this fail to open entirely?  Or are
unknown open flags ignored?

Also, WDYT about separating the goal from the mechanism?  With this
patch, every bit of gdb knows "we close file descriptors on exec";
if it was gdb_open, it would just be "gdb-specific version of open".

-- 
Daniel Jacobowitz
CodeSourcery


  parent reply	other threads:[~2008-12-06 15:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-06  0:39 Tom Tromey
2008-12-06  8:14 ` Eli Zaretskii
2008-12-06 15:58   ` Tom Tromey
2008-12-06 16:52     ` Daniel Jacobowitz
2008-12-06 17:05       ` Eli Zaretskii
2008-12-06 16:54     ` Eli Zaretskii
2008-12-06 15:26 ` Daniel Jacobowitz [this message]
2008-12-06 15:59   ` Tom Tromey
2008-12-06 15:42 ` Mark Kettenis
2008-12-06 22:06   ` Tom Tromey
2008-12-07 19:26     ` Mark Kettenis

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=20081206152551.GA3047@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.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