Message ID | 20140504153424.GA16138@domone.podge |
---|---|
State | Superseded |
Headers |
Return-Path: <x14307373@homiemail-mx23.g.dreamhost.com> X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 61FDE360076 for <siddhesh@wilcox.dreamhost.com>; Sun, 4 May 2014 08:35:35 -0700 (PDT) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14307373) id 0507D634A2F94; Sun, 4 May 2014 08:35:34 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx23.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx23.g.dreamhost.com (Postfix) with ESMTPS id C5760634A2F87 for <glibc@patchwork.siddhesh.in>; Sun, 4 May 2014 08:35:34 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; q=dns; s=default; b=nO1MOnApLfSuBRGPRodPEwNTuoGFD1 Sb2T6XV53u5+xa5f3dYi26toV9rD0BwNMGf46vffImt3Th3PrGPdpzkZuoECUsWn G5ko52sAgRf6O3WhYeqf38HQsZxr+89tJ0XYjAmwPU4W9zWi7616kUhNMFi/YJCe TIUNdlb1/6H3o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=default; bh=Cv3LnGTRXyHdbDapxahb4cj9eqQ=; b=arzM Ul/ChKJCpLq0VENcp16tNfpiVIbKOcTx6+K3jiG4rzVyJxykEr0tJ3Lg+eU30E9O 724ud1uz2/XWdfgrcctLRJh0ZOL62V9eIklhl1XF7zKgdcES3k3AZVdL/A2XLSQl Sbj0rcd1RPCk/dR3AO8TNLKN/0T2fXwTHFs6PZU= Received: (qmail 28568 invoked by alias); 4 May 2014 15:35:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-glibc=patchwork.siddhesh.in@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 28557 invoked by uid 89); 4 May 2014 15:35:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: popelka.ms.mff.cuni.cz Date: Sun, 4 May 2014 17:34:24 +0200 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= <neleai@seznam.cz> To: David Miller <davem@davemloft.net> Cc: schwab@linux-m68k.org, libc-alpha@sourceware.org Subject: Re: [PATCH v2][BZ 16852] Do not clobber recvmmsg argument. Message-ID: <20140504153424.GA16138@domone.podge> References: <20140428152937.GA1736@domone.podge> <87mwf5zcl3.fsf@igel.home> <20140428160420.GA23142@domone.podge> <20140428.130122.2188782190759376374.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140428.130122.2188782190759376374.davem@davemloft.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-DH-Original-To: glibc@patchwork.siddhesh.in |
Commit Message
Ondrej Bilka
May 4, 2014, 3:34 p.m. UTC
On Mon, Apr 28, 2014 at 01:01:22PM -0400, David Miller wrote: > From: Ondřej Bílka <neleai@seznam.cz> > Date: Mon, 28 Apr 2014 18:04:20 +0200 > > > * sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Do not clobber > > timeout argument. > > It is extremely unfortunate if we've defined this argument as const, > now you are making it so that the user has no mechanism to get the > updated timeval other than to define their own syscall stubs. > > This is doubly unfortunately since there is absolutely no reason for > us to have defined the interface different from what the kernel > actually provides. Ok, here is second alternative that drops constness. * socket/recvmmsg.c (recvmmsg): Drop const argument. * socket/sys/socket.h: Likewise * sysdeps/unix/sysv/linux/recvmmsg.c: Likewise. --- socket/recvmmsg.c | 2 +- socket/sys/socket.h | 2 +- sysdeps/unix/sysv/linux/recvmmsg.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
Comments
ping On Sun, May 04, 2014 at 05:34:24PM +0200, Ondřej Bílka wrote: > On Mon, Apr 28, 2014 at 01:01:22PM -0400, David Miller wrote: > > From: Ondřej Bílka <neleai@seznam.cz> > > Date: Mon, 28 Apr 2014 18:04:20 +0200 > > > > > * sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Do not clobber > > > timeout argument. > > > > It is extremely unfortunate if we've defined this argument as const, > > now you are making it so that the user has no mechanism to get the > > updated timeval other than to define their own syscall stubs. > > > > This is doubly unfortunately since there is absolutely no reason for > > us to have defined the interface different from what the kernel > > actually provides. > > Ok, here is second alternative that drops constness. > > > * socket/recvmmsg.c (recvmmsg): Drop const argument. > * socket/sys/socket.h: Likewise > * sysdeps/unix/sysv/linux/recvmmsg.c: Likewise. > > --- > socket/recvmmsg.c | 2 +- > socket/sys/socket.h | 2 +- > sysdeps/unix/sysv/linux/recvmmsg.c | 6 +++--- > 3 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/socket/recvmmsg.c b/socket/recvmmsg.c > index ed0c369..3daa501 100644 > --- a/socket/recvmmsg.c > +++ b/socket/recvmmsg.c > @@ -23,7 +23,7 @@ > Returns the number of bytes read or -1 for errors. */ > int > recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, > - const struct timespec *tmo) > + struct timespec *tmo) > { > __set_errno (ENOSYS); > return -1; > diff --git a/socket/sys/socket.h b/socket/sys/socket.h > index 95ee26a..091b08c 100644 > --- a/socket/sys/socket.h > +++ b/socket/sys/socket.h > @@ -209,7 +209,7 @@ extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); > __THROW. */ > extern int recvmmsg (int __fd, struct mmsghdr *__vmessages, > unsigned int __vlen, int __flags, > - const struct timespec *__tmo); > + struct timespec *__tmo); > #endif > > > diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c b/sysdeps/unix/sysv/linux/recvmmsg.c > index 57ddf31..6c9ca44 100644 > --- a/sysdeps/unix/sysv/linux/recvmmsg.c > +++ b/sysdeps/unix/sysv/linux/recvmmsg.c > @@ -35,7 +35,7 @@ > #ifdef __NR_recvmmsg > int > recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, > - const struct timespec *tmo) > + struct timespec *tmo) > { > if (SINGLE_THREAD_P) > return INLINE_SYSCALL (recvmmsg, 5, fd, vmessages, vlen, flags, tmo); > @@ -52,14 +52,14 @@ recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, > # ifndef __ASSUME_RECVMMSG_SOCKETCALL > extern int __internal_recvmmsg (int fd, struct mmsghdr *vmessages, > unsigned int vlen, int flags, > - const struct timespec *tmo) > + struct timespec *tmo) > attribute_hidden; > > static int have_recvmmsg; > > int > recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, > - const struct timespec *tmo) > + struct timespec *tmo) > { > if (__glibc_likely (have_recvmmsg >= 0)) > { > -- > 1.8.4.rc3
ping On Fri, May 23, 2014 at 02:02:02PM +0200, Ondřej Bílka wrote: > ping > On Sun, May 04, 2014 at 05:34:24PM +0200, Ondřej Bílka wrote: > > On Mon, Apr 28, 2014 at 01:01:22PM -0400, David Miller wrote: > > > From: Ondřej Bílka <neleai@seznam.cz> > > > Date: Mon, 28 Apr 2014 18:04:20 +0200 > > > > > > > * sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Do not clobber > > > > timeout argument. > > > > > > It is extremely unfortunate if we've defined this argument as const, > > > now you are making it so that the user has no mechanism to get the > > > updated timeval other than to define their own syscall stubs. > > > > > > This is doubly unfortunately since there is absolutely no reason for > > > us to have defined the interface different from what the kernel > > > actually provides. > > > > Ok, here is second alternative that drops constness. > > > > > > * socket/recvmmsg.c (recvmmsg): Drop const argument. > > * socket/sys/socket.h: Likewise > > * sysdeps/unix/sysv/linux/recvmmsg.c: Likewise. > > > > --- > > socket/recvmmsg.c | 2 +- > > socket/sys/socket.h | 2 +- > > sysdeps/unix/sysv/linux/recvmmsg.c | 6 +++--- > > 3 files changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/socket/recvmmsg.c b/socket/recvmmsg.c > > index ed0c369..3daa501 100644 > > --- a/socket/recvmmsg.c > > +++ b/socket/recvmmsg.c > > @@ -23,7 +23,7 @@ > > Returns the number of bytes read or -1 for errors. */ > > int > > recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, > > - const struct timespec *tmo) > > + struct timespec *tmo) > > { > > __set_errno (ENOSYS); > > return -1; > > diff --git a/socket/sys/socket.h b/socket/sys/socket.h > > index 95ee26a..091b08c 100644 > > --- a/socket/sys/socket.h > > +++ b/socket/sys/socket.h > > @@ -209,7 +209,7 @@ extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); > > __THROW. */ > > extern int recvmmsg (int __fd, struct mmsghdr *__vmessages, > > unsigned int __vlen, int __flags, > > - const struct timespec *__tmo); > > + struct timespec *__tmo); > > #endif > > > > > > diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c b/sysdeps/unix/sysv/linux/recvmmsg.c > > index 57ddf31..6c9ca44 100644 > > --- a/sysdeps/unix/sysv/linux/recvmmsg.c > > +++ b/sysdeps/unix/sysv/linux/recvmmsg.c > > @@ -35,7 +35,7 @@ > > #ifdef __NR_recvmmsg > > int > > recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, > > - const struct timespec *tmo) > > + struct timespec *tmo) > > { > > if (SINGLE_THREAD_P) > > return INLINE_SYSCALL (recvmmsg, 5, fd, vmessages, vlen, flags, tmo); > > @@ -52,14 +52,14 @@ recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, > > # ifndef __ASSUME_RECVMMSG_SOCKETCALL > > extern int __internal_recvmmsg (int fd, struct mmsghdr *vmessages, > > unsigned int vlen, int flags, > > - const struct timespec *tmo) > > + struct timespec *tmo) > > attribute_hidden; > > > > static int have_recvmmsg; > > > > int > > recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, > > - const struct timespec *tmo) > > + struct timespec *tmo) > > { > > if (__glibc_likely (have_recvmmsg >= 0)) > > { > > -- > > 1.8.4.rc3 > > -- > > parallel processors running perpendicular today
On Sun 04 May 2014 17:34:24 Ondřej Bílka wrote: > On Mon, Apr 28, 2014 at 01:01:22PM -0400, David Miller wrote: > > From: Ondřej Bílka <neleai@seznam.cz> > > Date: Mon, 28 Apr 2014 18:04:20 +0200 > > > > > * sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Do not clobber > > > timeout argument. > > > > It is extremely unfortunate if we've defined this argument as const, > > now you are making it so that the user has no mechanism to get the > > updated timeval other than to define their own syscall stubs. > > > > This is doubly unfortunately since there is absolutely no reason for > > us to have defined the interface different from what the kernel > > actually provides. > > Ok, here is second alternative that drops constness. i think everyone agreed this was the best way to go for now -mike
On Sat, Aug 02, 2014 at 10:16:40AM -0400, Mike Frysinger wrote: > On Sun 04 May 2014 17:34:24 Ondřej Bílka wrote: > > On Mon, Apr 28, 2014 at 01:01:22PM -0400, David Miller wrote: > > > From: Ondřej Bílka <neleai@seznam.cz> > > > Date: Mon, 28 Apr 2014 18:04:20 +0200 > > > > > > > * sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Do not clobber > > > > timeout argument. > > > > > > It is extremely unfortunate if we've defined this argument as const, > > > now you are making it so that the user has no mechanism to get the > > > updated timeval other than to define their own syscall stubs. > > > > > > This is doubly unfortunately since there is absolutely no reason for > > > us to have defined the interface different from what the kernel > > > actually provides. > > > > Ok, here is second alternative that drops constness. > > i think everyone agreed this was the best way to go for now > -mike As I decided to relax on holiday this waited a while. I pushed this now.
Ondřej Bílka <neleai@seznam.cz> writes: > * socket/recvmmsg.c (recvmmsg): Drop const argument. ^from > * socket/sys/socket.h: Likewise > * sysdeps/unix/sysv/linux/recvmmsg.c: Likewise. Ok. Andreas.
diff --git a/socket/recvmmsg.c b/socket/recvmmsg.c index ed0c369..3daa501 100644 --- a/socket/recvmmsg.c +++ b/socket/recvmmsg.c @@ -23,7 +23,7 @@ Returns the number of bytes read or -1 for errors. */ int recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, - const struct timespec *tmo) + struct timespec *tmo) { __set_errno (ENOSYS); return -1; diff --git a/socket/sys/socket.h b/socket/sys/socket.h index 95ee26a..091b08c 100644 --- a/socket/sys/socket.h +++ b/socket/sys/socket.h @@ -209,7 +209,7 @@ extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); __THROW. */ extern int recvmmsg (int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags, - const struct timespec *__tmo); + struct timespec *__tmo); #endif diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c b/sysdeps/unix/sysv/linux/recvmmsg.c index 57ddf31..6c9ca44 100644 --- a/sysdeps/unix/sysv/linux/recvmmsg.c +++ b/sysdeps/unix/sysv/linux/recvmmsg.c @@ -35,7 +35,7 @@ #ifdef __NR_recvmmsg int recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, - const struct timespec *tmo) + struct timespec *tmo) { if (SINGLE_THREAD_P) return INLINE_SYSCALL (recvmmsg, 5, fd, vmessages, vlen, flags, tmo); @@ -52,14 +52,14 @@ recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, # ifndef __ASSUME_RECVMMSG_SOCKETCALL extern int __internal_recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, - const struct timespec *tmo) + struct timespec *tmo) attribute_hidden; static int have_recvmmsg; int recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, - const struct timespec *tmo) + struct timespec *tmo) { if (__glibc_likely (have_recvmmsg >= 0)) {