From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sun, 4 Jan 2009 20:39:32 -0800 From: "Roman V. Shaposhnik" In-reply-to: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-id: <1231130372.11463.433.camel@goose.sun.com> MIME-version: 1.0 Content-type: text/plain Content-transfer-encoding: 7BIT References: <1231045486.11463.245.camel@goose.sun.com> Subject: Re: [9fans] Why do we need syspipe() ? Topicbox-Message-UUID: 79660728-ead4-11e9-9d60-3106f5b1d025 On Sat, 2009-01-03 at 22:56 -0800, Russ Cox wrote: > On Sat, Jan 3, 2009 at 9:04 PM, Roman V. Shaposhnik wrote: > > I'm confused. Is there any part of syspipe() that can NOT > > be done from userspace? Why does it have to be a syscall? > > > > P.S. I would also argue that sysdup() would seem to be superfluous > > if more feature-rich devdup was available. > > I don't believe you can write a race-free implementation of > the pipe system call using #|. Could you, please, elaborate on what particular race do you have in mind? Indeed, I ran into a problem with devpipe implementation, but it isn't a race, its a dreaded implicit ->attach that namec() does when it evaluates names with the first character being #. > I also don't believe you can implement the dup system call > (remember, it has two arguments) using #d. Agreed. That's why I mentioned that a more feature-rich devdup is needed. Of course, now I've also discovered that the current implementation of devpipe is also not sufficient enough for me to be able to produce a 100% user-space version of pipe(2). > If you disagree, show me the code. I can't :-( Sorry for the noise. With the current implementation my question has a definite answer of why Plan9 kernel needs a syspipe(). If I'm allowed to change the implementation of devpipe, I think I can show you the code. Would that still count? Thanks, Roman.