From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 31 Oct 2011 15:17:39 -0700 Message-ID: From: ron minnich To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] native (mostly) go for plan9 Topicbox-Message-UUID: 3d2bbc0a-ead7-11e9-9d60-3106f5b1d025 On Mon, Oct 31, 2011 at 3:10 PM, Skip Tavakkolian wrote: > awesome job! =A0compiled fine. i'm running godoc and now rewriting some > cgi's in go. many thanks to everyone =A0involved. OK, now, the current problem with syscall/exec_plan9.go is that it is a little too eager to close FDs. It's doing the close by hand because it's not possible on Plan 9 to take an fd and set to to close-on-exec -- that's only done on open on Plan 9 (on unix the code does an fcntl). But if an FD is used twice for a child -- as it is with combined stdout/stderr -- then the close closes the fd before it can be dup'ed a second time. Bad. I did the lazy thing and commented out the erroneous close for now. The easy fix is to track the fds to be closed in a map and then close them all later. That's next. Another possibility is to allow '#d/*ctl' to be writeable and implement a closeonexec control message for fds. But maybe that's just too much. It is certainly easy to do, but is that kind of feature something we want to add? ron