Index: lib/libc/amd64/Symbol.map =================================================================== --- lib/libc/amd64/Symbol.map +++ lib/libc/amd64/Symbol.map @@ -40,7 +40,6 @@ amd64_set_fsbase; amd64_set_gsbase; brk; - exect; sbrk; vfork; }; Index: lib/libc/amd64/sys/Makefile.inc =================================================================== --- lib/libc/amd64/sys/Makefile.inc +++ lib/libc/amd64/sys/Makefile.inc @@ -8,8 +8,7 @@ amd64_set_fsbase.c \ amd64_set_gsbase.c -MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S setlogin.S +MDASM= vfork.S brk.S cerror.S getcontext.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM+= vfork.o Index: lib/libc/amd64/sys/exect.S =================================================================== --- lib/libc/amd64/sys/exect.S +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if defined(SYSLIBC_SCCS) && !defined(lint) - .asciz "@(#)exect.s 5.1 (Berkeley) 4/23/90" -#endif /* SYSLIBC_SCCS and not lint */ -#include -__FBSDID("$FreeBSD$"); - -#include "SYS.h" -#include - -ENTRY(exect) - movq $SYS_execve,%rax - pushfq - popq %r8 - orq $PSL_T,%r8 - pushq %r8 - popfq - KERNCALL - jmp HIDENAME(cerror) -END(exect) - - .section .note.GNU-stack,"",%progbits Index: lib/libc/gen/Makefile.inc =================================================================== --- lib/libc/gen/Makefile.inc +++ lib/libc/gen/Makefile.inc @@ -41,6 +41,7 @@ errlst.c \ errno.c \ exec.c \ + exect.c \ fdevname.c \ feature_present.c \ fmtcheck.c \ Index: lib/libc/gen/Symbol.map =================================================================== --- lib/libc/gen/Symbol.map +++ lib/libc/gen/Symbol.map @@ -105,6 +105,7 @@ sys_errlist; sys_nerr; errno; + exect; execl; execle; execlp; Index: lib/libc/gen/exec.3 =================================================================== --- lib/libc/gen/exec.3 +++ lib/libc/gen/exec.3 @@ -28,7 +28,7 @@ .\" @(#)exec.3 8.3 (Berkeley) 1/24/94 .\" $FreeBSD$ .\" -.Dd January 5, 2016 +.Dd April 6, 2018 .Dt EXEC 3 .Os .Sh NAME @@ -204,6 +204,9 @@ .Fn exect executes a file with the program tracing facilities enabled (see .Xr ptrace 2 ) . +This function is not portable and is deprecated in favor of using the +.Xr ptrace 2 +facilities. .Sh RETURN VALUES If any of the .Fn exec Index: lib/libc/gen/exect.c =================================================================== --- /dev/null +++ lib/libc/gen/exect.c @@ -0,0 +1,47 @@ +/* $NetBSD: exect.c,v 1.3 2018/01/17 01:24:29 kamil Exp $ */ + +/*- + * Copyright (c) 2016 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +__warn_references(exect, + "warning: exect() is obsolete, its functionality has moved to the kernel"); + +int +exect(const char *path, char *const argv[], char *const envp[]) +{ + + if (ptrace(PT_TRACE_ME, 0, 0, 0) != 0) + return (-1); + + return (execve(path, argv, envp)); +} Index: lib/libc/i386/Symbol.map =================================================================== --- lib/libc/i386/Symbol.map +++ lib/libc/i386/Symbol.map @@ -31,7 +31,6 @@ ntohs; vfork; brk; - exect; i386_clr_watch; i386_get_fsbase; i386_get_gsbase; Index: lib/libc/i386/sys/Makefile.inc =================================================================== --- lib/libc/i386/sys/Makefile.inc +++ lib/libc/i386/sys/Makefile.inc @@ -7,8 +7,7 @@ SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c -MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ - sbrk.S setlogin.S syscall.S +MDASM= Ovfork.S brk.S cerror.S getcontext.S sbrk.S setlogin.S syscall.S NOASM+= vfork.o Index: lib/libc/i386/sys/exect.S =================================================================== --- lib/libc/i386/sys/exect.S +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if defined(SYSLIBC_SCCS) && !defined(lint) - .asciz "@(#)exect.s 5.1 (Berkeley) 4/23/90" -#endif /* SYSLIBC_SCCS and not lint */ -#include -__FBSDID("$FreeBSD$"); - -#include "SYS.h" -#include - -ENTRY(exect) - mov $SYS_execve,%eax - pushf - popl %edx - orl $ PSL_T,%edx - pushl %edx - popf - KERNCALL - jmp HIDENAME(cerror) /* exect(file, argv, env); */ -END(exect) - - .section .note.GNU-stack,"",%progbits Index: lib/libc/mips/sys/Makefile.inc =================================================================== --- lib/libc/mips/sys/Makefile.inc +++ lib/libc/mips/sys/Makefile.inc @@ -2,8 +2,7 @@ SRCS+= trivial-vdso_tc.c -MDASM= Ovfork.S brk.S cerror.S exect.S \ - sbrk.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM+= vfork.o Index: lib/libc/mips/sys/exect.S =================================================================== --- lib/libc/mips/sys/exect.S +++ /dev/null @@ -1,51 +0,0 @@ -/* $NetBSD: exect.S,v 1.9 2003/08/07 16:42:17 agc Exp $ */ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); -#include "SYS.h" - -#if defined(LIBC_SCCS) && !defined(lint) - ASMSTR("from: @(#)exect.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: exect.S,v 1.9 2003/08/07 16:42:17 agc Exp $") -#endif /* LIBC_SCCS and not lint */ - -LEAF(exect) - PIC_PROLOGUE(exect) - li v0, SYS_execve - syscall - bne a3, zero, 1f - PIC_RETURN() -1: - PIC_TAILCALL(__cerror) -END(exect) Index: lib/libc/powerpc/Symbol.map =================================================================== --- lib/libc/powerpc/Symbol.map +++ lib/libc/powerpc/Symbol.map @@ -33,7 +33,6 @@ ntohl; ntohs; brk; - exect; sbrk; vfork; }; Index: lib/libc/powerpc/sys/Makefile.inc =================================================================== --- lib/libc/powerpc/sys/Makefile.inc +++ lib/libc/powerpc/sys/Makefile.inc @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S sbrk.S setlogin.S Index: lib/libc/powerpc/sys/exect.S =================================================================== --- lib/libc/powerpc/sys/exect.S +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * Copyright (c) 2002 Peter Grehan. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -/* $NetBSD: exect.S,v 1.3 1998/05/25 15:28:03 ws Exp $ */ - -#include -__FBSDID("$FreeBSD$"); - -#include "SYS.h" - -ENTRY(exect) - li %r0,SYS_execve - sc - bso 1f - blr -1: - b PIC_PLT(HIDENAME(cerror)) -END(exect) - - .section .note.GNU-stack,"",%progbits Index: lib/libc/powerpc64/Symbol.map =================================================================== --- lib/libc/powerpc64/Symbol.map +++ lib/libc/powerpc64/Symbol.map @@ -33,7 +33,6 @@ ntohl; ntohs; brk; - exect; sbrk; vfork; }; Index: lib/libc/powerpc64/sys/Makefile.inc =================================================================== --- lib/libc/powerpc64/sys/Makefile.inc +++ lib/libc/powerpc64/sys/Makefile.inc @@ -1,3 +1,3 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S sbrk.S setlogin.S Index: lib/libc/powerpc64/sys/exect.S =================================================================== --- lib/libc/powerpc64/sys/exect.S +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * Copyright (c) 2002 Peter Grehan. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -/* $NetBSD: exect.S,v 1.3 1998/05/25 15:28:03 ws Exp $ */ - -#include -__FBSDID("$FreeBSD$"); - -#include "SYS.h" - -ENTRY(exect) - li %r0,SYS_execve - sc - bso 1f - blr -1: - mflr %r0 - std %r0,16(%r1) - stdu %r1,-48(%r1) - bl HIDENAME(cerror) - nop - ld %r1,0(%r1) - ld %r0,16(%r1) - mtlr %r0 - blr -END(exect) - - .section .note.GNU-stack,"",%progbits Index: lib/libc/sparc64/Symbol.map =================================================================== --- lib/libc/sparc64/Symbol.map +++ lib/libc/sparc64/Symbol.map @@ -33,7 +33,6 @@ ntohl; ntohs; brk; - exect; sbrk; vfork; @@ -82,8 +81,6 @@ __siglongjmp; __sys_brk; _brk; - __sys_exect; - _exect; _end; __sys_sbrk; _sbrk; Index: lib/libc/sparc64/sys/Makefile.inc =================================================================== --- lib/libc/sparc64/sys/Makefile.inc +++ lib/libc/sparc64/sys/Makefile.inc @@ -12,4 +12,4 @@ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S sigaction1.S +MDASM+= brk.S cerror.S sbrk.S setlogin.S sigaction1.S Index: lib/libc/sparc64/sys/exect.S =================================================================== --- lib/libc/sparc64/sys/exect.S +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: Header: exect.s,v 1.1 91/07/06 13:05:57 torek Exp - */ - -#if defined(LIBC_SCCS) && !defined(lint) - .asciz "@(#)exect.s 8.1 (Berkeley) 6/4/93" -#if 0 - RCSID("$NetBSD: exect.S,v 1.1 1998/09/11 04:56:34 eeh Exp $") -#endif -#endif /* LIBC_SCCS and not lint */ -#include -__FBSDID("$FreeBSD$"); - -#include "SYS.h" - -_SYSENTRY(exect) - mov SYS_execve, %g1 - ta %xcc, ST_SYSCALL - ERROR() -_SYSEND(exect) Index: sys/amd64/amd64/machdep.c =================================================================== --- sys/amd64/amd64/machdep.c +++ sys/amd64/amd64/machdep.c @@ -598,7 +598,7 @@ regs->tf_rip = imgp->entry_addr; regs->tf_rsp = ((stack - 8) & ~0xFul) + 8; regs->tf_rdi = stack; /* argv */ - regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); + regs->tf_rflags = PSL_USER; regs->tf_ss = _udatasel; regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; Index: sys/i386/i386/machdep.c =================================================================== --- sys/i386/i386/machdep.c +++ sys/i386/i386/machdep.c @@ -1131,7 +1131,7 @@ bzero((char *)regs, sizeof(struct trapframe)); regs->tf_eip = imgp->entry_addr; regs->tf_esp = stack; - regs->tf_eflags = PSL_USER | (regs->tf_eflags & PSL_T); + regs->tf_eflags = PSL_USER; regs->tf_ss = _udatasel; regs->tf_ds = _udatasel; regs->tf_es = _udatasel;