I appear to have kicked over a hornets nest in attempting to close
issue 1954, please accept my appologies for not bringing a propsal for
the changes to golang-dev before submitting a CL.
To respond to the comments raised so far
* Regarding the size of the patch: yes, it's huge because of the
requirement that forkAndExecInChild doesn't acquire locks or new stack
segments. I don't see a way around duplicating the common code.
However, from my point of view I would prefer to see a variant of
forkAndExecInChild for each operating system, rather than a
consolidated one with conditional checks all the way through. This
also has implications for the SysProcAttr struct.
* Ownership of the initial patch: greping the CONTRIBUTORS file I
can't see an entry for jdn...@qwe.cc so I can only assume there is no
CLA on file for that person. As their original patch added new
functionality, I can't see that it can be applied without a CLA.
What I would like to propose is I submit a new CL to split
exec_unix.go into two flavors with the names exec_unix_linux.go and
exec_unix_bsd.go using the method Russ proposed. In this way it
suggests, for example, exec_unix_linux.go is related to exec_unix.go,
in the same way syscall_linux_amd64.go is to syscall_linux.go. No new
functionality would be added, simply forkAndExecInChild() and the
SysProcAttr struct would be moved out of exec_unix.go and duplicated
in the other two files. Future CL's could address adding unshare(2),
prctl or possibly removing the darwin specific workaround from the
linux variant. There may also be opportunities to consolidate some of
exec_plan9.go, but I haven't looked into that at all.
Alternatively, I can just drop the whole thing. If that is the case,
issue 1954 should probably closed as can't/wont fix.
Cheers
Dave
I see the original CL for this has been abandoned:
http://codereview.appspot.com/5246052/
What's the feeling about how we want to handle this? I'd really like
to contribute the prctl support, but we need to decide on a strategy
first.
Regards
Albert
On Thu, Oct 20, 2011 at 4:51 PM, Paul Borman <bor...@google.com> wrote:
> The unshare system call does nearly nothing, at least according to the
> documentation for unshare(2) that I read. For real unshare support the code
> would need to be changed to use the clone system call and would be very
> Linux specific. Looking at the documentation I see that unshare only
> supports:
I'm not particularly interested in unshare per se. What is more
interesting is how the core developers think we should deal with
unshare, prctl and other system-specific exec stuff.
I'd like to contribute some prctl bits, but I'm going to run into the
same issue as the unshare CL: do we want an exec_linux.go? If not,
what approach should we take?
Regards
Albert