tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Consistent lwp private after exec()



On Fri, Feb 25, 2011 at 09:09:05PM +0100, Joerg Sonnenberger wrote:
> Hi all,
> the attached patch makes sure that the LWP private area has a consistent
> value after exec(). I don't think any emulation is negatively affected
> by this, so no callback.

Now with patch...

Joerg
Index: kern_exec.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/kern/kern_exec.c,v
retrieving revision 1.308
diff -u -p -r1.308 kern_exec.c
--- kern_exec.c 21 Feb 2011 20:23:29 -0000      1.308
+++ kern_exec.c 25 Feb 2011 15:59:55 -0000
@@ -1075,6 +1075,9 @@ execve1(struct lwp *l, const char *path,
        if (pack.ep_esch->es_setregs)
                (*pack.ep_esch->es_setregs)(l, &pack, (vaddr_t)stack);
 
+       /* Provide a consistent LWP private setting */
+       (void)lwp_setprivate(l, NULL);
+
        /* map the process's signal trampoline code */
        if ((error = exec_sigcode_map(p, pack.ep_esch->es_emul)) != 0) {
                DPRINTF(("execve: map sigcode failed %d\n", error));


Home | Main Index | Thread Index | Old Index