From owner-freebsd-current Mon Apr 5 11:36:35 1999 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (Postfix) with ESMTP id 730F6153F1 for ; Mon, 5 Apr 1999 11:36:34 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id LAA11656; Mon, 5 Apr 1999 11:34:35 -0700 (PDT) (envelope-from dillon) Date: Mon, 5 Apr 1999 11:34:35 -0700 (PDT) From: Matthew Dillon Message-Id: <199904051834.LAA11656@apollo.backplane.com> To: Robert Watson Cc: Terry Lambert , current@FreeBSD.ORG Subject: Re: aio_read References: Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG : :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 : Robert N Watson : To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message