All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Adams <cmadams@hiwaay.net>
To: linux-kernel@vger.kernel.org
Subject: Re: New system call wanted: fdreopen
Date: Sun, 9 Dec 2012 13:37:33 -0600	[thread overview]
Message-ID: <20121209193733.GA15378@hiwaay.net> (raw)
In-Reply-To: <ka2982$ra3$1@ger.gmane.org>

Once upon a time, Tristan Wibberley  <tristan.wibberley@gmail.com> said:
>A common idiom on Linux is to open a file and keep the fd open so that 
>the underlying file can be unlinked from its directory. But if the file 
>needs to be read from several different parts of the codebase then due to 
>the file descriptor having exactly one read pointer those different parts 
>must be synchronised which is a relatively difficult task.

I think you can get similar behavior entirely in user space and in a
fashion portable to at least BSD systems.  You could fork() (which would
create a separate FD in the child), pass the FD back to the parent over
a socket, and then have the child exit.

-- 
Chris Adams <cmadams@hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.

  parent reply	other threads:[~2012-12-09 19:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-09 15:03 New system call wanted: fdreopen Tristan Wibberley
2012-12-09 16:27 ` Theodore Ts'o
2012-12-09 17:18   ` Tristan Wibberley
2012-12-09 19:37 ` Chris Adams [this message]
2012-12-09 20:47   ` Al Viro
2012-12-10 10:18 ` Kevin Easton

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=20121209193733.GA15378@hiwaay.net \
    --to=cmadams@hiwaay.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.