Index: head/lib/libc/amd64/sys/Makefile.inc =================================================================== --- head/lib/libc/amd64/sys/Makefile.inc +++ head/lib/libc/amd64/sys/Makefile.inc @@ -4,7 +4,7 @@ SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \ amd64_set_gsbase.c -MDASM= vfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ +MDASM= vfork.S brk.S cerror.S exect.S getcontext.S \ sbrk.S setlogin.S sigreturn.S # Don't generate default code for these syscalls: Index: head/lib/libc/amd64/sys/ptrace.S =================================================================== --- head/lib/libc/amd64/sys/ptrace.S +++ head/lib/libc/amd64/sys/ptrace.S @@ -1,67 +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. - * 4. 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 "@(#)ptrace.s 5.1 (Berkeley) 4/23/90" -#endif /* SYSLIBC_SCCS and not lint */ -#include -__FBSDID("$FreeBSD$"); - -#include "SYS.h" - - .globl CNAME(__error) - .type CNAME(__error),@function - -ENTRY(ptrace) - pushq %rdi /* align stack */ - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx -#ifdef PIC - callq PIC_PLT(CNAME(__error)) -#else - callq CNAME(__error) -#endif - popq %rcx - popq %rdx - popq %rsi - popq %rdi - popq %rdi - movl $0,(%rax) - mov $SYS_ptrace,%eax - KERNCALL - jb HIDENAME(cerror) - ret -END(ptrace) - - .section .note.GNU-stack,"",%progbits Index: head/lib/libc/arm/sys/Makefile.inc =================================================================== --- head/lib/libc/arm/sys/Makefile.inc +++ head/lib/libc/arm/sys/Makefile.inc @@ -2,7 +2,7 @@ SRCS+= __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S +MDASM= Ovfork.S brk.S cerror.S sbrk.S shmat.S sigreturn.S syscall.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o Index: head/lib/libc/arm/sys/ptrace.S =================================================================== --- head/lib/libc/arm/sys/ptrace.S +++ head/lib/libc/arm/sys/ptrace.S @@ -1,51 +0,0 @@ -/* $NetBSD: ptrace.S,v 1.7 2003/08/07 16:42:04 agc Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * 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. - * 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: @(#)ptrace.s 5.1 (Berkeley) 4/23/90 - */ - -#include -__FBSDID("$FreeBSD$"); -#include "SYS.h" - -ENTRY(ptrace) - stmfd sp!, {r0-r3, lr} - sub sp, sp, #4 /* align stack */ - bl PIC_SYM(_C_LABEL(__error), PLT) - add sp, sp, #4 /* unalign stack */ - mov r1, #0x00000000 - str r1, [r0] - ldmfd sp!, {r0-r3, lr} - SYSTRAP(ptrace) - bcs PIC_SYM(CERROR, PLT) - RET -END(ptrace) - - .section .note.GNU-stack,"",%progbits Index: head/lib/libc/i386/sys/Makefile.inc =================================================================== --- head/lib/libc/i386/sys/Makefile.inc +++ head/lib/libc/i386/sys/Makefile.inc @@ -7,7 +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 ptrace.S \ +MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S \ sbrk.S setlogin.S sigreturn.S syscall.S # Don't generate default code for these syscalls: Index: head/lib/libc/i386/sys/ptrace.S =================================================================== --- head/lib/libc/i386/sys/ptrace.S +++ head/lib/libc/i386/sys/ptrace.S @@ -1,59 +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. - * 4. 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 "@(#)ptrace.s 5.1 (Berkeley) 4/23/90" -#endif /* SYSLIBC_SCCS and not lint */ -#include -__FBSDID("$FreeBSD$"); - -#include "SYS.h" - - .globl CNAME(__error) - .type CNAME(__error),@function - -ENTRY(ptrace) -#ifdef PIC - PIC_PROLOGUE - call PIC_PLT(CNAME(__error)) - PIC_EPILOGUE -#else - call CNAME(__error) -#endif - movl $0,(%eax) - mov $SYS_ptrace,%eax - KERNCALL - jb HIDENAME(cerror) - ret -END(ptrace) - - .section .note.GNU-stack,"",%progbits Index: head/lib/libc/include/libc_private.h =================================================================== --- head/lib/libc/include/libc_private.h +++ head/lib/libc/include/libc_private.h @@ -335,6 +335,7 @@ int __sys_pselect(int, struct fd_set *, struct fd_set *, struct fd_set *, const struct timespec *, const __sigset_t *); +int __sys_ptrace(int, __pid_t, char *, int); int __sys_poll(struct pollfd *, unsigned, int); int __sys_ppoll(struct pollfd *, unsigned, const struct timespec *, const __sigset_t *); Index: head/lib/libc/mips/sys/Makefile.inc =================================================================== --- head/lib/libc/mips/sys/Makefile.inc +++ head/lib/libc/mips/sys/Makefile.inc @@ -3,7 +3,7 @@ SRCS+= trivial-vdso_tc.c MDASM= Ovfork.S brk.S cerror.S exect.S \ - ptrace.S sbrk.S syscall.S + sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o Index: head/lib/libc/mips/sys/ptrace.S =================================================================== --- head/lib/libc/mips/sys/ptrace.S +++ head/lib/libc/mips/sys/ptrace.S @@ -1,71 +0,0 @@ -/* $NetBSD: ptrace.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: @(#)ptrace.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: ptrace.S,v 1.9 2003/08/07 16:42:17 agc Exp $") -#endif /* LIBC_SCCS and not lint */ - -NESTED_NOPROFILE(ptrace, CALLFRAME_SIZ, ra) - .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) - SETUP_GP - PTR_SUBU sp, sp, CALLFRAME_SIZ - SETUP_GP64(CALLFRAME_GP, ptrace) - SAVE_GP(CALLFRAME_GP) - - PTR_S ra, CALLFRAME_RA(sp) - - PTR_LA t9, _C_LABEL(__error) # locate address of errno - jalr t9 - - PTR_L ra, CALLFRAME_RA(sp) - INT_S zero, 0(v0) # update errno value - - li v0, SYS_ptrace - syscall - - # Load __cerror's address using our gp, then restore it. - PTR_LA t9, __cerror - RESTORE_GP64 - PTR_ADDU sp, sp, CALLFRAME_SIZ - - bne a3, zero, 1f - - j ra -1: j t9 -END(ptrace) Index: head/lib/libc/powerpc/sys/Makefile.inc =================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc +++ head/lib/libc/powerpc/sys/Makefile.inc @@ -1,6 +1,6 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o sstk.o yield.o Index: head/lib/libc/powerpc/sys/ptrace.S =================================================================== --- head/lib/libc/powerpc/sys/ptrace.S +++ head/lib/libc/powerpc/sys/ptrace.S @@ -1,61 +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: ptrace.S,v 1.3 2000/02/23 20:16:57 kleink Exp $ */ - -#include -__FBSDID("$FreeBSD$"); - -#include "SYS.h" - -ENTRY(ptrace) - mflr %r0 - stwu %r1,-32(%r1) - stw %r0,36(%r1) - stw %r3,8(%r1) - stw %r4,12(%r1) - stw %r5,16(%r1) - stw %r6,20(%r1) - - bl PIC_PLT(CNAME(__error)) - li %r7,0 - stw %r7,0(%r3) - - lwz %r3,8(%r1) - lwz %r4,12(%r1) - lwz %r5,16(%r1) - lwz %r0,36(%r1) - lwz %r6,20(%r1) - mtlr %r0 - la %r1,32(%r1) - li %r0,SYS_ptrace - sc - bso 1f - blr -1: - b PIC_PLT(HIDENAME(cerror)) -END(ptrace) - - .section .note.GNU-stack,"",%progbits Index: head/lib/libc/powerpc64/sys/Makefile.inc =================================================================== --- head/lib/libc/powerpc64/sys/Makefile.inc +++ head/lib/libc/powerpc64/sys/Makefile.inc @@ -1,6 +1,6 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o sstk.o yield.o Index: head/lib/libc/powerpc64/sys/ptrace.S =================================================================== --- head/lib/libc/powerpc64/sys/ptrace.S +++ head/lib/libc/powerpc64/sys/ptrace.S @@ -1,68 +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: ptrace.S,v 1.3 2000/02/23 20:16:57 kleink Exp $ */ - -#include -__FBSDID("$FreeBSD$"); - -#include "SYS.h" - -ENTRY(ptrace) - mflr %r0 - std %r0,16(%r1) - stdu %r1,-80(%r1) - stw %r3,48(%r1) - stw %r4,52(%r1) - std %r5,56(%r1) - stw %r6,64(%r1) - - bl CNAME(__error) - nop - li %r7,0 - stw %r7,0(%r3) - - lwz %r3,48(%r1) - lwz %r4,52(%r1) - ld %r5,56(%r1) - lwz %r6,64(%r1) - ld %r1,0(%r1) - ld %r0,16(%r1) - mtlr %r0 - li %r0,SYS_ptrace - sc - bso 1f - blr -1: - stdu %r1,-48(%r1) /* lr already saved */ - bl HIDENAME(cerror) - nop - ld %r1,0(%r1) - ld %r0,16(%r1) - mtlr %r0 - blr -END(ptrace) - - .section .note.GNU-stack,"",%progbits Index: head/lib/libc/sparc64/sys/Makefile.inc =================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc +++ head/lib/libc/sparc64/sys/Makefile.inc @@ -12,7 +12,7 @@ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S sigaction1.S +MDASM+= brk.S cerror.S exect.S sbrk.S setlogin.S sigaction1.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o sstk.o yield.o Index: head/lib/libc/sparc64/sys/ptrace.S =================================================================== --- head/lib/libc/sparc64/sys/ptrace.S +++ head/lib/libc/sparc64/sys/ptrace.S @@ -1,57 +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. - * 4. 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: ptrace.s,v 1.2 91/12/20 01:59:00 leres Exp - * from: NetBSD: ptrace.S,v 1.4 2000/07/24 00:11:10 mycroft Exp - */ - -#if defined(SYSLIBC_SCCS) && !defined(lint) - .asciz "@(#)ptrace.s 8.1 (Berkeley) 6/4/93" -#if 0 - RCSID("$NetBSD: ptrace.S,v 1.4 2000/07/24 00:11:10 mycroft Exp $") -#endif -#endif /* SYSLIBC_SCCS and not lint */ -#include -__FBSDID("$FreeBSD$"); - -#include "SYS.h" - -_SYSENTRY(ptrace) - save %sp, -CCFSZ, %sp - call CNAME(__error) - nop - stw %g0, [%o0] - restore - _SYSCALL(ptrace) - retl - nop -_SYSEND(ptrace) Index: head/lib/libc/sys/Makefile.inc =================================================================== --- head/lib/libc/sys/Makefile.inc +++ head/lib/libc/sys/Makefile.inc @@ -48,6 +48,7 @@ poll \ ppoll \ pselect \ + ptrace \ read \ readv \ recvfrom \ Index: head/lib/libc/sys/ptrace.c =================================================================== --- head/lib/libc/sys/ptrace.c +++ head/lib/libc/sys/ptrace.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2016 The FreeBSD Foundation. + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * 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(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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 +#include +#include "libc_private.h" + +__weak_reference(_ptrace, ptrace); + +int +_ptrace(int request, pid_t pid, caddr_t addr, int data) +{ + + errno = 0; + return (__sys_ptrace(request, pid, addr, data)); +}