From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 dcvr.yhbt.net (Postfix) with ESMTPS id 0CDE11F461 for ; Fri, 30 Aug 2019 17:55:11 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:cc:references:from:subject:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=C60UUZH/Q48OQjo5 Sk2uIXzjPYSXAITq/5VjtiAUNrPdeD7Jk4/kZ7+1ldRgtrcg5IARzr34Gay4Vf4v voBjrYa8IW1AsCWATWZFbQXeSxfIA1Hl4Np1otvE41XKtlSDMMNj6vCrguRWI52E jLDke+AAZBDU4wlOqQsPIDvu4GE= 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:to:cc:references:from:subject:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=89CWwRt0NC0fVoQBZOh/VE wxvsg=; b=LREHOJh1DcS+vl9k4fXbqEWIjW+N3FHOnypHDst7aKW8MTWrl47LOV aI5L+jNxxUoeXFv+kjnQ54ZMzMvqicVZxCQD7jXAu1wDtD6KPZlQq4qcJi5GKnLv uuO/c1vvA6rPXqY0HuxqA/1WhLXOLag7kEjTP7dxdTuENZsOHIAhM= Received: (qmail 12947 invoked by alias); 30 Aug 2019 17:55:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 12937 invoked by uid 89); 30 Aug 2019 17:55:08 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-qk1-f193.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=to:cc:references:from:openpgp:autocrypt:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=04VR+rKrYhK3cNAOFOTaCh40ZckEZ5DxCTcD2R/W4ik=; b=HqZsHJiOUTocUQu14HKKG0LZBFuuaAR5B19kuPjxyK/XtNZejoq/bWK22HwuooARHW JBesW/QQr6cX6GEflbPYl6d/x7zNhX4THwFboJQ0zbjvkuTiv+KqtospQlrb8cR11gYE YGzzqeugou2WoGauvs9JT0Vdgp08zNszfMN3v/CmMGJA1GdOSyfi4JkmljcIk6Kt+4JB +be/DwT4gAITgUagS9Hg1rY8kWXnTmbuGzt+XTeJSwANJiHhEEirNnnbnu07ClnnAysl F958sdcr3P0jKC8FU7OOD/5JcKHglW5koux5wdJckidshcCJWYqs2DmBOLSemZJ1w0p0 1i1g== To: Zack Weinberg , libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , Lukasz Majewski , Alistair Francis , Stepan Golosunov , Arnd Bergmann , Samuel Thibault References: <20190828153236.18229-1-zackw@panix.com> <20190828153236.18229-4-zackw@panix.com> From: Adhemerval Zanella Openpgp: preference=signencrypt Subject: Re: [PATCH v2 03/10] Use clock_settime to implement stime; withdraw stime. Message-ID: <5a7a355b-a8bf-9443-7be3-14f65a528c08@linaro.org> Date: Fri, 30 Aug 2019 14:54:59 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190828153236.18229-4-zackw@panix.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 28/08/2019 12:32, Zack Weinberg wrote: > Unconditionally, on all ports, use clock_settime to implement stime, > not settimeofday or a direct syscall. Then convert stime into a > compatibility symbol and remove its prototype from time.h. > > * time/stime.c (stime): No longer a stub implementation. > Call __clock_settime. Demote to a compatibility symbol. > > * sysdeps/unix/stime.c: Delete file. > * sysdeps/unix/sysv/linux/syscalls.list: Remove entry for stime. > > * time/time.h: Remove prototype for stime. Should we add a NEW entry for this? LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > sysdeps/unix/stime.c | 39 --------------------------- > sysdeps/unix/sysv/linux/syscalls.list | 1 - > time/stime.c | 25 ++++++++--------- > time/time.h | 6 ----- > 4 files changed, 13 insertions(+), 58 deletions(-) > delete mode 100644 sysdeps/unix/stime.c > > diff --git a/sysdeps/unix/stime.c b/sysdeps/unix/stime.c > deleted file mode 100644 > index b0809be400..0000000000 > --- a/sysdeps/unix/stime.c > +++ /dev/null > @@ -1,39 +0,0 @@ > -/* Copyright (C) 1992-2019 Free Software Foundation, Inc. > - This file is part of the GNU C Library. > - > - The GNU C Library is free software; you can redistribute it and/or > - modify it under the terms of the GNU Lesser General Public > - License as published by the Free Software Foundation; either > - version 2.1 of the License, or (at your option) any later version. > - > - The GNU C Library is distributed in the hope that it will be useful, > - but WITHOUT ANY WARRANTY; without even the implied warranty of > - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > - Lesser General Public License for more details. > - > - You should have received a copy of the GNU Lesser General Public > - License along with the GNU C Library; if not, see > - . */ > - > -#include > -#include /* For NULL. */ > -#include > -#include > - > -/* Set the system clock to *WHEN. */ > - > -int > -stime (const time_t *when) > -{ > - struct timeval tv; > - > - if (when == NULL) > - { > - __set_errno (EINVAL); > - return -1; > - } > - > - tv.tv_sec = *when; > - tv.tv_usec = 0; > - return __settimeofday (&tv, (struct timezone *) 0); > -} Ok. > diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list > index cdcf6c127b..70b110979b 100644 > --- a/sysdeps/unix/sysv/linux/syscalls.list > +++ b/sysdeps/unix/sysv/linux/syscalls.list > @@ -61,7 +61,6 @@ setfsgid EXTRA setfsgid i:i setfsgid > setfsuid EXTRA setfsuid i:i setfsuid > setpgid - setpgid i:ii __setpgid setpgid > sigaltstack - sigaltstack i:PP __sigaltstack sigaltstack > -stime - stime i:p stime > sysinfo EXTRA sysinfo i:p __sysinfo sysinfo > swapon - swapon i:si __swapon swapon > swapoff - swapoff i:s __swapoff swapoff Ok. > diff --git a/time/stime.c b/time/stime.c > index de58c49562..754e2da0b0 100644 > --- a/time/stime.c > +++ b/time/stime.c > @@ -15,23 +15,24 @@ > License along with the GNU C Library; if not, see > . */ > > -#include > +#include > + > +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_31) > + > #include > -#include > > /* Set the system clock to *WHEN. */ > > int > -stime (const time_t *when) > +attribute_compat_text_section > +__stime (const time_t *when) > { > - if (when == NULL) > - { > - __set_errno (EINVAL); > - return -1; > - } > - > - __set_errno (ENOSYS); > - return -1; > + struct timespec ts; > + ts.tv_sec = *when; > + ts.tv_nsec = 0; > + > + return __clock_settime (CLOCK_REALTIME, &ts); > } > > -stub_warning (stime) > +compat_symbol (libc, __stime, stime, GLIBC_2_0); > +#endif Ok. > diff --git a/time/time.h b/time/time.h > index cba6d15260..57cfd4d330 100644 > --- a/time/time.h > +++ b/time/time.h > @@ -175,12 +175,6 @@ extern int daylight; > extern long int timezone; > #endif > > -#ifdef __USE_MISC > -/* Set the system time to *WHEN. > - This call is restricted to the superuser. */ > -extern int stime (const time_t *__when) __THROW; > -#endif > - > > /* Nonzero if YEAR is a leap year (every 4 years, > except every 100th isn't, and every 400th is). */ > Ok.