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=-4.0 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 3A6841F461 for ; Wed, 17 Jul 2019 05:16:09 +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:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=B6zVc 3Ouy70bf/gARbvKOVlgCIOeYIwbwu4bCNYmIzcVTVMFiC1NGIATEKcbP1vgq8vDo vFHuqKBrNADqBAOf0JnkQI3o7Xdw8juzWwF1hG8bTiJ47FHOjo18kZdrclS0eAg4 dAIW8UscxlItDnq+ZTU+b3/HpG85pBGHVWfxK8= 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:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=C5sromc1R2j e/EEraxmYnwaa5k8=; b=TdY4krEMYkRC5sHBof2oKwcRQPgk8plTB1xuLCMMt70 CcagTxhiGfrf1IPxXGw0z4+eG1QunzqmoSH0zXcZGoY72kPvmwWpIT2gjKPHKOXg NCyVj7Z2o4sPsj1TsWEFYipWChYOEVoDdGTJVJizxlpXLyPEaLtLMvqlIqzk5lXs = Received: (qmail 23634 invoked by alias); 17 Jul 2019 05:16:07 -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 23210 invoked by uid 89); 17 Jul 2019 05:16:06 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.redhat.com From: Florian Weimer To: Alistair Francis Cc: libc-alpha@sourceware.org, arnd@arndb.de, adhemerval.zanella@linaro.org, palmer@sifive.com, macro@wdc.com, zongbox@gmail.com, alistair23@gmail.com Subject: Re: [RFC v3 01/23] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable References: Date: Wed, 17 Jul 2019 07:16:00 +0200 In-Reply-To: (Alistair Francis's message of "Tue, 16 Jul 2019 17:08:43 -0700") Message-ID: <87sgr5dywf.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain * Alistair Francis: > +#if __TIMESIZE == 32 > +struct timespec64 > +{ > + long int tv_sec; /* Seconds. */ > + long int tv_nsec; /* Nanoseconds. */ > +}; > +#endif > + > int > thrd_sleep (const struct timespec* time_point, struct timespec* remaining) > { > INTERNAL_SYSCALL_DECL (err); > - int ret = INTERNAL_SYSCALL_CANCEL (nanosleep, err, time_point, remaining); > + int ret; > + > +#ifdef __ASSUME_TIME64_SYSCALLS > + ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, CLOCK_REALTIME, > + 0, time_point, remaining); > +#else > +# ifdef __NR_clock_nanosleep_time64 > +# if __TIMESIZE == 64 > + long int ret_64; > + > + ret_64 = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, CLOCK_REALTIME, > + 0, time_point, remaining); > + > + if (ret_64 == 0 || errno != ENOSYS) > + ret = ret_64; > +# else > + timespec64 ts; > + > + ret = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, > + CLOCK_REALTIME, 0, time_point, > + ts); > + > + if (ret == 0 || errno != ENOSYS) { > + remaining->tv_sec = ts.tv_sec; > + remaining->tv_nsec = ts.tv_nsec; > + return ret; > + } > +# endif > +# endif > + ret = INTERNAL_SYSCALL_CANCEL (nanosleep, err, time_point, remaining); > +#endif > + I think this changes the ABI of thrd_sleep if __NR_clock_nanosleep_time64 is defined (and __NR_nanosleep was defined before). Thanks, Florian