Asynchronous File I/O on Linux
Jerry Feldman
gaf-mNDKBlG2WHs at public.gmane.org
Sun May 16 08:17:00 EDT 2010
I found a nice reference:
http://davmac.org/davpage/linux/async-io.html
Asynchronous I/O on linux
or: Welcome to hell.
If I recall, Linus has always been against asynchronous I/O in Linux.
The bottom line here is that all I/O file I/O goes through the file
system's driver.
On 05/15/2010 11:11 PM, Bill Bogstad wrote:
> On Sat, May 15, 2010 at 5:56 PM, Mark Woodward <markw-FJ05HQ0HCKaWd6l5hS35sQ at public.gmane.org> w=
rote:
> =20
>> Bill Bogstad wrote:
>> =20
> =20
>> OK, so, the methodology is quite similar, fine. Now the question remai=
ns, is
>> it possible to quickly "clone" an existing file handle so that it will=
be a
>> new and distinct file handle with the same permissions and modes with =
its
>> own distict view of current location, i.e. seek on one does not affect=
seek
>> on the other?
>> =20
> The closest that I can think of involves /proc/self/fd. It doesn't
> do same permissions/modes, but does
> give you different seek pointers. I suspect it only works with
> seekable (i.e. disk file) file descriptors...
>
> /* crappy (uncompiled) code follows */
> sprintf(bigbuf, "/proc/self/fd/%d", oldfd);
> newfd =3D open(bigbuf, flags);
>
> =20
--=20
Jerry Feldman <gaf-mNDKBlG2WHs at public.gmane.org>
Boston Linux and Unix
PGP key id: 537C5846
PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB CA3B 4607 4319 537C 5846
More information about the Discuss
mailing list