Ensure that the LWP private area has a consistent value after exec.

This commit is contained in:
joerg 2011-03-01 18:53:10 +00:00
parent bb225c94f3
commit 20a3edc3f6
1 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_exec.c,v 1.308 2011/02/21 20:23:29 pooka Exp $ */
/* $NetBSD: kern_exec.c,v 1.309 2011/03/01 18:53:10 joerg Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.308 2011/02/21 20:23:29 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.309 2011/03/01 18:53:10 joerg Exp $");
#include "opt_ktrace.h"
#include "opt_modular.h"
@ -1075,6 +1075,9 @@ execve1(struct lwp *l, const char *path, char * const *args,
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));