<br><br><div class="gmail_quote">On Tue, Jun 9, 2009 at 06:56, Michael McMahon <span dir="ltr"><<a href="mailto:Michael.McMahon@sun.com">Michael.McMahon@sun.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Martin Buchholz wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 <br>
<br>
    Also, I don't follow why we need the<br>
     execve_as_traditional_shell_script()<br>
    function. Can you explain the reason for that?<br>
<br>
<br>
I think my comment for that function explains it fairly well.<br>
<br>
/**<br>
 * Exec FILE as a traditional Bourne shell script (i.e. one without #!).<br>
 * If we could do it over again, we would probably not support such an ancient<br>
 * misfeature, but compatibility wins over sanity.  The original support for<br>
 * this was imported accidentally from execvp().<br>
 */<br>
<br>
</blockquote></div>
Actually, I was really wondering why is this code needed now?<br>
What has it to do with the specifics of converting fork()+exec()<br>
to clone()+exec()<br>
</blockquote><div><br>In the old implementation, we used the strategy of <br>fork+mutate environ+execvp<br>and we got the traditional shell script semantics <br>from our use of execvp.<br>Since environ is now a global shared-with-parent variable,<br>
we can't mutate it any more, therefore can't use execvp,<br>and must implement the missing execvpe ourselves.<br><br>Now, strictly speaking, execvp's  traditional shell script semantics <br>is an unspecified implementation detail of execvp; <br>
on other Unix platforms we might not need this.  <br>We can leave this to, e.g. the BSD porters reading this,<br>to add some #ifdefs.<br><br>(It would also be good if you ran the updated tests on<br>Solaris with the old implementation to confirm my understanding)<br>
<br>The other non-portable implementation detail <br>we need to deal with is the<br>default value of PATH if undefined in the environment,<br>but we had already been doing that.<br><br>Martin<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Thanks,<br>
Michael.<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
The tests I added also pass on the older implementation,<br>
so execve_as_traditional_shell_script() prevents a regression.<br>
We always supported "traditional shell scripts" - we just didn't know it.<br>
<br>
---<br>
<br>
I updated the public version of the patch at:<br>
</div><a href="http://cr.openjdk.java.net/%7Emartin/clone-exec" target="_blank">http://cr.openjdk.java.net/~martin/clone-exec</a> <<a href="http://cr.openjdk.java.net/%7Emartin/clone-exec" target="_blank">http://cr.openjdk.java.net/%7Emartin/clone-exec</a>><div>
<div></div><div class="h5"><br>
<br>
Martin<br>
<br>
 <br>
<br>
    Thanks,<br>
    Michael.<br>
<br>
    Martin Buchholz wrote:<br>
<br>
        Michael,<br>
<br>
        I think the best way to handle the coordination is in two steps.<br>
        I'd like to get my Linux-clone changes in first (you should<br>
        review,<br>
        I will commit)<br>
        and then we switch hats and I will review your Solaris changes.<br>
        It seems best to do this in two steps: to better place blame when<br>
        it breaks (this is very tricky stuff to get right).<br>
        If you agree, please review my posted changes.<br>
<br>
        Aside: Instead of griping about the missing execvpe,<br>
        I filed a bug against glibc, and was surprised to find<br>
        that Ulrich Drepper had implemented it a couple of days later.<br>
        It will probably be in glibc-2.11.  Perhaps in 5 years we can<br>
        use it ourselves...).  Thanks, Uli!<br>
<br>
        Martin<br>
<br>
        On Tue, Jun 2, 2009 at 07:29, Michael McMahon<br>
        <<a href="mailto:Michael.McMahon@sun.com" target="_blank">Michael.McMahon@sun.com</a> <mailto:<a href="mailto:Michael.McMahon@sun.com" target="_blank">Michael.McMahon@sun.com</a>><br>
        <mailto:<a href="mailto:Michael.McMahon@sun.com" target="_blank">Michael.McMahon@sun.com</a><br>
        <mailto:<a href="mailto:Michael.McMahon@sun.com" target="_blank">Michael.McMahon@sun.com</a>>>> wrote:<br>
<br>
           Martin,<br>
<br>
           I had done something similar with clone & exec for Linux, but<br>
           hadn't got round to testing it.<br>
           So, it seems reasonable to take yours. Do you want to send<br>
        me your<br>
           updated versions of<br>
           process_md.c and the test? I can take care of the merge<br>
        with the<br>
           Solaris code.<br>
<br>
<br>
<br>
<br>
</div></div></blockquote>
<br>
</blockquote></div><br>