diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2016-03-30 07:55:37 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2016-03-30 07:55:37 +0000 |
commit | 23e9bb646faa9538b5070b524319bda5a0b2de33 (patch) | |
tree | dfb7ccd72b19628b0b500d17aebcacd7434ca20c /lib | |
parent | be956482da71e55637e55f51acb698124c4e698d (diff) |
Turd polish: use HIDDEN= instead of PSEUDO= for ptrace syscall stub, to
make its underlying symbol name look like others.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/Symbols.list | 2 | ||||
-rw-r--r-- | lib/libc/hidden/sys/ptrace.h | 25 | ||||
-rw-r--r-- | lib/libc/sys/Makefile.inc | 6 | ||||
-rw-r--r-- | lib/libc/sys/ptrace.c | 9 |
4 files changed, 33 insertions, 9 deletions
diff --git a/lib/libc/Symbols.list b/lib/libc/Symbols.list index 5513d8a0268..76c43e586be 100644 --- a/lib/libc/Symbols.list +++ b/lib/libc/Symbols.list @@ -46,7 +46,6 @@ _thread_sys___thrsigdivert _thread_sys___thrsleep _thread_sys___thrwakeup _thread_sys__exit -_thread_sys__ptrace _thread_sys_accept4 _thread_sys_accept _thread_sys_access @@ -168,6 +167,7 @@ _thread_sys_pread _thread_sys_preadv _thread_sys_profil _thread_sys_pselect +_thread_sys_ptrace _thread_sys_pwrite _thread_sys_pwritev _thread_sys_quotactl diff --git a/lib/libc/hidden/sys/ptrace.h b/lib/libc/hidden/sys/ptrace.h new file mode 100644 index 00000000000..9f1c190fa50 --- /dev/null +++ b/lib/libc/hidden/sys/ptrace.h @@ -0,0 +1,25 @@ +/* $OpenBSD: ptrace.h,v 1.1 2016/03/30 07:55:36 guenther Exp $ */ +/* + * Copyright (c) 2016 Philip Guenther <guenther@openbsd.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBC_SYS_PTRACE_H_ +#define _LIBC_SYS_PTRACE_H_ + +#include_next <sys/ptrace.h> + +PROTO_WRAP(ptrace); + +#endif /* _LIBC_SYS_PTRACE_H_ */ diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 33d762524f9..8d85a113bf7 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.140 2016/03/30 07:52:47 guenther Exp $ +# $OpenBSD: Makefile.inc,v 1.141 2016/03/30 07:55:36 guenther Exp $ # $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 6/17/93 @@ -71,7 +71,7 @@ PASM= ${ASM:.o=.po} SASM= ${ASM:.o=.so} DASM= ${ASM:.o=.do} -PSEUDO= _ptrace.o +PSEUDO= GPSEUDO=${PSEUDO:.o=.go} PPSEUDO=${PSEUDO:.o=.po} SPSEUDO=${PSEUDO:.o=.so} @@ -83,7 +83,7 @@ PPSEUDO_NOERR=${PSEUDO_NOERR:.o=.po} SPSEUDO_NOERR=${PSEUDO_NOERR:.o=.so} DPSEUDO_NOERR=${PSEUDO_NOERR:.o=.do} -HIDDEN= sigaction.o +HIDDEN= sigaction.o _ptrace.o GHIDDEN=${HIDDEN:.o=.go} PHIDDEN=${HIDDEN:.o=.po} SHIDDEN=${HIDDEN:.o=.so} diff --git a/lib/libc/sys/ptrace.c b/lib/libc/sys/ptrace.c index 62d4a941adb..ec0cfda6356 100644 --- a/lib/libc/sys/ptrace.c +++ b/lib/libc/sys/ptrace.c @@ -1,17 +1,16 @@ -/* $OpenBSD: ptrace.c,v 1.4 2005/12/21 01:40:23 millert Exp $ */ +/* $OpenBSD: ptrace.c,v 1.5 2016/03/30 07:55:36 guenther Exp $ */ /* David Leonard <d@openbsd.org>, 1999. Public domain. */ #include <sys/types.h> #include <sys/ptrace.h> #include <errno.h> -int _ptrace(int, pid_t, caddr_t, int); - int -ptrace(int request, pid_t pid, caddr_t addr, int data) +WRAP(ptrace)(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)); + return (ptrace(request, pid, addr, data)); } +DEF_WRAP(ptrace); |