lkml.org 
[lkml]   [2012]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: New system call wanted: fdreopen
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.


\
 
 \ /
  Last update: 2012-12-09 21:21    [W:0.052 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site