From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Sat, 5 Dec 2009 15:03:44 -0500 To: 9fans@9fans.net Message-ID: In-Reply-To: <<20091205194741.0697D5B76@mail.bitblocks.com>> References: <<20091205194741.0697D5B76@mail.bitblocks.com>> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] ideas for helpful system io functions Topicbox-Message-UUID: a8c3ea2a-ead5-11e9-9d60-3106f5b1d025 > The OS support I am talking about: > a) the fork behavior on an open file should be available > *without* forking. dup() doesn't cut it (both fds share > the same offset on the underlying file). I'd call the new > syscall fdfork(). That is, if I do > > int newfd = fdfork(oldfd); > > reading N bytes each from newfd and oldfd will return > identical data. i can't think of a way to do this correctly. buffering in the kernel would only work if each process issued exactly the same set of reads. there is no requirement that the data from 2 reads of 100 bytes each be the same as the data return with 1 200 byte read. before you bother with "but that's a wierd case", remember that the success of unix and plan 9 has been built on the fact that there aren't syscalls that fail in "wierd" cases. - erik