On Sat, 2009-01-03 at 22:56 -0800, Russ Cox wrote: > On Sat, Jan 3, 2009 at 9:04 PM, Roman V. Shaposhnik <[email protected]> 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.
