From patchwork Mon Jul 13 17:10:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 40069 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DF8BB388E802; Mon, 13 Jul 2020 17:10:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF8BB388E802 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594660237; bh=vZZPYz1yNpcYMjhuuqV02/PDTAhyM67ftBfGqIZBFi4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=OhaRSviMpzO1QRCrXd9PIb9yW2CSLDkzk5SyDsjwJZ+G8Z4EmWxjF9UOtDUPOZ4al OFF7Jxodwd1fDGKZiyCpNchqYsX3CZA2Jx6yz1osZnUD/2gGzfmpiiTsLX+OZ+mdX3 bW9Zgertu3erQsy4A8lxVG4UJ0rt+4+A879XOfEU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by sourceware.org (Postfix) with ESMTPS id 5476A388CC3A for ; Mon, 13 Jul 2020 17:10:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5476A388CC3A Received: by mail-qv1-xf44.google.com with SMTP id t11so6119616qvk.1 for ; Mon, 13 Jul 2020 10:10:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vZZPYz1yNpcYMjhuuqV02/PDTAhyM67ftBfGqIZBFi4=; b=W6x/20EIp0/yNGZGKlzCyxPLnegWl0N0xTAfVGVkCC2a4dp2zaAxJf3XxF2Dg6KgSV MXR4qaQrm2eOgCxJO0akcWqnWluZSCfzESxy9jqY3RPITSDlCqv6l2z6txPkS6phpNT8 MGHTVsx2hjLzCo1eymbZAp4mcPXed3p5rm/nLAJqOec18ovkog5uoQ/hFlR1upBMxhkH mwZMKlhtDH9ty8qmixMDKF+lV3uJOOEHGR7CwG2IGrlyzbZZi1r9xwttvUV7uRxsqT/a LeAQJ3maMAAAcSf57enaY6cW+kGRKCEY4YUrLM/cLxC+VnT6JKN/V6Z3EU/MEv4nXf51 sKlg== X-Gm-Message-State: AOAM531RsvPl1LNVX0ykTgzAjf0q2pAMr4zEDP5vuoITMKE7n0IlFHvg 8kbKq/iM61wUTkz+oQpn9h2jaJV3Vn0= X-Google-Smtp-Source: ABdhPJzv3K6Ij53IrEQkpEQTsHjCluu9gEHo0gkTzlMqZLB4ul/v1kJIvGRC6ZqWdIFIW2Fch8IAwg== X-Received: by 2002:a0c:a993:: with SMTP id a19mr490497qvb.34.1594660234710; Mon, 13 Jul 2020 10:10:34 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id v10sm19767919qtk.14.2020.07.13.10.10.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 10:10:34 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 04/23] linux: Simplify clock_settime Date: Mon, 13 Jul 2020 14:10:06 -0300 Message-Id: <20200713171025.3661832-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713171025.3661832-1-adhemerval.zanella@linaro.org> References: <20200713171025.3661832-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" With arch-syscall.h it can now assumes the existance of either __NR_clock_settime or __NR_clock_settime_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski --- sysdeps/unix/sysv/linux/clock_settime.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sysdeps/unix/sysv/linux/clock_settime.c b/sysdeps/unix/sysv/linux/clock_settime.c index ebda871f4c..ce0bf622c0 100644 --- a/sysdeps/unix/sysv/linux/clock_settime.c +++ b/sysdeps/unix/sysv/linux/clock_settime.c @@ -32,17 +32,15 @@ __clock_settime64 (clockid_t clock_id, const struct __timespec64 *tp) return -1; } -#ifdef __ASSUME_TIME64_SYSCALLS -# ifndef __NR_clock_settime64 -# define __NR_clock_settime64 __NR_clock_settime -# endif - return INLINE_SYSCALL_CALL (clock_settime64, clock_id, tp); -#else -# ifdef __NR_clock_settime64 +#ifndef __NR_clock_settime64 +# define __NR_clock_settime64 __NR_clock_settime +#endif int ret = INLINE_SYSCALL_CALL (clock_settime64, clock_id, tp); + +#ifndef __ASSUME_TIME64_SYSCALLS if (ret == 0 || errno != ENOSYS) return ret; -# endif + if (! in_time_t_range (tp->tv_sec)) { __set_errno (EOVERFLOW); @@ -50,8 +48,10 @@ __clock_settime64 (clockid_t clock_id, const struct __timespec64 *tp) } struct timespec ts32 = valid_timespec64_to_timespec (*tp); - return INLINE_SYSCALL_CALL (clock_settime, clock_id, &ts32); + ret = INLINE_SYSCALL_CALL (clock_settime, clock_id, &ts32); #endif + + return ret; } #if __TIMESIZE != 64