diff options
author | David Leonard <d@cvs.openbsd.org> | 1999-02-01 08:13:06 +0000 |
---|---|---|
committer | David Leonard <d@cvs.openbsd.org> | 1999-02-01 08:13:06 +0000 |
commit | d3535d307a51e7bc6bdd095559ad0377a0cae9c8 (patch) | |
tree | 77dbc0a24263d5db011e22182164c389d67eef8c /lib | |
parent | fdbd5c9db5bb7c145eb1ca0c1191f84e6b84aac8 (diff) |
mi ptrace
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/arch/alpha/sys/ptrace.S | 45 | ||||
-rw-r--r-- | lib/libc/arch/arm32/sys/ptrace.S | 49 | ||||
-rw-r--r-- | lib/libc/arch/i386/sys/ptrace.S | 63 | ||||
-rw-r--r-- | lib/libc/arch/m68k/sys/ptrace.S | 61 | ||||
-rw-r--r-- | lib/libc/arch/m88k/sys/ptrace.S | 55 | ||||
-rw-r--r-- | lib/libc/arch/mips/sys/ptrace.S | 54 | ||||
-rw-r--r-- | lib/libc/arch/mvme88k/sys/ptrace.S | 55 | ||||
-rw-r--r-- | lib/libc/arch/ns32k/sys/ptrace.S | 34 | ||||
-rw-r--r-- | lib/libc/arch/powerpc/sys/ptrace.S | 13 | ||||
-rw-r--r-- | lib/libc/arch/sparc/sys/ptrace.S | 61 | ||||
-rw-r--r-- | lib/libc/arch/vax/sys/ptrace.S | 47 | ||||
-rw-r--r-- | lib/libc/sys/Lint_ptrace.c | 20 | ||||
-rw-r--r-- | lib/libc/sys/Makefile.inc | 12 | ||||
-rw-r--r-- | lib/libc/sys/ptrace.2 | 4 | ||||
-rw-r--r-- | lib/libc/sys/ptrace.c | 21 |
15 files changed, 29 insertions, 565 deletions
diff --git a/lib/libc/arch/alpha/sys/ptrace.S b/lib/libc/arch/alpha/sys/ptrace.S deleted file mode 100644 index 7a9cfa83ce7..00000000000 --- a/lib/libc/arch/alpha/sys/ptrace.S +++ /dev/null @@ -1,45 +0,0 @@ -/* $OpenBSD: ptrace.S,v 1.3 1996/11/13 22:05:12 niklas Exp $ */ -/* $NetBSD: ptrace.S,v 1.3 1996/10/17 03:08:19 cgd Exp $ */ - -/* - * Copyright (c) 1994, 1995 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include "SYS.h" - -#if defined(SYSLIBC_SCCS) - .text - .asciz "$OpenBSD: ptrace.S,v 1.3 1996/11/13 22:05:12 niklas Exp $" -#endif /* SYSLIBC_SCCS */ - -IMPORT(errno, 4) - -LEAF(ptrace, 4) - LDGP(pv) - stl zero, errno - CALLSYS_ERROR(ptrace) - RET -END(ptrace) diff --git a/lib/libc/arch/arm32/sys/ptrace.S b/lib/libc/arch/arm32/sys/ptrace.S deleted file mode 100644 index a718cc84ab1..00000000000 --- a/lib/libc/arch/arm32/sys/ptrace.S +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 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. - */ - -#include "SYS.h" - -#if defined(SYSLIBC_SCCS) - .text - .asciz "$OpenBSD: ptrace.S,v 1.3 1996/08/19 08:11:57 tholo Exp $" -#endif /* SYSLIB_SCCS */ - - .text - .align 0 - -ENTRY(ptrace) - swi SYS_ptrace - bcs cerror - mov r0, #0 - mov r15, r14 - diff --git a/lib/libc/arch/i386/sys/ptrace.S b/lib/libc/arch/i386/sys/ptrace.S deleted file mode 100644 index 52ff26642ac..00000000000 --- a/lib/libc/arch/i386/sys/ptrace.S +++ /dev/null @@ -1,63 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 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. - */ - -#include "SYS.h" - -#if defined(SYSLIBC_SCCS) - .text - .asciz "$OpenBSD: ptrace.S,v 1.2 1996/08/19 08:13:34 tholo Exp $" -#endif /* SYSLIBC_SCCS */ - -ENTRY(ptrace) -#ifdef PIC - xorl %eax,%eax - PIC_PROLOGUE - movl PIC_GOT(_errno),%edx - PIC_EPILOGUE - movl %eax,(%edx) -#else - movl $0,_errno -#endif - movl $(SYS_ptrace),%eax - int $0x80 - jc err - ret -err: -#ifdef PIC - jmp PIC_PLT(cerror) -#else - jmp cerror -#endif diff --git a/lib/libc/arch/m68k/sys/ptrace.S b/lib/libc/arch/m68k/sys/ptrace.S deleted file mode 100644 index f248787692d..00000000000 --- a/lib/libc/arch/m68k/sys/ptrace.S +++ /dev/null @@ -1,61 +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 - * the Systems Programming Group of the University of Utah Computer - * Science Department. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 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) - .text - .asciz "$OpenBSD: ptrace.S,v 1.2 1996/08/19 08:15:38 tholo Exp $" -#endif /* SYSLIBC_SCCS */ - -#include "SYS.h" - - .globl _errno - -ENTRY(ptrace) -#ifdef PIC - movl #__GLOBAL_OFFSET_TABLE_,a0 - lea pc@(0,a0:l),a0 - movl a0@(_errno:w),a0 - clrl a0@ -#else - clrl _errno -#endif - movl #SYS_ptrace,d0 - trap #0 - jcs err - rts -err: - jra cerror diff --git a/lib/libc/arch/m88k/sys/ptrace.S b/lib/libc/arch/m88k/sys/ptrace.S deleted file mode 100644 index bc2b52b71d1..00000000000 --- a/lib/libc/arch/m88k/sys/ptrace.S +++ /dev/null @@ -1,55 +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 - * the Systems Programming Group of the University of Utah Computer - * Science Department. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 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(LIBC_SCCS) && !defined(lint) - .data - /*.asciz "from: @(#)ptrace.s 5.1 (Berkeley) 5/12/90"*/ - .asciz "$Id: ptrace.S,v 1.1 1998/12/15 07:10:33 smurph Exp $" - .text -#endif /* LIBC_SCCS and not lint */ - -#include "SYS.h" - - .globl _errno - -ENTRY(ptrace) - or.u r9,r0,hi16(_errno) - st r0,r9,lo16(_errno) - or r13,r0,SYS_ptrace - tb0 0,r0,128 - br cerror - jmp r1 diff --git a/lib/libc/arch/mips/sys/ptrace.S b/lib/libc/arch/mips/sys/ptrace.S deleted file mode 100644 index 0d711c53615..00000000000 --- a/lib/libc/arch/mips/sys/ptrace.S +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 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. - */ - -#include "SYS.h" - -#if defined(SYSLIBC_SCCS) - .text - .asciz "$OpenBSD: ptrace.S,v 1.5 1999/01/19 01:38:53 d Exp $" -#endif /* SYSLIBC_SCCS */ - -SYSLEAF(ptrace) - .set reorder - sw zero, _C_LABEL(errno) - li v0, SYS_ptrace - syscall - bne a3, zero, 1f - j ra -1: - la t9, _C_LABEL(cerror) - jr t9 -SYSEND(ptrace) diff --git a/lib/libc/arch/mvme88k/sys/ptrace.S b/lib/libc/arch/mvme88k/sys/ptrace.S deleted file mode 100644 index ab75908eb24..00000000000 --- a/lib/libc/arch/mvme88k/sys/ptrace.S +++ /dev/null @@ -1,55 +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 - * the Systems Programming Group of the University of Utah Computer - * Science Department. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 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(LIBC_SCCS) && !defined(lint) - .data - /*.asciz "from: @(#)ptrace.s 5.1 (Berkeley) 5/12/90"*/ - .asciz "$Id: ptrace.S,v 1.1 1997/03/25 17:07:22 rahnds Exp $" - .text -#endif /* LIBC_SCCS and not lint */ - -#include "SYS.h" - - .globl _errno - -ENTRY(ptrace) - or.u r9,r0,hi16(_errno) - st r0,r9,lo16(_errno) - or r13,r0,SYS_ptrace - tb0 0,r0,128 - br cerror - jmp r1 diff --git a/lib/libc/arch/ns32k/sys/ptrace.S b/lib/libc/arch/ns32k/sys/ptrace.S deleted file mode 100644 index 20285228144..00000000000 --- a/lib/libc/arch/ns32k/sys/ptrace.S +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 1992 Helsinki University of Technology - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN - * ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY - * LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE - * USE OF THIS SOFTWARE. - */ - -#include "SYS.h" - -#if defined(SYSLIBC_SCCS) - .text - .asciz "$OpenBSD: ptrace.S,v 1.2 1996/08/19 08:17:10 tholo Exp $" -#endif /* SYSLIBC_SCCS */ - - .globl _errno - .globl cerror - -ENTRY(ptrace) - PIC_PROLOGUE - movqd 0, PIC_GOT(_errno) - PIC_EPILOGUE - movd SYS_ptrace, r0 - SVC - bcs cerror - ret 0 diff --git a/lib/libc/arch/powerpc/sys/ptrace.S b/lib/libc/arch/powerpc/sys/ptrace.S deleted file mode 100644 index e20aa27a65e..00000000000 --- a/lib/libc/arch/powerpc/sys/ptrace.S +++ /dev/null @@ -1,13 +0,0 @@ -/* int ptrace(int *mask) */ - -#include "SYS.h" - - .text -PREFIX(ptrace) - sc - cmpwi 0, 0 - beq ok - b PIC_PLT(_ASM_LABEL(cerror)) - -ok: - blr diff --git a/lib/libc/arch/sparc/sys/ptrace.S b/lib/libc/arch/sparc/sys/ptrace.S deleted file mode 100644 index dccafa5730d..00000000000 --- a/lib/libc/arch/sparc/sys/ptrace.S +++ /dev/null @@ -1,61 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 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) - .text - .asciz "$OpenBSD: ptrace.S,v 1.2 1996/08/19 08:18:08 tholo Exp $" -#endif /* SYSLIBC_SCCS */ - -#include "SYS.h" - -ENTRY(ptrace) -#ifdef PIC - PIC_PROLOGUE(%g1,%g2) - ld [%g1 +_errno], %g1 - st %g0, [%g1] -#else - sethi %hi(_errno), %g1 - st %g0, [%g1 + %lo(_errno)] -#endif - mov SYS_ptrace, %g1 - t ST_SYSCALL - bcc 1f - nop - ERROR() -1: - retl - nop diff --git a/lib/libc/arch/vax/sys/ptrace.S b/lib/libc/arch/vax/sys/ptrace.S deleted file mode 100644 index 448ddf71a4e..00000000000 --- a/lib/libc/arch/vax/sys/ptrace.S +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1983, 1993 - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 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) - .text - .asciz "$OpenBSD: ptrace.S,v 1.3 1998/05/17 10:06:33 niklas Exp $" -#endif /* SYSLIBC_SCCS */ - -#include "SYS.h" - -ENTRY(ptrace, 0) - clrl _errno - chmk $ SYS_ptrace - jcs err - ret -err: - jmp cerror diff --git a/lib/libc/sys/Lint_ptrace.c b/lib/libc/sys/Lint_ptrace.c deleted file mode 100644 index 895f672b081..00000000000 --- a/lib/libc/sys/Lint_ptrace.c +++ /dev/null @@ -1,20 +0,0 @@ -/* $OpenBSD: Lint_ptrace.c,v 1.1 1998/02/08 22:45:10 tholo Exp $ */ -/* $NetBSD: Lint_ptrace.c,v 1.1 1997/11/06 00:53:02 cgd Exp $ */ - -/* - * This file placed in the public domain. - * Chris Demetriou, November 5, 1997. - */ - -#include <unistd.h> - -/*ARGSUSED*/ -int -ptrace(request, pid, addr, data) - int request; - pid_t pid; - caddr_t addr; - int data; -{ - return (0); -} diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 3bc64a19d3e..59cac8d9641 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.27 1998/11/20 11:18:52 d Exp $ +# $OpenBSD: Makefile.inc,v 1.28 1999/02/01 08:13:01 d Exp $ # $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 6/17/93 @@ -6,22 +6,22 @@ .PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/sys ${LIBCSRCDIR}/sys # modules with non-default implementations on at least one architecture: -SRCS+= Ovfork.S brk.S cerror.S exect.S fork.S pipe.S ptrace.S \ +SRCS+= Ovfork.S brk.S cerror.S exect.S fork.S pipe.S \ sbrk.S sigpending.S sigprocmask.S sigreturn.S \ sigsuspend.S syscall.S LSRCS+= Lint_Ovfork.c Lint_brk.c Lint_exect.c Lint_fork.c \ - Lint_pipe.c Lint_ptrace.c Lint_sbrk.c \ + Lint_pipe.c Lint_sbrk.c \ Lint_sigpending.c Lint_sigprocmask.c Lint_sigreturn.c \ Lint_sigsuspend.c Lint_syscall.c DPSRCS+= Lint_Ovfork.c Lint_brk.c Lint_exect.c Lint_fork.c \ - Lint_pipe.c Lint_ptrace.c Lint_sbrk.c \ + Lint_pipe.c Lint_sbrk.c \ Lint_sigpending.c Lint_sigprocmask.c Lint_sigreturn.c \ Lint_sigsuspend.c Lint_syscall.c # glue to provide compatibility between GCC 1.X and 2.X and for compat # with old syscall interfaces. -SRCS+= ftruncate.c lseek.c mmap.c semctl.c truncate.c \ +SRCS+= ftruncate.c lseek.c mmap.c ptrace.c semctl.c truncate.c \ timer_create.c timer_delete.c timer_getoverrun.c timer_gettime.c \ timer_settime.c @@ -58,7 +58,7 @@ ASM= accept.o access.o acct.o adjtime.o bind.o chdir.o chflags.o chmod.o \ PASM= ${ASM:.o=.po} SASM= ${ASM:.o=.so} -PSEUDO= _exit.o _getlogin.o _setlogin.o +PSEUDO= _exit.o _getlogin.o _setlogin.o _ptrace.o PPSEUDO=${PSEUDO:.o=.po} SPSEUDO=${PSEUDO:.o=.so} diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index b3590325cb5..2596924be74 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ptrace.2,v 1.3 1996/10/08 01:20:12 michaels Exp $ +.\" $OpenBSD: ptrace.2,v 1.4 1999/02/01 08:13:01 d Exp $ .\" $NetBSD: ptrace.2,v 1.3 1996/02/23 01:39:41 jtc Exp $ .\" .\" This file is in the public domain. @@ -303,7 +303,7 @@ to return .Li -1 as a non-error value; to disambiguate, .Va errno -can be set to 0 before the call and checked afterwards. The possible +is set to zero and this should be checked. The possible errors are: .Bl -tag -width 4n .It Bq Er ESRCH diff --git a/lib/libc/sys/ptrace.c b/lib/libc/sys/ptrace.c new file mode 100644 index 00000000000..5e95a94941c --- /dev/null +++ b/lib/libc/sys/ptrace.c @@ -0,0 +1,21 @@ +/* $OpenBSD: ptrace.c,v 1.1 1999/02/01 08:13:01 d Exp $ */ +/* David Leonard <d@openbsd.org>, 1999. Public domain. */ + +#include <sys/types.h> +#include <sys/ptrace.h> +#include <sys/errno.h> + +int _ptrace __P((int, pid_t, caddr_t, int)); + +int +ptrace(request, pid, addr, data) + int request; + pid_t pid; + caddr_t addr; + int data; +{ + + /* ptrace(2) is documented to clear errno on success: */ + errno = 0; + return (_ptrace(request, pid, addr, data)); +} |