Re: New system call wanted: fdreopen

From: Kevin Easton
Date: Mon Dec 10 2012 - 05:29:20 EST


Quoting Tristan Wibberley <tristan.wibberley@xxxxxxxxx>:

Why
===

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.

Another alternative is to use pwrite() / pread(), which do not affect the file
pointer. They're in POSIX.

- Kevin


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/