Date: Mon, 5 Apr 1999 11:34:35 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Robert Watson <robert@cyrus.watson.org> Cc: Terry Lambert <terry@whistle.com>, current@FreeBSD.ORG Subject: Re: aio_read Message-ID: <199904051834.LAA11656@apollo.backplane.com> References: <Pine.BSF.3.96.990405141834.22049D-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
:
:This was not my impression; I thought that children had their own
:descriptor entries on a per-process basis, but that they all pointed to
:the same open file entry when inherited. I was contemplating adding a
They do indeed point to the same file entry. Also, when you dup() a
descriptor the two descriptors are pointing to the same file entry.
This means that they share the same seek offset... seeking in one
descriptor changes the seek position in the other descriptor and even
the other descriptor in the other process.
UNIX has been broken this way from day 1. It was a major design mistake.
The only way to get your own descriptor seek offset is to open() the
file again.
The aio stuff gets around this by introducing a seek offset in the
syscall, but historical use of the file descriptor seek offset broke
aio's syscall-based offset. Alan has committed fixes to much of the
historical code (in vn_read() and vn_write()) that should mean that
aio offsets now work, but I haven't tested it myself.
-Matt
Matthew Dillon
<dillon@backplane.com>
: Robert N Watson
:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904051834.LAA11656>
