From: Dmitry V. Levin Date: Tue, 24 Nov 2015 02:39:01 +0000 (+0000) Subject: Remove parsers of getpmsg and putpmsg syscalls X-Git-Tag: v4.11~116 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a56a81c1ec0495b4f644d901ddaa2b54cb3122fe;p=strace Remove parsers of getpmsg and putpmsg syscalls These system calls are not implemented in the Linux kernel. * linux/dummy.h(getpmsg, putpmsg): Move to the list of deprecated syscalls. * Makefile.am (strace_SOURCES): Remove stream.c. * stream.c: Remove. * xlat/pmsgflags.in: Remove. --- diff --git a/Makefile.am b/Makefile.am index 1a1a6470..dbe15d81 100644 --- a/Makefile.am +++ b/Makefile.am @@ -144,7 +144,6 @@ strace_SOURCES = \ sram_alloc.c \ statfs.c \ strace.c \ - stream.c \ swapon.c \ sync_file_range.c \ syscall.c \ diff --git a/linux/dummy.h b/linux/dummy.h index ea0c6c71..0c89d22e 100644 --- a/linux/dummy.h +++ b/linux/dummy.h @@ -129,13 +129,15 @@ #define sys_break printargs #define sys_ftime printargs #define sys_get_kernel_syms printargs +#define sys_getpmsg printargs #define sys_gtty printargs #define sys_lock printargs #define sys_mpx printargs #define sys_nfsservctl printargs #define sys_phys printargs -#define sys_profil printargs #define sys_prof printargs +#define sys_profil printargs +#define sys_putpmsg printargs #define sys_query_module printargs #define sys_security printargs #define sys_stty printargs @@ -149,16 +151,3 @@ #define sys_oldolduname printargs #define sys_olduname printargs #define sys_sysfs printargs - -/* Who has STREAMS syscalls? - * Linux hasn't. Solaris has (had?). - * Just in case I miss something, retain in for Sparc. - * Note: SYS_get/putpmsg may be defined even though syscalls - * return ENOSYS. Can't just check defined(SYS_getpmsg). - */ -#if (!defined(SPARC) && !defined(SPARC64)) || !defined(SYS_getpmsg) -#define sys_getpmsg printargs -#endif -#if (!defined(SPARC) && !defined(SPARC64)) || !defined(SYS_putpmsg) -#define sys_putpmsg printargs -#endif diff --git a/stream.c b/stream.c deleted file mode 100644 index e1836a20..00000000 --- a/stream.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey - * Copyright (c) 1996-1999 Wichert Akkerman - * 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. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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 "defs.h" - -/* Who has STREAMS syscalls? - * Linux hasn't. Solaris has (had?). - * Just in case I miss something, retain in for Sparc... - */ -#if (defined SPARC || defined SPARC64) \ - && (defined SYS_putpmsg || defined SYS_getpmsg) - -# ifdef HAVE_STROPTS_H -# include -# else -struct strbuf { - int maxlen; /* no. of bytes in buffer */ - int len; /* no. of bytes returned */ - const char *buf; /* pointer to data */ -}; -# define MORECTL 1 -# define MOREDATA 2 -# endif - -static void -printstrbuf(struct tcb *tcp, struct strbuf *sbp, int getting) -{ - if (sbp->maxlen == -1 && getting) - tprints("{maxlen=-1}"); - else { - tprints("{"); - if (getting) - tprintf("maxlen=%d, ", sbp->maxlen); - tprintf("len=%d, buf=", sbp->len); - printstr(tcp, (unsigned long) sbp->buf, sbp->len); - tprints("}"); - } -} - -static void -printstrbufarg(struct tcb *tcp, long arg, int getting) -{ - struct strbuf buf; - - if (arg == 0) - tprints("NULL"); - else if (umove(tcp, arg, &buf) < 0) - tprints("{...}"); - else - printstrbuf(tcp, &buf, getting); - tprints(", "); -} - -# include "xlat/pmsgflags.h" -# ifdef SYS_putpmsg -SYS_FUNC(putpmsg) -{ - int i; - - if (entering(tcp)) { - /* fd */ - tprintf("%ld, ", tcp->u_arg[0]); - /* control and data */ - for (i = 1; i < 3; i++) - printstrbufarg(tcp, tcp->u_arg[i], 0); - /* band */ - tprintf("%ld, ", tcp->u_arg[3]); - /* flags */ - printflags(pmsgflags, tcp->u_arg[4], "MSG_???"); - } - return 0; -} -# endif -# ifdef SYS_getpmsg -SYS_FUNC(getpmsg) -{ - int i, flags; - - if (entering(tcp)) { - /* fd */ - tprintf("%lu, ", tcp->u_arg[0]); - } else { - if (syserror(tcp)) { - tprintf("%#lx, %#lx, %#lx, %#lx", tcp->u_arg[1], - tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[4]); - return 0; - } - /* control and data */ - for (i = 1; i < 3; i++) - printstrbufarg(tcp, tcp->u_arg[i], 1); - /* pointer to band */ - printnum_int(tcp, tcp->u_arg[3], "%d"); - tprints(", "); - /* pointer to flags */ - if (tcp->u_arg[4] == 0) - tprints("NULL"); - else if (umove(tcp, tcp->u_arg[4], &flags) < 0) - tprints("[?]"); - else { - tprints("["); - printflags(pmsgflags, flags, "MSG_???"); - tprints("]"); - } - /* decode return value */ - switch (tcp->u_rval) { - case MORECTL: - tcp->auxstr = "MORECTL"; - break; - case MORECTL|MOREDATA: - tcp->auxstr = "MORECTL|MOREDATA"; - break; - case MOREDATA: - tcp->auxstr = "MORECTL"; - break; - default: - tcp->auxstr = NULL; - break; - } - } - return RVAL_HEX | RVAL_STR; -} -# endif -#endif /* STREAMS syscalls support */ diff --git a/xlat/pmsgflags.in b/xlat/pmsgflags.in deleted file mode 100644 index cae7c52d..00000000 --- a/xlat/pmsgflags.in +++ /dev/null @@ -1,3 +0,0 @@ -MSG_HIPRI -MSG_ANY -MSG_BAND