for 9front page, i wrote a function that implements inferno style pctl filedescriptor passing. basicly, you fork and then give it a list of filedescriptors you want in the process like:
dupfds(foofd, 1, 2, -1); // redirect foofd to stdin of this process, keep stdout/stderr all the other filedescriptors get closed so you wont leak any fds. i find this style mutch cleaner than flags on filedescriptors. here i say exactly what i want at the time of the exec/fork instead of having to worry about it in some random place where i open it. the implementation uses /fd to figure out what filedescriptors are open. a kernel based version of this would be nice :) -- cinap