From patchwork Fri Mar 5 20:14:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42283 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 68293382D433; Fri, 5 Mar 2021 20:15:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68293382D433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975329; bh=VErfY+DhGQEDQFjo3uEOKAKzPtDWGaBzng4PZvZ5G/Q=; 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=DmtpIdKv9YPLa0fih6CWfWeCyHgXG/OjA9BfPWU95Yv3R47U6PWsDBy5dDhG6hbzB VF7sR0AspB+kCLtCvJR7BM+47BHYmVMQij2D4/EGcG+k5g123lzVaAGjR5y5oODLqU lG9v9GUfWuDo7Bzn3EGP8RH+ungsXmu6ZbGYWKHQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by sourceware.org (Postfix) with ESMTPS id 92BBA3836C4A for ; Fri, 5 Mar 2021 20:15:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 92BBA3836C4A Received: by mail-qk1-x72e.google.com with SMTP id l4so3311299qkl.0 for ; Fri, 05 Mar 2021 12:15:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VErfY+DhGQEDQFjo3uEOKAKzPtDWGaBzng4PZvZ5G/Q=; b=K+WYgtYG5n6grzEBuXnq6rPcdwOVEwS+YcQYpptCrfqro8xfRNEYmhrDsY66eTzgzX yyVII68JmCfu4Hgto2PsDPd/WIfwkvwu89hBWXZndn2pQKvLOzyj1QHWGWAfLST0k5ts 5HpVgg6pTrMQGi6L+sGNW6Gf9qhJQYSBAajWl5IwxYKYUeJjteuA+BQGULv0I1a0IK/W msuYKDD69fNIQwQSSlwMXNAqJQEt5wIUM3q6ISvciOVV/8qEjhOzDuTJ9AMP4sx6cNTH KCMgHLfAWw1yDWAY5s6XqT0WRLqICDmejAqlkyZMKT3k7OapbFRwCtO08zoBkTc7JYaR EF0g== X-Gm-Message-State: AOAM533JkTwY8CFJWcExwQ1sQd8QT75M4LnqgkkH4aMetONPcG6joDw5 knlOjltw2PjOYsZrcqHPRo+tkVD/yM3yOQ== X-Google-Smtp-Source: ABdhPJyIvNZ8cQ/czP0asSsJvBxSEvUH/ZznzTY1fImsCi2XB5Z4yP42k+ScdtdJ+cQs0Q52vuvLFw== X-Received: by 2002:a37:584:: with SMTP id 126mr10285177qkf.274.1614975324607; Fri, 05 Mar 2021 12:15:24 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:24 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 01/52] io: Use temporary directory and file for ftwtest-sh Date: Fri, 5 Mar 2021 17:14:27 -0300 Message-Id: <20210305201518.798584-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Instead of creating files on glibc source dir. It also allows run in parallel. Checked on x86_64-linux-gnu. --- io/ftwtest-sh | 246 +++++++++++++++++++++++++------------------------- 1 file changed, 121 insertions(+), 125 deletions(-) diff --git a/io/ftwtest-sh b/io/ftwtest-sh index a9ae33ff30..6d553dad5d 100644 --- a/io/ftwtest-sh +++ b/io/ftwtest-sh @@ -42,16 +42,12 @@ LC_ALL=C export LC_ALL # First create our scenario: -tmp=${objpfx}io -tmpdir=$tmp/ftwtest.d +tmp=/tmp +tmpdir=$(mktemp -d $tmp/ftwtest.d.XXXXXX) +ftwtest=$(basename $tmpdir) -trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 0 1 2 3 15 +#trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 0 1 2 3 15 -if test -d $tmpdir; then - chmod -fR a+x $tmpdir - rm -fr $tmpdir -fi -mkdir $tmpdir mkdir $tmpdir/foo mkdir $tmpdir/bar echo > $tmpdir/baz @@ -67,24 +63,24 @@ ln -s $tmpdir/foo/lvl1/lvl2/lvl3/lvl4 $tmpdir/foo/lvl1/link@1 echo > $tmpdir/bar/xo chmod a-x,a+r $tmpdir/bar -testout=$tmp/ftwtest-tmp.out +testout=$(mktemp $tmp/ftwtest-tmp-XXXXXX.out) $testprogram $tmpdir | sort > $testout cat < $testout cat < $testout cat </dev/null` cat </dev/null` cd "$tmp" -$testprogram --chdir ftwtest.d | +$testprogram --chdir $ftwtest | sort > $testout cd "$curwd" cat < $testout cd "$curwd" cat </dev/null` cd "$tmp" -$testprogram --chdir ftwtest.d/foo/lvl1/link@1 | +$testprogram --chdir $ftwtest/foo/lvl1/link@1 | sort > $testout cd "$curwd" cat < $testout cat < $testout cat < X-Patchwork-Id: 42282 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 DBA7A382D42B; Fri, 5 Mar 2021 20:15:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DBA7A382D42B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975328; bh=TvOgmnBZ4SjkK6leemq9t6D8nUhX8K6fAjlCt52zXrI=; 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=eMQVkOfCyuhu+EiUYIf/E9U6xOd65qVs/ZOb8tHqEybFb9/r2Syb3bdRxkg/55b4R wvgHrbRcJ0I1XjKgVm1+sSY/Fx+f9k1iG2Wf8lTTlTXE08qj/WZYl/Ml+yjv9anXRJ NrSfDJgz57EwEey5Xg8SxNQDcYMvW3Wr+SdP1D38= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by sourceware.org (Postfix) with ESMTPS id 5BEDC382D42B for ; Fri, 5 Mar 2021 20:15:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5BEDC382D42B Received: by mail-qt1-x834.google.com with SMTP id 2so2795749qtw.1 for ; Fri, 05 Mar 2021 12:15:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TvOgmnBZ4SjkK6leemq9t6D8nUhX8K6fAjlCt52zXrI=; b=REyQToFNNPcY2hToLlxfe/jiPpCN4+mRSjmS0Czpq8PMm7h2aYIuZaM/zasQhgkJz4 bqOWPkg6qV5xgiPajfaPAQTf1WOrQDQwJxFLySTzk/77z/QjRL7W4zrE6aGlTRvoeDic 2x8V44SfPF/Y36eG68Jx9AcwRy61rcIr1DqXPQMOPWVChTxaAwhfg+OJxRAWvTrhXSia qfTbbq638vwmD66TqjTcRe554/qvuowbaI2bq8jVyuULdcyxBXCw3i76+zCXJ72ZxGuW EuNzkSjl5vdsWv2eGl60X302lfk4y1Zxhz/MHm4bzTqYzvBca/nNY4o24mWlDCakCG3N diHg== X-Gm-Message-State: AOAM533PkWyFyYqZqvp5wjIKZGtiYn2mGN4CQHUlkwrPMuywGGPOWYLE KDdw7LpiRGXpg9W0q/hN5Rh6Yf+k7MiY+A== X-Google-Smtp-Source: ABdhPJzp7Jx0VBu2kT4ol8IAcKtEHJHcrA8PFAjKaeQJzNQx9JXDaSxJ4Ei3Sx6ZTaNWSgLpuX9rbg== X-Received: by 2002:ac8:5d42:: with SMTP id g2mr10730402qtx.46.1614975325769; Fri, 05 Mar 2021 12:15:25 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:25 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 02/52] linux: Add futimes test Date: Fri, 5 Mar 2021 17:14:28 -0300 Message-Id: <20210305201518.798584-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It uses stat to compare against the values set by futimes. Checked on i686-linux-gnu. --- sysdeps/unix/sysv/linux/Makefile | 4 +- sysdeps/unix/sysv/linux/tst-futimes.c | 85 +++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 sysdeps/unix/sysv/linux/tst-futimes.c diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 51e28b97ac..94b933310b 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -107,7 +107,9 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \ tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \ tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux \ - tst-timerfd tst-ppoll tst-futimens tst-utime tst-utimes + tst-timerfd tst-ppoll tst-futimens tst-utime tst-utimes \ + tst-futimes + tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables diff --git a/sysdeps/unix/sysv/linux/tst-futimes.c b/sysdeps/unix/sysv/linux/tst-futimes.c new file mode 100644 index 0000000000..026b0af023 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-futimes.c @@ -0,0 +1,85 @@ +/* Basix test for utimes. + Copyright (C) 2021 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 +#include +#include +#include +#include +#include + +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + +static int temp_fd = -1; +static char *testfile; + +/* struct timeval array with Y2038 threshold minus 2 and 1 seconds. */ +const static struct timeval t1[2] = { { 0x7FFFFFFE, 0 }, { 0x7FFFFFFF, 0 } }; + +/* struct timeval array with Y2038 threshold plus 1 and 2 seconds. */ +const static struct timeval t2[2] = { { 0x80000001ULL, 0 }, + { 0x80000002ULL, 0 } }; + +/* struct timeval array around Y2038 threshold. */ +const static struct timeval t3[2] = { { 0x7FFFFFFE, 0 }, + { 0x80000002ULL, 0 } }; + +#define PREPARE do_prepare +static void +do_prepare (int argc, char *argv[]) +{ + temp_fd = create_temp_file ("utimes", &testfile); + TEST_VERIFY_EXIT (temp_fd > 0); +} + +static int +test_utime_helper (const struct timeval *tv) +{ + /* Check if we run on port with 32 bit time_t size */ + time_t t; + if (__builtin_add_overflow (tv->tv_sec, 0, &t)) + return 0; + + TEST_VERIFY_EXIT (futimes (temp_fd, tv) == 0); + + struct_stat st; + xfstat (temp_fd, &st); + + /* Check if seconds for atime match */ + TEST_COMPARE (st.st_atime, tv[0].tv_sec); + + /* Check if seconds for mtime match */ + TEST_COMPARE (st.st_mtime, tv[1].tv_sec); + + return 0; +} + +static int +do_test (void) +{ + test_utime_helper (&t1[0]); + test_utime_helper (&t2[0]); + test_utime_helper (&t3[0]); + + return 0; +} + +#include From patchwork Fri Mar 5 20:14:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42285 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 03DD9382D43F; Fri, 5 Mar 2021 20:15:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03DD9382D43F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975332; bh=aqnGkRJTd78CPItQXUjOIGvPG6GaR3+m2D1Zb6lAipc=; 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=lXjsIDffK/QxGsOHOClmkSoLTlyLphakmgKcDlatzxZFohcIfYLd8LcmdtIGLeT1a UYtkE85GyEo1LDFJl7h4n4Kfxve0C5AkHlZwgcv4JmBwSBXE02BSLVET97jH56jfFM xUvoleHmMPQmxoYza4zPCAvgbx4TMDfUPo0zDygM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by sourceware.org (Postfix) with ESMTPS id 78EAB382D42E for ; Fri, 5 Mar 2021 20:15:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 78EAB382D42E Received: by mail-qt1-x835.google.com with SMTP id s15so2799264qtq.0 for ; Fri, 05 Mar 2021 12:15:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aqnGkRJTd78CPItQXUjOIGvPG6GaR3+m2D1Zb6lAipc=; b=j22GRfTCpXGurTxrVwkRrjqziSDrI1MnYuaciRjjBYSZZT9qvjeLB+tnxdrGamVO5B j4xrR0XRwgzjKJdnor7yicsVP/vpKKMdeY7W7QfCQx24ovylcm/mM6VfrRMTnRCCgMT3 M6AiEYKd9/Tzmfzqd2qzA5hk2JSaKBmQF+VRppY/DV1LFh9o1qQ6OibKFej0rlCd+1NH +4av3Ol/kB4NY1IeKspbbOYW7Ov9nSyyK7QDzxz4MrFAyVIFoeMIfYu4zqF5qogKMbRO cLvesrEuF1WbgplDZJtyHUedImQ4lfwUg1avft74jllgg9eAAlssrpsszVPGmqm9BzWw R6QQ== X-Gm-Message-State: AOAM5314mGJgg229HHLIlGurOkEflNu/Zpz9cmLw+t4p8LuHHEPwNnkW zUoP6SS1a9ZEwH7zxeclTYI/xaaP0cDhWA== X-Google-Smtp-Source: ABdhPJw344Wmvg0FFgWLGW8Et/260/nuWnB5jlUCxUp78piQ1NLgZhvM6+6nZ1QYs4HWD0kR2G9lOg== X-Received: by 2002:aed:2c22:: with SMTP id f31mr726610qtd.219.1614975326857; Fri, 05 Mar 2021 12:15:26 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:26 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 03/52] linux: Add lutimes test Date: Fri, 5 Mar 2021 17:14:29 -0300 Message-Id: <20210305201518.798584-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It uses stat to compare against the values set by lutimes. Checked on i686-linux-gnu. --- sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/tst-lutimes.c | 95 +++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 sysdeps/unix/sysv/linux/tst-lutimes.c diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 94b933310b..b206f77594 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -108,7 +108,7 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \ tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux \ tst-timerfd tst-ppoll tst-futimens tst-utime tst-utimes \ - tst-futimes + tst-futimes tst-lutimes tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc diff --git a/sysdeps/unix/sysv/linux/tst-lutimes.c b/sysdeps/unix/sysv/linux/tst-lutimes.c new file mode 100644 index 0000000000..9e30691bbe --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-lutimes.c @@ -0,0 +1,95 @@ +/* Basix test for utimes. + Copyright (C) 2021 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 +#include +#include +#include + +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + +static int temp_fd = -1; +static char *testfile; +static char *testlink; + +/* struct timeval array with Y2038 threshold minus 2 and 1 seconds. */ +const static struct timeval t1[2] = { { 0x7FFFFFFE, 0 }, { 0x7FFFFFFF, 0 } }; + +/* struct timeval array with Y2038 threshold plus 1 and 2 seconds. */ +const static struct timeval t2[2] = { { 0x80000001ULL, 0 }, + { 0x80000002ULL, 0 } }; + +/* struct timeval array around Y2038 threshold. */ +const static struct timeval t3[2] = { { 0x7FFFFFFE, 0 }, + { 0x80000002ULL, 0 } }; + +#define PREPARE do_prepare +static void +do_prepare (int argc, char *argv[]) +{ + temp_fd = create_temp_file ("utimes", &testfile); + TEST_VERIFY_EXIT (temp_fd > 0); + + testlink = xasprintf ("%s-symlink", testfile); + xsymlink (testfile, testlink); + add_temp_file (testlink); +} + +static int +test_utime_helper (const struct timeval *tv) +{ + /* Check if we run on port with 32 bit time_t size */ + time_t t; + if (__builtin_add_overflow (tv->tv_sec, 0, &t)) + return 0; + + struct_stat stfile_orig; + xlstat (testfile, &stfile_orig); + + TEST_VERIFY_EXIT (lutimes (testlink, tv) == 0); + + struct_stat stlink; + xlstat (testlink, &stlink); + + TEST_COMPARE (stlink.st_atime, tv[0].tv_sec); + TEST_COMPARE (stlink.st_mtime, tv[1].tv_sec); + + /* Check if the timestamp from original file is not changed. */ + struct_stat stfile; + xlstat (testfile, &stfile); + + TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime); + TEST_COMPARE (stfile_orig.st_mtime, stfile.st_mtime); + + return 0; +} + +static int +do_test (void) +{ + test_utime_helper (&t1[0]); + test_utime_helper (&t2[0]); + test_utime_helper (&t3[0]); + + return 0; +} + +#include From patchwork Fri Mar 5 20:14:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42286 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 8C9F73885C03; Fri, 5 Mar 2021 20:15:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C9F73885C03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975332; bh=usjtUNlGwudA7PRwzes++bSCupg3AAaTBIieCKfPr1A=; 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=pO9Vnd1ftgiNsEm7YmOdWwm4mr36rq9/Sg4ufAKAgwv3VNWP/QoMLVpqf8jGSPqwL vFH8sxGGKb4Nj0RYGX+q2iC1gdQzgzigwF1okUjvPBM4Y3F+YPuVl6ii0v9EHtAk7T tT01Iu2xNwhBIs4ZlckW3tgDKxeR4vNg0Qi5u6U0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id 9677E3836C4A for ; Fri, 5 Mar 2021 20:15:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9677E3836C4A Received: by mail-qk1-x72a.google.com with SMTP id s7so3291058qkg.4 for ; Fri, 05 Mar 2021 12:15:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=usjtUNlGwudA7PRwzes++bSCupg3AAaTBIieCKfPr1A=; b=WLBln5go1yoCkwK1hbSF9vi//ym2o+Vllr9Fzf1UDPo/A7aRsTLEN68C4wtki4JGbe 5Fq6VEdNKLPk6DrfGq3PYQqLPNIqH7E0s8IjSnLmDbgjyzfP/simtMpZiZB1H65eprlM tpi0sY8RijC+Nql71s+G/XBQWlneRZVsxL/c/HLbgLPMEoDqWGXvidiI7VUntjfXvp5z CgoiAmEIWCcwZsyeXNAfVI36ZXUWWw+w1PJ8Aw/RvT6uiyh3xYfKlTnBiTRXOJ9AHNqw QkgP4D41u0OKf2dIjQLtPxFGay9B1Y6fFA7C5Kd2OHFAasu3LpyS6Uks6Q/yEZ6/w6yb Km6A== X-Gm-Message-State: AOAM531spaYZhifFkjWw72h7MGPCkf7mYrOtZFw0PJm4h6Z9k7zhGKLc xjPWntSRClmRqPnIuBhojhf8dyv099bYsw== X-Google-Smtp-Source: ABdhPJyaY/vICRVJWjizn3kLe6bc3VfuQ5Ggyt0JyMCp/jeAlOPHbkgieERvdxaRXHK4VQzr6HC+5w== X-Received: by 2002:a37:30f:: with SMTP id 15mr11057731qkd.494.1614975327978; Fri, 05 Mar 2021 12:15:27 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:27 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 04/52] time: Add getitimer and setitimer basic tests Date: Fri, 5 Mar 2021 17:14:30 -0300 Message-Id: <20210305201518.798584-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on i686-linux-gnu and x86_64-linux-gnu. --- time/Makefile | 2 +- time/tst-itimer.c | 175 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 time/tst-itimer.c diff --git a/time/Makefile b/time/Makefile index a52b6b94bc..ccc9eefd61 100644 --- a/time/Makefile +++ b/time/Makefile @@ -48,7 +48,7 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \ tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime \ tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \ tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \ - tst-adjtime tst-ctime tst-difftime tst-mktime4 + tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer include ../Rules diff --git a/time/tst-itimer.c b/time/tst-itimer.c new file mode 100644 index 0000000000..e464d6b092 --- /dev/null +++ b/time/tst-itimer.c @@ -0,0 +1,175 @@ +/* Basic tests for getitimer and setitimer. + Copyright (C) 2021 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 +#include +#include +#include +#include +#include +#include + +static sig_atomic_t cnt; + +static void +alrm_handler (int sig) +{ + if (++cnt > 3) + cnt = 3; +} + +static void +intr_sleep (int sec) +{ + struct timespec ts = { .tv_sec = sec, .tv_nsec = 0 }; + while (nanosleep (&ts, &ts) == -1 && errno == EINTR) + ; +} + +static int +do_test (void) +{ + struct itimerval it, it_old; + const int timers[] = { ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF }; + for (int i = 0; i < array_length (timers); i++) + { + TEST_COMPARE (getitimer (timers[i], &it), 0); + + /* No timer set, all value should be 0. */ + TEST_COMPARE (it.it_interval.tv_sec, 0); + TEST_COMPARE (it.it_interval.tv_usec, 0); + TEST_COMPARE (it.it_value.tv_sec, 0); + TEST_COMPARE (it.it_value.tv_usec, 0); + + it.it_interval.tv_sec = 10; + it.it_interval.tv_usec = 20; + TEST_COMPARE (setitimer (timers[i], &it, NULL), 0); + + TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, &it_old), + 0); + /* ITIMER_REAL returns { 0, 0 } for single-sort timers, while + other timers returns setitimer value. */ + if (timers[i] == ITIMER_REAL) + { + TEST_COMPARE (it_old.it_interval.tv_sec, 0); + TEST_COMPARE (it_old.it_interval.tv_usec, 0); + } + else + { + TEST_COMPARE (it_old.it_interval.tv_sec, 10); + TEST_COMPARE (it_old.it_interval.tv_usec, 20); + } + + /* Create a periodic timer and check if the return value is the one + previously set. */ + it.it_interval.tv_sec = 10; + it.it_interval.tv_usec = 20; + it.it_value.tv_sec = 30; + it.it_value.tv_usec = 40; + TEST_COMPARE (setitimer (timers[i], &it, NULL), 0); + + TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, &it_old), + 0); + TEST_COMPARE (it.it_interval.tv_sec, it_old.it_interval.tv_sec); + TEST_COMPARE (it.it_interval.tv_usec, it_old.it_interval.tv_usec); + + if (sizeof (time_t) == 4) + continue; + + /* Same as before, but with a 64 bit time_t value. */ + it.it_interval.tv_sec = (time_t) 0x1ffffffffull; + it.it_interval.tv_usec = 20; + it.it_value.tv_sec = 0; + it.it_value.tv_usec = 0; + + /* Linux does not provide 64 bit time_t support for getitimer and + setitimer on architectures with 32 bit time_t support. */ + if (sizeof (__time_t) == 8) + { + TEST_COMPARE (setitimer (timers[i], &it, NULL), 0); + TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, + &it_old), + 0); + /* ITIMER_REAL returns { 0, 0 } for single-sort timers, while other + timers returns setitimer value. */ + if (timers[i] == ITIMER_REAL) + { + TEST_COMPARE (it_old.it_interval.tv_sec, 0ull); + TEST_COMPARE (it_old.it_interval.tv_usec, 0); + } + else + { + TEST_COMPARE (it_old.it_interval.tv_sec, 0x1ffffffffull); + TEST_COMPARE (it_old.it_interval.tv_usec, 20); + } + } + else + { + TEST_COMPARE (setitimer (timers[i], &it, NULL), -1); + TEST_COMPARE (errno, EOVERFLOW); + } + + /* Create a periodic timer and check if the return value is the one + previously set. */ + it.it_interval.tv_sec = (time_t) 0x1ffffffffull; + it.it_interval.tv_usec = 20; + it.it_value.tv_sec = 30; + it.it_value.tv_usec = 40; + if (sizeof (__time_t) == 8) + { + TEST_COMPARE (setitimer (timers[i], &it, NULL), 0); + + TEST_COMPARE (setitimer (timers[i], &(struct itimerval) { 0 }, + &it_old), + 0); + TEST_COMPARE (it.it_interval.tv_sec, it_old.it_interval.tv_sec); + TEST_COMPARE (it.it_interval.tv_usec, it_old.it_interval.tv_usec); + } + else + { + TEST_COMPARE (setitimer (timers[i], &it, NULL), -1); + TEST_COMPARE (errno, EOVERFLOW); + } + } + + { + struct sigaction sa = { .sa_handler = alrm_handler, .sa_flags = 0 }; + sigemptyset (&sa.sa_mask); + xsigaction (SIGALRM, &sa, NULL); + } + + /* Setup a timer to 0.1s and sleep for 1s and check to 3 signal handler + execution. */ + it.it_interval.tv_sec = 0; + it.it_interval.tv_usec = 100000; + it.it_value.tv_sec = 0; + it.it_value.tv_usec = 100000; + + /* Check ITIMER_VIRTUAL and ITIMER_PROF would require to generate load + and be subject to system load. */ + cnt = 0; + TEST_COMPARE (setitimer (ITIMER_REAL, &it, NULL), 0); + intr_sleep (1); + TEST_COMPARE (cnt, 3); + TEST_COMPARE (setitimer (ITIMER_REAL, &(struct itimerval) { 0 }, NULL), 0); + + return 0; +} + +#include From patchwork Fri Mar 5 20:14:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42287 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 92318382D437; Fri, 5 Mar 2021 20:15:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92318382D437 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975334; bh=Mhok5SGKH7UQlPXI+b3WKoGEwF/VT4G1cvuUvu3HP4c=; 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=LedO+tywS6KfdKIaforzIvKItflCNoKoeUwx4A+RFutMWlPwomcIbi3gP6WkabKa0 veS+nAJr60E0X7LFWogM4fbIM7+2lc0Pq7Hnosg3wW6tO2Iuf5GLW+1qgvoMYlj5PV xYbI7fYctlqDHlNJJxT1MrGr/pmih6ShFuBG0qsc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by sourceware.org (Postfix) with ESMTPS id B02C1382D435 for ; Fri, 5 Mar 2021 20:15:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B02C1382D435 Received: by mail-qv1-xf2f.google.com with SMTP id s17so1608101qvr.12 for ; Fri, 05 Mar 2021 12:15:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Mhok5SGKH7UQlPXI+b3WKoGEwF/VT4G1cvuUvu3HP4c=; b=oGjll6ofkl+N2GV7eWRc2DvAvDU+w37mJ427rRbuiHwYwMnZDa8oc1+P+40apNf4C/ oH5bL8I+qOM+M8vTAmpiChl6HXRPrcjNX/Kfg2q6AGKUs0YdmSQa3WTFv+DI4vmsuVeB CEtCgncEMEnniwGIuBXJ3z15fjdlc6bM5nJtPuioZmbh5/wVhHXa1PQjMSmxr6KJcrds 3OQWaKKS9bigXSdG2cPzBEJiP3un8WzBtXi869m5C2cW9OU9v1Y5hkINulx1X8x6UKQ7 FUkNXWJfBa3SJd/DdsiY4A6GGYf69rQiuen4Gz5U5y/QDmPChXau0NtXMRnrxnh3htuM mzdg== X-Gm-Message-State: AOAM530o8Cedu1YlIJZxcEF/h17yJA9dVReziYTyi3gub2kHwSxq8sOV DwK8VELww/Zlm9zdHwECwkWgY81mp9QPow== X-Google-Smtp-Source: ABdhPJwzDle8u6vdEMibOd77yBRsWzsDbCIBHSTkMplHrG5XIw12kNcz0rQmjWO+LeUOxdlmvorZEw== X-Received: by 2002:a05:6214:194f:: with SMTP id q15mr10723973qvk.46.1614975329081; Fri, 05 Mar 2021 12:15:29 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:28 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 05/52] time: Add gmtime/gmtime_r tests Date: Fri, 5 Mar 2021 17:14:31 -0300 Message-Id: <20210305201518.798584-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on x86_64-linux-gnu and i686-linux-gnu. --- time/Makefile | 3 +- time/tst-gmtime.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 time/tst-gmtime.c diff --git a/time/Makefile b/time/Makefile index ccc9eefd61..d52454bddc 100644 --- a/time/Makefile +++ b/time/Makefile @@ -48,7 +48,8 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \ tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime \ tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \ tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \ - tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer + tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer \ + tst-gmtime include ../Rules diff --git a/time/tst-gmtime.c b/time/tst-gmtime.c new file mode 100644 index 0000000000..4d09cade79 --- /dev/null +++ b/time/tst-gmtime.c @@ -0,0 +1,125 @@ +/* Basic tests for gmtime. + Copyright (C) 2021 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 +#include + +static int +do_test (void) +{ + /* Check if the epoch time can be converted. */ + { + time_t t = 0; + struct tm *tmg = gmtime (&t); + TEST_COMPARE (tmg->tm_sec, 0); + TEST_COMPARE (tmg->tm_min, 0); + TEST_COMPARE (tmg->tm_hour, 0); + TEST_COMPARE (tmg->tm_mday, 1); + TEST_COMPARE (tmg->tm_mon, 0); + TEST_COMPARE (tmg->tm_year, 70); + TEST_COMPARE (tmg->tm_wday, 4); + TEST_COMPARE (tmg->tm_yday, 0); + TEST_COMPARE (tmg->tm_isdst, 0); + } + { + /* Same as before but with gmtime_r. */ + time_t t = 0; + struct tm tms; + struct tm *tmg = gmtime_r (&t, &tms); + TEST_VERIFY (tmg == &tms); + TEST_COMPARE (tmg->tm_year, 70); + TEST_COMPARE (tmg->tm_sec, 0); + TEST_COMPARE (tmg->tm_min, 0); + TEST_COMPARE (tmg->tm_hour, 0); + TEST_COMPARE (tmg->tm_mday, 1); + TEST_COMPARE (tmg->tm_mon, 0); + TEST_COMPARE (tmg->tm_year, 70); + TEST_COMPARE (tmg->tm_wday, 4); + TEST_COMPARE (tmg->tm_yday, 0); + TEST_COMPARE (tmg->tm_isdst, 0); + } + + /* Check if the max time value for 32 bit time_t can be converted. */ + { + time_t t = 0x7fffffff; + struct tm *tmg = gmtime (&t); + TEST_COMPARE (tmg->tm_sec, 7); + TEST_COMPARE (tmg->tm_min, 14); + TEST_COMPARE (tmg->tm_hour, 3); + TEST_COMPARE (tmg->tm_mday, 19); + TEST_COMPARE (tmg->tm_mon, 0); + TEST_COMPARE (tmg->tm_year, 138); + TEST_COMPARE (tmg->tm_wday, 2); + TEST_COMPARE (tmg->tm_yday, 18); + TEST_COMPARE (tmg->tm_isdst, 0); + } + { + /* Same as before but with ctime_r. */ + time_t t = 0x7fffffff; + struct tm tms; + struct tm *tmg = gmtime_r (&t, &tms); + TEST_VERIFY (tmg == &tms); + TEST_COMPARE (tmg->tm_sec, 7); + TEST_COMPARE (tmg->tm_min, 14); + TEST_COMPARE (tmg->tm_hour, 3); + TEST_COMPARE (tmg->tm_mday, 19); + TEST_COMPARE (tmg->tm_mon, 0); + TEST_COMPARE (tmg->tm_year, 138); + TEST_COMPARE (tmg->tm_wday, 2); + TEST_COMPARE (tmg->tm_yday, 18); + TEST_COMPARE (tmg->tm_isdst, 0); + } + + if (sizeof (time_t) < 8) + return 0; + + { + time_t t = (time_t) 0x80000000ull; + struct tm *tmg = gmtime (&t); + TEST_COMPARE (tmg->tm_sec, 8); + TEST_COMPARE (tmg->tm_min, 14); + TEST_COMPARE (tmg->tm_hour, 3); + TEST_COMPARE (tmg->tm_mday, 19); + TEST_COMPARE (tmg->tm_mon, 0); + TEST_COMPARE (tmg->tm_year, 138); + TEST_COMPARE (tmg->tm_wday, 2); + TEST_COMPARE (tmg->tm_yday, 18); + TEST_COMPARE (tmg->tm_isdst, 0); + } + + { + time_t t = (time_t) 0x80000000ull; + struct tm tms; + struct tm *tmg = gmtime_r (&t, &tms); + TEST_VERIFY (tmg == &tms); + TEST_COMPARE (tmg->tm_sec, 8); + TEST_COMPARE (tmg->tm_min, 14); + TEST_COMPARE (tmg->tm_hour, 3); + TEST_COMPARE (tmg->tm_mday, 19); + TEST_COMPARE (tmg->tm_mon, 0); + TEST_COMPARE (tmg->tm_year, 138); + TEST_COMPARE (tmg->tm_wday, 2); + TEST_COMPARE (tmg->tm_yday, 18); + TEST_COMPARE (tmg->tm_isdst, 0); + } + + return 0; +} + +#include From patchwork Fri Mar 5 20:14:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42288 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 218DF3897812; Fri, 5 Mar 2021 20:15:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 218DF3897812 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975335; bh=Y1qv7+DMtn3vv+ujV19+ylGnf9KPP/KI/e34g10ZqMg=; 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=gliYav27svSTkHdpT4sN22HlW0mu8HWtQquW/vdRE7/uWa1W1ZD2okw2Co5lK2NIp 8KlggQ2u1+YXSIt9GofcG7JR8unB9peaL2YA8O+gQrQl9w1ru9NxnCO8+fWa3GwvTP 5aXOHsPPzJL2WbTtjadxOXt19Neo19zy34TgejqY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by sourceware.org (Postfix) with ESMTPS id B4828386F83C for ; Fri, 5 Mar 2021 20:15:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B4828386F83C Received: by mail-qv1-xf2f.google.com with SMTP id gi9so1615644qvb.10 for ; Fri, 05 Mar 2021 12:15:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y1qv7+DMtn3vv+ujV19+ylGnf9KPP/KI/e34g10ZqMg=; b=E9istlE2dmY0RvXf6Jaf1/wKcMZ8XbdPVSyApBMWaJXoIh5gl2CIsLqigEYdy2Vrde CGRD9w/3SWhtzdE1ltBMusYPTfeDJklFWHdFyD0lxDHBlWz4Zy9MYHYaLJtPhmnHhp23 jSZLrKqfBQyGdBIgw5+4CkQaB4Q4YtsAhiPZbvWJLhEYNy2FZbb6+W3ud7Jhc/PgXLJn PzbtR8YVc4q/6xUfDTEVSzDOmdBenyN9vgyigNDS1oSeaB++ed/9zMt6POmbRCuR7yqJ 3gygODm/hxcEFZfzFyvzt75uHFm7Grz2esyiEyBBdhhyDj2vznM82C7MaWkzI23ithSd VD9A== X-Gm-Message-State: AOAM5321HXaZkp4Grhgf1L/HOEuMbTgY+aj/u4vDHIz0ElFXa2enbJIZ EMIx6Q3MNbuXpqmcAW8vAIyqpCIJ7x18bw== X-Google-Smtp-Source: ABdhPJx8EMcVXuSf3FwE9jTTuzAC3bEzDQxIsGDLB2L5J0htKX+B3GPJdzHLek2I3Y1e8FQm16Jz7A== X-Received: by 2002:a0c:b9a2:: with SMTP id v34mr10383802qvf.17.1614975330192; Fri, 05 Mar 2021 12:15:30 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:30 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 06/52] time: Add timegm/timelocal basic tests Date: Fri, 5 Mar 2021 17:14:32 -0300 Message-Id: <20210305201518.798584-7-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked i686-linux-gnu and x86_64-linux-gnu. --- time/Makefile | 2 +- time/tst-timegm.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 time/tst-timegm.c diff --git a/time/Makefile b/time/Makefile index d52454bddc..786dc45b51 100644 --- a/time/Makefile +++ b/time/Makefile @@ -49,7 +49,7 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \ tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \ tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \ tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer \ - tst-gmtime + tst-gmtime tst-timegm include ../Rules diff --git a/time/tst-timegm.c b/time/tst-timegm.c new file mode 100644 index 0000000000..3f4d21951a --- /dev/null +++ b/time/tst-timegm.c @@ -0,0 +1,95 @@ +/* Basic tests for timegm. + Copyright (C) 2021 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 +#include + +static void +do_test_func (time_t (*func)(struct tm *)) +{ + { + struct tm tmg = + { + .tm_sec = 0, + .tm_min = 0, + .tm_hour = 0, + .tm_mday = 1, + .tm_mon = 0, + .tm_year = 70, + .tm_wday = 4, + .tm_yday = 0, + .tm_isdst = 0 + }; + time_t t = func (&tmg); + TEST_COMPARE (t, 0); + } + + { + struct tm tmg = + { + .tm_sec = 7, + .tm_min = 14, + .tm_hour = 3, + .tm_mday = 19, + .tm_mon = 0, + .tm_year = 138, + .tm_wday = 2, + .tm_yday = 18, + .tm_isdst = 0 + }; + time_t t = func (&tmg); + TEST_COMPARE (t, 0x7fffffff); + } + + if (sizeof (time_t) < 8) + return; + + { + struct tm tmg = + { + .tm_sec = 8, + .tm_min = 14, + .tm_hour = 3, + .tm_mday = 19, + .tm_mon = 0, + .tm_year = 138, + .tm_wday = 2, + .tm_yday = 18, + .tm_isdst = 0 + }; + time_t t = func (&tmg); + TEST_COMPARE (t, (time_t) 0x80000000ull); + } +} + +static int +do_test (void) +{ + do_test_func (timegm); + + /* timelocal is a alias to timegm with the only difference it takes local + timezone into account, while timegm takes the input value to be UTC. */ + TEST_VERIFY_EXIT (setenv ("TZ", ":", 1) == 0); + tzset (); + do_test_func (timelocal); + + return 0; +} + +#include From patchwork Fri Mar 5 20:14:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42289 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 2F2C73892456; Fri, 5 Mar 2021 20:15:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F2C73892456 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975336; bh=06Wcu6CwU+ELTBgP7pQwz8hAnSqC7y7c+LJfE48ghBQ=; 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=tld1W0cTxCbjcrcQOLfb3z7ooWlxrkB2bI1PWJcbYIOqsK5zKXiAP4HjCCkKbLrzu auG4ixFEdhoeWdS1NQxg1lg/F5cRIc/zNqyfdFONaEjjZ3vvWzHTNm3KevNg9edUbu JM10Xoz1gWykwsxZTc0zqsXXnblzMDSZM97FgX1M= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by sourceware.org (Postfix) with ESMTPS id BC32D382D435 for ; Fri, 5 Mar 2021 20:15:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BC32D382D435 Received: by mail-qk1-x731.google.com with SMTP id d20so3309099qkc.2 for ; Fri, 05 Mar 2021 12:15:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=06Wcu6CwU+ELTBgP7pQwz8hAnSqC7y7c+LJfE48ghBQ=; b=fRetOyW/+4TYEGddHnzHDFg+GY31Hz0pTb5osZ9Js2sEfyTLwZDetCHoYFKFR+VwDQ 0GaRM7yseKHjTy4W64cLrPfpIE+CAS81qi2xswVsOTdW1f6/9PtEm0FKEpcsEAPNuDHy +WY7YDVTGKvBiGIzrZlPuTBcdTfhrGJscx1eJ1J2v7baQKD5m5LdBewpCKwfRyqPNft7 6LL3GiqAIl4MGrAcvTqN4H/nUJbQXXHvFook7BHCjXfDnev09hKkKoiS6BbTZNlasxs/ TXn1v+ZqCVjWnPJDWRxG/gQ6hFAwT+ilABQLl8zMqB6v7aBux8HXaj6Vgq2oUOrpzI21 dotg== X-Gm-Message-State: AOAM532eLgLLd9G7vxBl1Dc3T4TFt9BOZBUGoEfk29AZ9aiftkAXSMqt 25yaI2esoedKGArkJDSxp2oLqJlqCbUyGQ== X-Google-Smtp-Source: ABdhPJwCEnrLVMcCJ/ggIdbdui8NETwFhr6vZd2U+w1iqhXk/+uDVahTvMJkghbRUga/EYtNeAXnXg== X-Received: by 2002:a37:56c5:: with SMTP id k188mr10542158qkb.18.1614975331243; Fri, 05 Mar 2021 12:15:31 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:31 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 07/52] time: Add basic timespec_get tests Date: Fri, 5 Mar 2021 17:14:33 -0300 Message-Id: <20210305201518.798584-8-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checkec on x86_64-linux-gnu and i686-linux-gnu. --- time/Makefile | 2 +- time/tst-timespec_get.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 time/tst-timespec_get.c diff --git a/time/Makefile b/time/Makefile index 786dc45b51..f14022b334 100644 --- a/time/Makefile +++ b/time/Makefile @@ -49,7 +49,7 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \ tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \ tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1 \ tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer \ - tst-gmtime tst-timegm + tst-gmtime tst-timegm tst-timespec_get include ../Rules diff --git a/time/tst-timespec_get.c b/time/tst-timespec_get.c new file mode 100644 index 0000000000..7389927db4 --- /dev/null +++ b/time/tst-timespec_get.c @@ -0,0 +1,40 @@ +/* Basic tests for timespec_get. + Copyright (C) 2021 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 + +static int +do_test (void) +{ + { + struct timespec ts; + TEST_COMPARE (timespec_get (&ts, 0), 0); + } + + { + struct timespec ts; + TEST_COMPARE (timespec_get (&ts, TIME_UTC), TIME_UTC); + TEST_VERIFY (ts.tv_nsec >= 0); + TEST_VERIFY (ts.tv_nsec < 1000000000); + } + + return 0; +} + +#include From patchwork Fri Mar 5 20:14:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42290 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 AF9083897836; Fri, 5 Mar 2021 20:15:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF9083897836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975336; bh=rrC3jWaDYVghy1qc7EivOhw+dhi2ws1qYnxxdv30FKE=; 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=wFgw22sgxakLxG0KjRBaaDkwTfx+NGfOggIaBPH6qJoAkfLbK9RQ811HH2pW6/oX9 qMOAna6i//j6M3EN6yLZtrpSP4brJq/2QQmoeL1rovvHuEqt8fa0RY1rOSFq56oCGJ 3pJtS1ItHo6pAIE8IHq0UCx3W0UzpPINvHuaoozw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by sourceware.org (Postfix) with ESMTPS id 19DC6388E828 for ; Fri, 5 Mar 2021 20:15:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 19DC6388E828 Received: by mail-qv1-xf34.google.com with SMTP id k7so1626554qvo.6 for ; Fri, 05 Mar 2021 12:15:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rrC3jWaDYVghy1qc7EivOhw+dhi2ws1qYnxxdv30FKE=; b=NsJgZ0ddEkmKL14lShKU6y4YTbe2R5CBbtV+bUX9+BehSN4oTB3ZAsEz0zJ9cMqRlk qcU+HOOxgm6kPboU+02au3Vp70Smgph90oiy7O1owk9rN8DOOYPh/5fylZeEBjZN6KfG EmOm2VuVlUXlu1suHXqWu7f3vvDKrSRr9vW1S7E43TIJ5JYMPRXQgzvrmAkh1VcgaZan lv5Ia5bHtF0YqLm1bI/yYi5CUhyO3aWHOXzDzUuk33mO6iEg+X7VU3SWRK3QrZvvywV9 cNogUMPHQxyxHGl3cZU278O9ZE4jnkH3LSetVtPWT+RZWpfR3MaxFnW11D18+Ogo3KwP wA2w== X-Gm-Message-State: AOAM531sJkOoEOmwjonsXZu6YlmRYDj298q/0oRS0ACnhPdGPeeQ8/Kv 0V7WQ6Fez19pfAVBAtGDY0KEjdDlsrHrFg== X-Google-Smtp-Source: ABdhPJx7tlWMHU/mRAhCLm7WoX4FmOQ8rKvlp1kHi1f78+YNLVBu98FB1MGW/wsuH2TtqMHuLhN24g== X-Received: by 2002:a0c:bd2f:: with SMTP id m47mr6700134qvg.53.1614975332384; Fri, 05 Mar 2021 12:15:32 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:32 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 08/52] time: Add 64 bit tests for getdate / getdate_r Date: Fri, 5 Mar 2021 17:14:34 -0300 Message-Id: <20210305201518.798584-9-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The test is also converted to use libsupport. Checked on i686-linux-gnu and x86_64-linux-gnu. --- time/tst-getdate.c | 153 +++++++++++++++++++++++++++------------------ 1 file changed, 92 insertions(+), 61 deletions(-) diff --git a/time/tst-getdate.c b/time/tst-getdate.c index 37ecc4823e..c37ba3083a 100644 --- a/time/tst-getdate.c +++ b/time/tst-getdate.c @@ -17,110 +17,141 @@ License along with the GNU C Library; if not, see . */ +#include +#include #include #include #include +#include +#include +#include #include static const struct { const char *str; const char *tz; - int err; struct tm tm; + bool time64; } tests [] = { - {"21:01:10 1999-1-31", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}}, - {"21:01:10 1999-1-31", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}}, - {" 21:01:10 1999-1-31", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}}, - {"21:01:10 1999-1-31 ", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}}, - {" 21:01:10 1999-1-31 ", "Universal", 0, {10, 1, 21, 31, 0, 99, 0, 0, 0}}, - {"21:01:10 1999-2-28", "Universal", 0, {10, 1, 21, 28, 1, 99, 0, 0, 0}}, - {"16:30:46 2000-2-29", "Universal", 0, {46, 30,16, 29, 1, 100, 0, 0, 0}}, - {"01-08-2000 05:06:07", "Europe/Berlin", 0, {7, 6, 5, 1, 7, 100, 0, 0, 0}} + {"21:01:10 1999-1-31", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0}, + false }, + {"21:01:10 1999-1-31", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0}, + false }, + {" 21:01:10 1999-1-31", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0}, + false }, + {"21:01:10 1999-1-31 ", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0}, + false }, + {" 21:01:10 1999-1-31 ", "Universal", {10, 1, 21, 31, 0, 99, 0, 0, 0}, + false }, + {"21:01:10 1999-2-28", "Universal", {10, 1, 21, 28, 1, 99, 0, 0, 0}, + false }, + {"16:30:46 2000-2-29", "Universal", {46, 30,16, 29, 1, 100, 0, 0, 0}, + false }, + {"01-08-2000 05:06:07", "Europe/Berlin", {7, 6, 5, 1, 7, 100, 0, 0, 0}, + false }, + + /* 64 bit time_t tests. */ + {"21:01:10 2038-1-31", "Universal", {10, 1, 21, 31, 0, 138, 0, 0, 0}, + true }, + {"22:01:10 2048-5-20", "Universal", {10, 1, 22, 20, 4, 148, 0, 0, 0}, + true }, + {"01-08-2038 05:06:07", "Europe/Berlin", {7, 6, 5, 1, 7, 138, 0, 0, 0}, + true }, + {"20-03-2050 21:30:08", "Europe/Berlin", {8, 30, 21, 20, 2, 150, 0, 0, 0}, + true } }; -static void -report_date_error (int err) +static const char * +report_date_error (void) { - switch(err) + switch (getdate_err) { case 1: - printf ("The environment variable DATEMSK is not defined or null.\n"); - break; + return "The environment variable DATEMSK is not defined or null."; case 2: - printf ("The template file denoted by the DATEMSK environment variable cannot be opened.\n"); - break; + return "The template file denoted by the DATEMSK environment variable " + "cannot be opened."; case 3: - printf ("Information about the template file cannot retrieved.\n"); - break; + return "Information about the template file cannot retrieved."; case 4: - printf ("The template file is not a regular file.\n"); - break; + return "The template file is not a regular file.\n"; case 5: - printf ("An I/O error occurred while reading the template file.\n"); - break; + return "An I/O error occurred while reading the template file."; case 6: - printf ("Not enough memory available to execute the function.\n"); - break; + return "Not enough memory available to execute the function."; case 7: - printf ("The template file contains no matching template.\n"); - break; + return "The template file contains no matching template."; case 8: - printf ("The input date is invalid, but would match a template otherwise.\n"); - break; + return "The input date is invalid, but would match a template " + "otherwise."; default: - printf("Unknown error code.\n"); - break; + return "Unknown error code."; } } +static char *datemsk; +static const char datemskstr[] = + "%H:%M:%S %F\n" + "%d-%m-%Y %T\n"; + +static void +do_prepare (int argc, char **argv) +{ + int fd = create_temp_file ("tst-chk1.", &datemsk); + xwrite (fd, datemskstr, sizeof (datemskstr) - 1); + + setenv ("DATEMSK", datemsk, 1); +} +#define PREPARE do_prepare static int do_test (void) { - int errors = 0; - size_t i; struct tm *tm; - - for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i) + for (int i = 0; i < array_length (tests); ++i) { setenv ("TZ", tests[i].tz, 1); - tm = getdate (tests[i].str); + int expected_err; + if (sizeof (time_t) == 4 && tests[i].time64) + expected_err = 8; + else + expected_err = 0; - if (getdate_err != tests[i].err) + tm = getdate (tests[i].str); + TEST_COMPARE (getdate_err, expected_err); + if (getdate_err != expected_err) { - printf ("Failure for getdate (\"%s\"):\n", tests[i].str); - printf ("getdate_err should be %d but returned: %d which means:\n", - tests[i].err, getdate_err); - report_date_error (getdate_err); - ++errors; + support_record_failure (); + printf ("%s\n", report_date_error ()); } - else if (tests[i].tm.tm_mon != tm->tm_mon - || tests[i].tm.tm_year != tm->tm_year - || tests[i].tm.tm_mday != tm->tm_mday - || tests[i].tm.tm_hour != tm->tm_hour - || tests[i].tm.tm_min != tm->tm_min - || tests[i].tm.tm_sec != tm->tm_sec) + else if (getdate_err == 0) + { + TEST_COMPARE (tests[i].tm.tm_mon, tm->tm_mon); + TEST_COMPARE (tests[i].tm.tm_year, tm->tm_year); + TEST_COMPARE (tests[i].tm.tm_mday, tm->tm_mday); + TEST_COMPARE (tests[i].tm.tm_hour, tm->tm_hour); + TEST_COMPARE (tests[i].tm.tm_min, tm->tm_min); + TEST_COMPARE (tests[i].tm.tm_sec, tm->tm_sec); + } + + struct tm tms; + TEST_COMPARE (getdate_r (tests[i].str, &tms), expected_err); + if (getdate_err == 0) { - printf ("Failure for getdate (\"%s\"):\n", tests[i].str); - printf ("struct tm is: %d-%d-%d %d:%d:%d\n", - tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, - tm->tm_hour, tm->tm_min, tm->tm_sec); - printf ("but should be: %d-%d-%d %d:%d:%d\n", - tests[i].tm.tm_year + 1900, tests[i].tm.tm_mon + 1, - tests[i].tm.tm_mday, - tests[i].tm.tm_hour, tests[i].tm.tm_min, tests[i].tm.tm_sec); - ++errors; + TEST_COMPARE (tests[i].tm.tm_mon, tms.tm_mon); + TEST_COMPARE (tests[i].tm.tm_year, tms.tm_year); + TEST_COMPARE (tests[i].tm.tm_mday, tms.tm_mday); + TEST_COMPARE (tests[i].tm.tm_hour, tms.tm_hour); + TEST_COMPARE (tests[i].tm.tm_min, tms.tm_min); + TEST_COMPARE (tests[i].tm.tm_sec, tms.tm_sec); } } - if (!errors) - printf ("No errors found.\n"); - return errors != 0; + return 0; } -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" +#include From patchwork Fri Mar 5 20:14:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42291 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 3FDD63951C10; Fri, 5 Mar 2021 20:15:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FDD63951C10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975337; bh=3r8pocvVBiNgszvvzScxVORSJ4+ZRc5ruQGnCveYtww=; 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=y7uhLxKkqOfnG4pstttl7O83HPN5PcN3FHiyInkjIGnSNvVKdAT8AP/RFdDfsgGeX 2ywU7V5e/akDnUk5nkgWCP7fO4Hn/V50++fq7kIiJABM9o1CKj6xC0f4L0OsPH/z60 QCA0WQlylB8FtKEJmqAuj4552qK4loFUpIpzX0wQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by sourceware.org (Postfix) with ESMTPS id 19A313896835 for ; Fri, 5 Mar 2021 20:15:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 19A313896835 Received: by mail-qv1-xf2f.google.com with SMTP id 15so1603386qvp.13 for ; Fri, 05 Mar 2021 12:15:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3r8pocvVBiNgszvvzScxVORSJ4+ZRc5ruQGnCveYtww=; b=LLmstTgsnXTmMegUBhWFBbttoBpC1TIbu90+AqY7SFXNnBVut7cXaNxgyDZc6qoS7g lJBAO3aZl/kfobzPgxIUKXlccI8nZRc6xh3ZSp/R68LpV9RbbZ7g8Aj2odqOaWDSinxa Ob6imEMbhGMAXzUXn4e94o5o5jMI2V1dzB1hOUwpLh6gBTgCY1O5CVdcw2cxcSehbHOc 9jpGsSqCYHQKOtZOh1HnwKzRDsMxvEhawf0ZTVc0p9K9uyfRwXKNyyM1y05mXTTSwaGt nFp5/676Gwz/dYvtYWey2EQ6EoktQI+83AmE0ZLsxUNzPaqLXaaELyFZD5a5MNu1pnsL h7bA== X-Gm-Message-State: AOAM533KVXtPKv/am+9r6o67InorwcQY2Ky5bMcEMGqE+yjtML2KGjtn MzoK9k16Li+ZQ18M+rMX7yE90rGt5jr60g== X-Google-Smtp-Source: ABdhPJzHJZwz8268vEjzyRHLg6mP5GKDUB1XC/TEYhQC/cDRk7YCvVKJbjR+3tjfZAjFWM6HVJE3Ww== X-Received: by 2002:a0c:83a4:: with SMTP id k33mr10545253qva.1.1614975333494; Fri, 05 Mar 2021 12:15:33 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:33 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 09/52] io: Add basic tests for utimensat Date: Fri, 5 Mar 2021 17:14:35 -0300 Message-Id: <20210305201518.798584-10-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on x86_64-linux-gnu and i686-linux-gnu --- io/Makefile | 2 +- io/tst-utimensat.c | 115 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 io/tst-utimensat.c diff --git a/io/Makefile b/io/Makefile index b7bebe923f..59d36e8782 100644 --- a/io/Makefile +++ b/io/Makefile @@ -68,7 +68,7 @@ tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ tst-fts tst-fts-lfs tst-open-tmpfile \ tst-copy_file_range tst-getcwd-abspath tst-lockf \ tst-ftw-lnk tst-file_change_detection tst-lchmod \ - tst-ftw-bz26353 + tst-ftw-bz26353 tst-utimensat # Likewise for statx, but we do not need static linking here. tests-internal += tst-statx diff --git a/io/tst-utimensat.c b/io/tst-utimensat.c new file mode 100644 index 0000000000..b62e409e07 --- /dev/null +++ b/io/tst-utimensat.c @@ -0,0 +1,115 @@ +/* utimensat basic tests. + Copyright (C) 2021 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 +#include +#include +#include +#include +#include +#include + +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + +static int temp_fd = -1; +static char *testfile; +static char *testlink; + +/* struct timeval array with Y2038 threshold minus 2 and 1 seconds. */ +const static struct timespec t1[2] = { { 0x7FFFFFFE, 0 }, + { 0x7FFFFFFF, 0 } }; + +/* struct timeval array with Y2038 threshold plus 1 and 2 seconds. */ +const static struct timespec t2[2] = { { 0x80000001ULL, 0 }, + { 0x80000002ULL, 0 } }; + +/* struct timeval array around Y2038 threshold. */ +const static struct timespec t3[2] = { { 0x7FFFFFFE, 0 }, + { 0x80000002ULL, 0 } }; + +static void +do_prepare (int argc, char *argv[]) +{ + temp_fd = create_temp_file ("tst-utimensat", &testfile); + TEST_VERIFY_EXIT (temp_fd > 0); + + testlink = xasprintf ("%s-symlink", testfile); + xsymlink (testfile, testlink); + add_temp_file (testlink); +} +#define PREPARE do_prepare + +static void +test_utimensat_helper (const struct timespec ts[2]) +{ + /* Check if we run on port with 32 bit time_t size */ + { + time_t t; + if (__builtin_add_overflow (ts->tv_sec, 0, &t)) + return; + } + + { + TEST_VERIFY_EXIT (utimensat (temp_fd, testfile, ts, 0) == 0); + + struct_stat st; + xfstat (temp_fd, &st); + + /* Check if seconds for atime match */ + TEST_COMPARE (st.st_atime, ts[0].tv_sec); + + /* Check if seconds for mtime match */ + TEST_COMPARE (st.st_mtime, ts[1].tv_sec); + } + + { + struct_stat stfile_orig; + xlstat (testfile, &stfile_orig); + + TEST_VERIFY_EXIT (utimensat (0 /* ignored */, testlink, ts, + AT_SYMLINK_NOFOLLOW) + == 0); + struct_stat stlink; + xlstat (testlink, &stlink); + + TEST_COMPARE (stlink.st_atime, ts[0].tv_sec); + TEST_COMPARE (stlink.st_mtime, ts[1].tv_sec); + + /* Check if the timestamp from original file is not changed. */ + struct_stat stfile; + xlstat (testfile, &stfile); + + TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime); + TEST_COMPARE (stfile_orig.st_mtime, stfile.st_mtime); + } +} + +static int +do_test (void) +{ + test_utimensat_helper (t1); + test_utimensat_helper (t2); + test_utimensat_helper (t3); + + return 0; +} + +#include From patchwork Fri Mar 5 20:14:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42292 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 CC33C399C014; Fri, 5 Mar 2021 20:15:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC33C399C014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975338; bh=tG1nRkU+z1IpTSNgPGtRjLghF7LEgxWs4RX99BJhCMQ=; 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=JksGlfslIytkdL4l+IbUqOjN1IOwdhjF1VuBOc7FS/fdjBSsgHTepreS5XKElEdDM B3AuusBueWgvHoUJUmoTRcsvdQ2q87/5sFBRly7SFy0UhzkuCbtbJBM7QJoU//ynqL wve3FN+6CzSwaKhZ263wJFnbiDMhr200RYs1pLXM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by sourceware.org (Postfix) with ESMTPS id 86CA53897828 for ; Fri, 5 Mar 2021 20:15:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 86CA53897828 Received: by mail-qk1-x735.google.com with SMTP id g185so3283380qkf.6 for ; Fri, 05 Mar 2021 12:15:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tG1nRkU+z1IpTSNgPGtRjLghF7LEgxWs4RX99BJhCMQ=; b=l814hEQQqhTprHBoDWKW1BmAgoSY6ilZGI7w10Qz42VbuDeISt37um7dM61mkP5OUb whBiqtSzUfkgT6g5RvQMb+TbJ0KYElwzeE2JjF8+G/1y5Gy/zKHjW563Drodrrq6okej FPtW7ux9CeJ/r0+IUfaUvNPe7ZyUYVFzkA1pXPW5KwZiL8qIYH8aSckVGeZmgwjBVaxV hdCojSDQ7DHwK4BWcMaF6UojYIIvvzdfkDL9rz9meEwc4atz1yludyUt6yM4HUv+KGJC FncfVNeIoxwJFytUck621wfqxdfnXV8WbNTdcoV3okX04SxF89kjDajiMHsSw7lxewhQ TM4g== X-Gm-Message-State: AOAM531hdpQ3Wp+YlYfZMgmp+Fx5TDQMaDOzSs1rNlsc1FFnhSIaqM4S PwcqUDpJvGn5tSU9lY1cm90lnDcPfKD9gQ== X-Google-Smtp-Source: ABdhPJwxaECmtkEje2kekF0Y+TYFNy3DmaQc7x6OGKHJDn0aW1uSlGJUB9vofT2mEDsXjD+9sN/SxQ== X-Received: by 2002:ae9:df46:: with SMTP id t67mr10827598qkf.269.1614975334602; Fri, 05 Mar 2021 12:15:34 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:34 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 10/52] posix: Add wait3 tests Date: Fri, 5 Mar 2021 17:14:36 -0300 Message-Id: <20210305201518.798584-11-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The tst-wait4 is moved to common file and used for wait3 tests. Checked on x86_64-linux-gnu and i686-linux-gnu. --- posix/Makefile | 2 +- posix/tst-wait-skeleton.c | 209 ++++++++++++++++++++++++++++++++++++++ posix/tst-wait3.c | 22 ++++ posix/tst-wait4.c | 193 +---------------------------------- 4 files changed, 235 insertions(+), 191 deletions(-) create mode 100644 posix/tst-wait-skeleton.c create mode 100644 posix/tst-wait3.c diff --git a/posix/Makefile b/posix/Makefile index 239fbb340a..8e31c721e1 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -84,7 +84,7 @@ tests := test-errno tstgetopt testfnm runtests runptests \ tst-nice tst-nanosleep tst-regex2 \ transbug tst-rxspencer tst-pcre tst-boost \ bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 \ - tst-waitid tst-wait4 \ + tst-waitid tst-wait4 tst-wait3 \ tst-getaddrinfo2 bug-glob2 bug-glob3 tst-sysconf \ tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \ tst-execv1 tst-execv2 tst-execl1 tst-execl2 \ diff --git a/posix/tst-wait-skeleton.c b/posix/tst-wait-skeleton.c new file mode 100644 index 0000000000..57022cb61c --- /dev/null +++ b/posix/tst-wait-skeleton.c @@ -0,0 +1,209 @@ +/* Test framework for wait3 and wait4. + Copyright (C) 2020-2021 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 +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +static void +test_child (void) +{ + /* First thing, we stop ourselves. */ + raise (SIGSTOP); + + /* Hey, we got continued! */ + while (1) + pause (); +} + +#ifndef WEXITED +# define WEXITED 0 +# define WCONTINUED 0 +# define WSTOPPED WUNTRACED +#endif + +/* Set with only SIGCHLD on do_test_waitid. */ +static sigset_t chldset; + +#ifdef SA_SIGINFO +static void +sigchld (int signo, siginfo_t *info, void *ctx) +{ +} +#endif + +static void +check_sigchld (int code, int status, pid_t pid) +{ +#ifdef SA_SIGINFO + siginfo_t siginfo; + TEST_COMPARE (sigwaitinfo (&chldset, &siginfo), SIGCHLD); + + TEST_COMPARE (siginfo.si_signo, SIGCHLD); + TEST_COMPARE (siginfo.si_code, code); + TEST_COMPARE (siginfo.si_status, status); + TEST_COMPARE (siginfo.si_pid, pid); +#endif +} + +static int +do_test_wait (pid_t pid) +{ + /* Adding process_state_tracing_stop ('t') allows the test to work under + trace programs such as ptrace. */ + enum support_process_state stop_state = support_process_state_stopped + | support_process_state_tracing_stop; + + support_process_state_wait (pid, stop_state); + + check_sigchld (CLD_STOPPED, SIGSTOP, pid); + + pid_t ret; + int wstatus; + struct rusage rusage; + + ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, NULL); + if (ret == -1 && errno == ENOTSUP) + FAIL_RET ("waitid WNOHANG on stopped: %m"); + TEST_COMPARE (ret, pid); + TEST_VERIFY (WIFSTOPPED (wstatus)); + + /* Issue again but with struct rusage input. */ + ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage); + /* With WNOHANG and WUNTRACED, if the children has not changes its state + since previous call the expected result it 0. */ + TEST_COMPARE (ret, 0); + + /* Some sanity tests to check if 'wtatus' and 'rusage' possible + input values. */ + ret = WAIT_CALL (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, &rusage); + TEST_COMPARE (ret, 0); + ret = WAIT_CALL (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, NULL); + TEST_COMPARE (ret, 0); + + if (kill (pid, SIGCONT) != 0) + FAIL_RET ("kill (%d, SIGCONT): %m\n", pid); + + /* Wait for the child to have continued. */ + support_process_state_wait (pid, support_process_state_sleeping); + +#if WCONTINUED != 0 + check_sigchld (CLD_CONTINUED, SIGCONT, pid); + + ret = WAIT_CALL (pid, &wstatus, WCONTINUED|WNOHANG, NULL); + TEST_COMPARE (ret, pid); + TEST_VERIFY (WIFCONTINUED (wstatus)); + + /* Issue again but with struct rusage input. */ + ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage); + /* With WNOHANG and WUNTRACED, if the children has not changes its state + since previous call the expected result it 0. */ + TEST_COMPARE (ret, 0); + + /* Now stop him again and test waitpid with WCONTINUED. */ + if (kill (pid, SIGSTOP) != 0) + FAIL_RET ("kill (%d, SIGSTOP): %m\n", pid); + + /* Wait the child stop. The waitid call below will block until it has + stopped, but if we are real quick and enter the waitid system call + before the SIGCHLD has been generated, then it will be discarded and + never delivered. */ + support_process_state_wait (pid, stop_state); + + ret = WAIT_CALL (pid, &wstatus, WUNTRACED|WNOHANG, &rusage); + TEST_COMPARE (ret, pid); + + check_sigchld (CLD_STOPPED, SIGSTOP, pid); + + if (kill (pid, SIGCONT) != 0) + FAIL_RET ("kill (%d, SIGCONT): %m\n", pid); + + /* Wait for the child to have continued. */ + support_process_state_wait (pid, support_process_state_sleeping); + + check_sigchld (CLD_CONTINUED, SIGCONT, pid); + + ret = WAIT_CALL (pid, &wstatus, WCONTINUED|WNOHANG, NULL); + TEST_COMPARE (ret, pid); + TEST_VERIFY (WIFCONTINUED (wstatus)); +#endif + + /* Die, child, die! */ + if (kill (pid, SIGKILL) != 0) + FAIL_RET ("kill (%d, SIGKILL): %m\n", pid); + + support_process_state_wait (pid, support_process_state_zombie); + + ret = WAIT_CALL (pid, &wstatus, 0, &rusage); + TEST_COMPARE (ret, pid); + TEST_VERIFY (WIFSIGNALED (wstatus)); + TEST_VERIFY (WTERMSIG (wstatus) == SIGKILL); + + check_sigchld (CLD_KILLED, SIGKILL, pid); + + return 0; +} + +static int +do_test (void) +{ +#ifdef SA_SIGINFO + { + struct sigaction sa; + sa.sa_flags = SA_SIGINFO | SA_RESTART; + sa.sa_sigaction = sigchld; + sigemptyset (&sa.sa_mask); + xsigaction (SIGCHLD, &sa, NULL); + } +#endif + + sigemptyset (&chldset); + sigaddset (&chldset, SIGCHLD); + + /* The SIGCHLD shall has blocked at the time of the call to sigwait; + otherwise, the behavior is undefined. */ + sigprocmask (SIG_BLOCK, &chldset, NULL); + + pid_t pid = xfork (); + if (pid == 0) + { + test_child (); + _exit (127); + } + + do_test_wait (pid); + + xsignal (SIGCHLD, SIG_IGN); + kill (pid, SIGKILL); /* Make sure it's dead if we bailed early. */ + + return 0; +} + +#include diff --git a/posix/tst-wait3.c b/posix/tst-wait3.c new file mode 100644 index 0000000000..27411c04e4 --- /dev/null +++ b/posix/tst-wait3.c @@ -0,0 +1,22 @@ +/* Tests for wait3. + Copyright (C) 2021 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 + . */ + +#define WAIT_CALL(__pid, __wstatus, __options, __rusage) \ + wait3 (__wstatus, __options, __rusage) + +#include "tst-wait-skeleton.c" diff --git a/posix/tst-wait4.c b/posix/tst-wait4.c index e4ce79d2cd..b7532d3891 100644 --- a/posix/tst-wait4.c +++ b/posix/tst-wait4.c @@ -16,194 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#define WAIT_CALL(__pid, __wstatus, __options, __rusage) \ + wait4 (__pid, __wstatus, __options, __rusage) -#include -#include -#include -#include - -static void -test_child (void) -{ - /* First thing, we stop ourselves. */ - raise (SIGSTOP); - - /* Hey, we got continued! */ - while (1) - pause (); -} - -#ifndef WEXITED -# define WEXITED 0 -# define WCONTINUED 0 -# define WSTOPPED WUNTRACED -#endif - -/* Set with only SIGCHLD on do_test_waitid. */ -static sigset_t chldset; - -#ifdef SA_SIGINFO -static void -sigchld (int signo, siginfo_t *info, void *ctx) -{ -} -#endif - -static void -check_sigchld (int code, int status, pid_t pid) -{ -#ifdef SA_SIGINFO - siginfo_t siginfo; - TEST_COMPARE (sigwaitinfo (&chldset, &siginfo), SIGCHLD); - - TEST_COMPARE (siginfo.si_signo, SIGCHLD); - TEST_COMPARE (siginfo.si_code, code); - TEST_COMPARE (siginfo.si_status, status); - TEST_COMPARE (siginfo.si_pid, pid); -#endif -} - -static int -do_test_wait4 (pid_t pid) -{ - /* Adding process_state_tracing_stop ('t') allows the test to work under - trace programs such as ptrace. */ - enum support_process_state stop_state = support_process_state_stopped - | support_process_state_tracing_stop; - - support_process_state_wait (pid, stop_state); - - check_sigchld (CLD_STOPPED, SIGSTOP, pid); - - pid_t ret; - int wstatus; - struct rusage rusage; - - ret = wait4 (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, NULL); - if (ret == -1 && errno == ENOTSUP) - FAIL_RET ("waitid WNOHANG on stopped: %m"); - TEST_COMPARE (ret, pid); - TEST_VERIFY (WIFSTOPPED (wstatus)); - - /* Issue again but with struct rusage input. */ - ret = wait4 (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage); - /* With WNOHANG and WUNTRACED, if the children has not changes its state - since previous call the expected result it 0. */ - TEST_COMPARE (ret, 0); - - /* Some sanity tests to check if 'wtatus' and 'rusage' possible - input values. */ - ret = wait4 (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, &rusage); - TEST_COMPARE (ret, 0); - ret = wait4 (pid, NULL, WUNTRACED|WCONTINUED|WNOHANG, NULL); - TEST_COMPARE (ret, 0); - - if (kill (pid, SIGCONT) != 0) - FAIL_RET ("kill (%d, SIGCONT): %m\n", pid); - - /* Wait for the child to have continued. */ - support_process_state_wait (pid, support_process_state_sleeping); - -#if WCONTINUED != 0 - check_sigchld (CLD_CONTINUED, SIGCONT, pid); - - ret = wait4 (pid, &wstatus, WCONTINUED|WNOHANG, NULL); - TEST_COMPARE (ret, pid); - TEST_VERIFY (WIFCONTINUED (wstatus)); - - /* Issue again but with struct rusage input. */ - ret = wait4 (pid, &wstatus, WUNTRACED|WCONTINUED|WNOHANG, &rusage); - /* With WNOHANG and WUNTRACED, if the children has not changes its state - since previous call the expected result it 0. */ - TEST_COMPARE (ret, 0); - - /* Now stop him again and test waitpid with WCONTINUED. */ - if (kill (pid, SIGSTOP) != 0) - FAIL_RET ("kill (%d, SIGSTOP): %m\n", pid); - - /* Wait the child stop. The waitid call below will block until it has - stopped, but if we are real quick and enter the waitid system call - before the SIGCHLD has been generated, then it will be discarded and - never delivered. */ - support_process_state_wait (pid, stop_state); - - ret = wait4 (pid, &wstatus, WUNTRACED|WNOHANG, &rusage); - TEST_COMPARE (ret, pid); - - check_sigchld (CLD_STOPPED, SIGSTOP, pid); - - if (kill (pid, SIGCONT) != 0) - FAIL_RET ("kill (%d, SIGCONT): %m\n", pid); - - /* Wait for the child to have continued. */ - support_process_state_wait (pid, support_process_state_sleeping); - - check_sigchld (CLD_CONTINUED, SIGCONT, pid); - - ret = wait4 (pid, &wstatus, WCONTINUED|WNOHANG, NULL); - TEST_COMPARE (ret, pid); - TEST_VERIFY (WIFCONTINUED (wstatus)); -#endif - - /* Die, child, die! */ - if (kill (pid, SIGKILL) != 0) - FAIL_RET ("kill (%d, SIGKILL): %m\n", pid); - - support_process_state_wait (pid, support_process_state_zombie); - - ret = wait4 (pid, &wstatus, 0, &rusage); - TEST_COMPARE (ret, pid); - TEST_VERIFY (WIFSIGNALED (wstatus)); - TEST_VERIFY (WTERMSIG (wstatus) == SIGKILL); - - check_sigchld (CLD_KILLED, SIGKILL, pid); - - return 0; -} - -static int -do_test (void) -{ -#ifdef SA_SIGINFO - { - struct sigaction sa; - sa.sa_flags = SA_SIGINFO | SA_RESTART; - sa.sa_sigaction = sigchld; - sigemptyset (&sa.sa_mask); - xsigaction (SIGCHLD, &sa, NULL); - } -#endif - - sigemptyset (&chldset); - sigaddset (&chldset, SIGCHLD); - - /* The SIGCHLD shall has blocked at the time of the call to sigwait; - otherwise, the behavior is undefined. */ - sigprocmask (SIG_BLOCK, &chldset, NULL); - - pid_t pid = xfork (); - if (pid == 0) - { - test_child (); - _exit (127); - } - - do_test_wait4 (pid); - - xsignal (SIGCHLD, SIG_IGN); - kill (pid, SIGKILL); /* Make sure it's dead if we bailed early. */ - - return 0; -} - -#include +#include "tst-wait-skeleton.c" From patchwork Fri Mar 5 20:14:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42293 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 5C638399C015; Fri, 5 Mar 2021 20:15:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C638399C015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975339; bh=wkJXyIkXz8nsZ3W01/XYbgig0DTqA48rdjZ3p8GVh04=; 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=CikUUqjzKLZ+A1CY62L1IFSCBpH07dVvgigejyEjz6fedFpCkLBB42yEJ72cL07mH 7oBRObXy+FXRmOEJEjpK7tUvQB+Na5k2b36n+KMY3J8usPlxsB+5ooyIQs83euzCCH 8k2feoJp7W5ndd8U6gcEEgV/NBFoXMkEmg8c1u0c= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by sourceware.org (Postfix) with ESMTPS id 6163B382D43A for ; Fri, 5 Mar 2021 20:15:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6163B382D43A Received: by mail-qt1-x82b.google.com with SMTP id s15so2799640qtq.0 for ; Fri, 05 Mar 2021 12:15:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wkJXyIkXz8nsZ3W01/XYbgig0DTqA48rdjZ3p8GVh04=; b=mCrUdQ+5alsXxneVj3V8gl2DjorAUULK3+h/3ZD8pkIHHkjkHKA88BUD89zViwlSQ2 KesRReN/d1MuStCwxyCNFqypgG+d26mdcrRZ9AViyH/AfQ0CHYKCvQwRQ3I6FKz2OLOf Qm9KF2dWo7yuzCd8mL20q7+lhuEDRuWwV7X7yTTq0hXMmzGNn19zfdLvjIDlUcOSChzs n57n5C7/Qw3OD/EXfKnapu5ARx3b6B185JmqV1fuoD+8TvxDsupH7daUwbl5jdOGgNaS vfUWpZM1KetDoDkbr093LtolRJrRd+3lCAnlP02BxTSnIEXG53PCiBfDqHuXFgqlKI/1 JPyA== X-Gm-Message-State: AOAM530vW8vrHOdwpMLZs2DDlJlspmvGnlX6Z9cLx1wXm0/T1Ee1fbck IukenIPHHvkSdUBTobtYABf/pWYbfPTCyg== X-Google-Smtp-Source: ABdhPJx8JFoDRFRw5AAmEQowJ3wPiQQ9ovCG38aUR/D7lKiGJo0gc8wHmj39lQapgNVLw3lN29yNQw== X-Received: by 2002:ac8:520d:: with SMTP id r13mr10623788qtn.38.1614975335725; Fri, 05 Mar 2021 12:15:35 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:35 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 11/52] linux: mips: Split libpthread.abilist in n32 and n64 Date: Fri, 5 Mar 2021 17:14:37 -0300 Message-Id: <20210305201518.798584-12-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The n32 will require the 64 bit time symbols for y2038 support. --- .../mips/mips64/{ => n32}/libpthread.abilist | 0 .../linux/mips/mips64/n64/libpthread.abilist | 238 ++++++++++++++++++ 2 files changed, 238 insertions(+) rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libpthread.abilist (100%) create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist similarity index 100% rename from sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist rename to sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist new file mode 100644 index 0000000000..b35d7f19ca --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist @@ -0,0 +1,238 @@ +GLIBC_2.0 _IO_flockfile F +GLIBC_2.0 _IO_ftrylockfile F +GLIBC_2.0 _IO_funlockfile F +GLIBC_2.0 __close F +GLIBC_2.0 __connect F +GLIBC_2.0 __errno_location F +GLIBC_2.0 __fcntl F +GLIBC_2.0 __fork F +GLIBC_2.0 __h_errno_location F +GLIBC_2.0 __lseek F +GLIBC_2.0 __open F +GLIBC_2.0 __pthread_getspecific F +GLIBC_2.0 __pthread_key_create F +GLIBC_2.0 __pthread_mutex_destroy F +GLIBC_2.0 __pthread_mutex_init F +GLIBC_2.0 __pthread_mutex_lock F +GLIBC_2.0 __pthread_mutex_trylock F +GLIBC_2.0 __pthread_mutex_unlock F +GLIBC_2.0 __pthread_mutexattr_destroy F +GLIBC_2.0 __pthread_mutexattr_init F +GLIBC_2.0 __pthread_mutexattr_settype F +GLIBC_2.0 __pthread_once F +GLIBC_2.0 __pthread_setspecific F +GLIBC_2.0 __read F +GLIBC_2.0 __send F +GLIBC_2.0 __sigaction F +GLIBC_2.0 __write F +GLIBC_2.0 _pthread_cleanup_pop F +GLIBC_2.0 _pthread_cleanup_pop_restore F +GLIBC_2.0 _pthread_cleanup_push F +GLIBC_2.0 _pthread_cleanup_push_defer F +GLIBC_2.0 accept F +GLIBC_2.0 close F +GLIBC_2.0 connect F +GLIBC_2.0 fcntl F +GLIBC_2.0 flockfile F +GLIBC_2.0 fork F +GLIBC_2.0 fsync F +GLIBC_2.0 ftrylockfile F +GLIBC_2.0 funlockfile F +GLIBC_2.0 longjmp F +GLIBC_2.0 lseek F +GLIBC_2.0 msync F +GLIBC_2.0 open F +GLIBC_2.0 pause F +GLIBC_2.0 pthread_atfork F +GLIBC_2.0 pthread_cancel F +GLIBC_2.0 pthread_cond_broadcast F +GLIBC_2.0 pthread_cond_signal F +GLIBC_2.0 pthread_cond_timedwait F +GLIBC_2.0 pthread_cond_wait F +GLIBC_2.0 pthread_create F +GLIBC_2.0 pthread_detach F +GLIBC_2.0 pthread_exit F +GLIBC_2.0 pthread_getspecific F +GLIBC_2.0 pthread_join F +GLIBC_2.0 pthread_key_create F +GLIBC_2.0 pthread_key_delete F +GLIBC_2.0 pthread_kill F +GLIBC_2.0 pthread_kill_other_threads_np F +GLIBC_2.0 pthread_mutex_destroy F +GLIBC_2.0 pthread_mutex_init F +GLIBC_2.0 pthread_mutex_lock F +GLIBC_2.0 pthread_mutex_trylock F +GLIBC_2.0 pthread_mutex_unlock F +GLIBC_2.0 pthread_mutexattr_destroy F +GLIBC_2.0 pthread_mutexattr_getkind_np F +GLIBC_2.0 pthread_mutexattr_init F +GLIBC_2.0 pthread_mutexattr_setkind_np F +GLIBC_2.0 pthread_once F +GLIBC_2.0 pthread_setcancelstate F +GLIBC_2.0 pthread_setcanceltype F +GLIBC_2.0 pthread_setspecific F +GLIBC_2.0 pthread_testcancel F +GLIBC_2.0 raise F +GLIBC_2.0 read F +GLIBC_2.0 recv F +GLIBC_2.0 recvfrom F +GLIBC_2.0 recvmsg F +GLIBC_2.0 sem_destroy F +GLIBC_2.0 sem_getvalue F +GLIBC_2.0 sem_init F +GLIBC_2.0 sem_post F +GLIBC_2.0 sem_trywait F +GLIBC_2.0 sem_wait F +GLIBC_2.0 send F +GLIBC_2.0 sendmsg F +GLIBC_2.0 sendto F +GLIBC_2.0 sigaction F +GLIBC_2.0 siglongjmp F +GLIBC_2.0 sigwait F +GLIBC_2.0 system F +GLIBC_2.0 tcdrain F +GLIBC_2.0 write F +GLIBC_2.11 pthread_sigqueue F +GLIBC_2.12 pthread_getname_np F +GLIBC_2.12 pthread_mutex_consistent F +GLIBC_2.12 pthread_mutexattr_getrobust F +GLIBC_2.12 pthread_mutexattr_setrobust F +GLIBC_2.12 pthread_setname_np F +GLIBC_2.18 pthread_getattr_default_np F +GLIBC_2.18 pthread_setattr_default_np F +GLIBC_2.2 __libc_allocate_rtsig F +GLIBC_2.2 __libc_current_sigrtmax F +GLIBC_2.2 __libc_current_sigrtmin F +GLIBC_2.2 __open64 F +GLIBC_2.2 __pread64 F +GLIBC_2.2 __pthread_rwlock_destroy F +GLIBC_2.2 __pthread_rwlock_init F +GLIBC_2.2 __pthread_rwlock_rdlock F +GLIBC_2.2 __pthread_rwlock_tryrdlock F +GLIBC_2.2 __pthread_rwlock_trywrlock F +GLIBC_2.2 __pthread_rwlock_unlock F +GLIBC_2.2 __pthread_rwlock_wrlock F +GLIBC_2.2 __pwrite64 F +GLIBC_2.2 __res_state F +GLIBC_2.2 lseek64 F +GLIBC_2.2 open64 F +GLIBC_2.2 pread F +GLIBC_2.2 pread64 F +GLIBC_2.2 pthread_attr_getguardsize F +GLIBC_2.2 pthread_attr_getstack F +GLIBC_2.2 pthread_attr_getstackaddr F +GLIBC_2.2 pthread_attr_getstacksize F +GLIBC_2.2 pthread_attr_setguardsize F +GLIBC_2.2 pthread_attr_setstack F +GLIBC_2.2 pthread_attr_setstackaddr F +GLIBC_2.2 pthread_attr_setstacksize F +GLIBC_2.2 pthread_barrier_destroy F +GLIBC_2.2 pthread_barrier_init F +GLIBC_2.2 pthread_barrier_wait F +GLIBC_2.2 pthread_barrierattr_destroy F +GLIBC_2.2 pthread_barrierattr_init F +GLIBC_2.2 pthread_barrierattr_setpshared F +GLIBC_2.2 pthread_condattr_getpshared F +GLIBC_2.2 pthread_condattr_setpshared F +GLIBC_2.2 pthread_create F +GLIBC_2.2 pthread_getconcurrency F +GLIBC_2.2 pthread_getcpuclockid F +GLIBC_2.2 pthread_mutex_timedlock F +GLIBC_2.2 pthread_mutexattr_getpshared F +GLIBC_2.2 pthread_mutexattr_gettype F +GLIBC_2.2 pthread_mutexattr_setpshared F +GLIBC_2.2 pthread_mutexattr_settype F +GLIBC_2.2 pthread_rwlock_destroy F +GLIBC_2.2 pthread_rwlock_init F +GLIBC_2.2 pthread_rwlock_rdlock F +GLIBC_2.2 pthread_rwlock_timedrdlock F +GLIBC_2.2 pthread_rwlock_timedwrlock F +GLIBC_2.2 pthread_rwlock_tryrdlock F +GLIBC_2.2 pthread_rwlock_trywrlock F +GLIBC_2.2 pthread_rwlock_unlock F +GLIBC_2.2 pthread_rwlock_wrlock F +GLIBC_2.2 pthread_rwlockattr_destroy F +GLIBC_2.2 pthread_rwlockattr_getkind_np F +GLIBC_2.2 pthread_rwlockattr_getpshared F +GLIBC_2.2 pthread_rwlockattr_init F +GLIBC_2.2 pthread_rwlockattr_setkind_np F +GLIBC_2.2 pthread_rwlockattr_setpshared F +GLIBC_2.2 pthread_setconcurrency F +GLIBC_2.2 pthread_spin_destroy F +GLIBC_2.2 pthread_spin_init F +GLIBC_2.2 pthread_spin_lock F +GLIBC_2.2 pthread_spin_trylock F +GLIBC_2.2 pthread_spin_unlock F +GLIBC_2.2 pthread_yield F +GLIBC_2.2 pwrite F +GLIBC_2.2 pwrite64 F +GLIBC_2.2 sem_close F +GLIBC_2.2 sem_destroy F +GLIBC_2.2 sem_getvalue F +GLIBC_2.2 sem_init F +GLIBC_2.2 sem_open F +GLIBC_2.2 sem_post F +GLIBC_2.2 sem_timedwait F +GLIBC_2.2 sem_trywait F +GLIBC_2.2 sem_unlink F +GLIBC_2.2 sem_wait F +GLIBC_2.2.3 __libpthread_version_placeholder F +GLIBC_2.2.6 __libpthread_version_placeholder F +GLIBC_2.28 call_once F +GLIBC_2.28 cnd_broadcast F +GLIBC_2.28 cnd_destroy F +GLIBC_2.28 cnd_init F +GLIBC_2.28 cnd_signal F +GLIBC_2.28 cnd_timedwait F +GLIBC_2.28 cnd_wait F +GLIBC_2.28 mtx_destroy F +GLIBC_2.28 mtx_init F +GLIBC_2.28 mtx_lock F +GLIBC_2.28 mtx_timedlock F +GLIBC_2.28 mtx_trylock F +GLIBC_2.28 mtx_unlock F +GLIBC_2.28 thrd_create F +GLIBC_2.28 thrd_detach F +GLIBC_2.28 thrd_exit F +GLIBC_2.28 thrd_join F +GLIBC_2.28 tss_create F +GLIBC_2.28 tss_delete F +GLIBC_2.28 tss_get F +GLIBC_2.28 tss_set F +GLIBC_2.3.2 pthread_cond_broadcast F +GLIBC_2.3.2 pthread_cond_signal F +GLIBC_2.3.2 pthread_cond_timedwait F +GLIBC_2.3.2 pthread_cond_wait F +GLIBC_2.3.3 __pthread_cleanup_routine F +GLIBC_2.3.3 __pthread_register_cancel F +GLIBC_2.3.3 __pthread_register_cancel_defer F +GLIBC_2.3.3 __pthread_unregister_cancel F +GLIBC_2.3.3 __pthread_unregister_cancel_restore F +GLIBC_2.3.3 __pthread_unwind_next F +GLIBC_2.3.3 pthread_attr_getaffinity_np F +GLIBC_2.3.3 pthread_attr_setstack F +GLIBC_2.3.3 pthread_attr_setstacksize F +GLIBC_2.3.3 pthread_barrierattr_getpshared F +GLIBC_2.3.3 pthread_condattr_getclock F +GLIBC_2.3.3 pthread_condattr_setclock F +GLIBC_2.3.3 pthread_setaffinity_np F +GLIBC_2.3.3 pthread_timedjoin_np F +GLIBC_2.3.3 pthread_tryjoin_np F +GLIBC_2.3.4 pthread_attr_getaffinity_np F +GLIBC_2.3.4 pthread_setaffinity_np F +GLIBC_2.3.4 pthread_setschedprio F +GLIBC_2.30 pthread_cond_clockwait F +GLIBC_2.30 pthread_mutex_clocklock F +GLIBC_2.30 pthread_rwlock_clockrdlock F +GLIBC_2.30 pthread_rwlock_clockwrlock F +GLIBC_2.30 sem_clockwait F +GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.4 pthread_mutex_consistent_np F +GLIBC_2.4 pthread_mutex_getprioceiling F +GLIBC_2.4 pthread_mutex_setprioceiling F +GLIBC_2.4 pthread_mutexattr_getprioceiling F +GLIBC_2.4 pthread_mutexattr_getprotocol F +GLIBC_2.4 pthread_mutexattr_getrobust_np F +GLIBC_2.4 pthread_mutexattr_setprioceiling F +GLIBC_2.4 pthread_mutexattr_setprotocol F +GLIBC_2.4 pthread_mutexattr_setrobust_np F From patchwork Fri Mar 5 20:14:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42294 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 E11E4382D43A; Fri, 5 Mar 2021 20:15:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E11E4382D43A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975339; bh=ygBDbiOQDA2Ow3P59x2q+bzCEnktA1RhSBuFSxMFRW0=; 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=nkXUslMWCodi2h0Y/iB7hATVEISPNo+IcX2U/771KuBpXNZ1JiHNgBxqkcLL7NEd4 RJRKp0D68ghzKPnSNT2IaUWNJOKmwQ5K+0LhsFvF7mi/dMN5jzrxpu8IDul/6wHrTh nkTCqvKfweb1zTXHae2k2DuuX67qblMMC8cU/VHA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by sourceware.org (Postfix) with ESMTPS id 6536A3987C0B for ; Fri, 5 Mar 2021 20:15:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6536A3987C0B Received: by mail-qv1-xf30.google.com with SMTP id cw15so1611852qvb.11 for ; Fri, 05 Mar 2021 12:15:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ygBDbiOQDA2Ow3P59x2q+bzCEnktA1RhSBuFSxMFRW0=; b=fuct3GmZkRdUFmMFNbiJGAstroZAVtgvl4qP04lXctAVlO21Qnxet5WBlbzFyPTDR/ I3nPcwwHtsGeov0bCOECjCfere0Btgv82ym+9qaL9HAvf3l7dAormXND2dLE7ctQ5Xus 4UHdUFjiCKG91CXg2HDXz8dic/5T9HvKMZyk4SugyU/RlXfStA6PZbaS8FRFa5RHo2U5 ROGMuOD27nKk5J9VfzdE4LIcIeTo6YYrk0vj2pm6x4t1qVb2cE2nERbgGtAzm9YxaAAC GVtCd5l+N54QKDkkmhl2EpcUQtU09ywoCreNuI3GBErPNXh+ZyFYLys5F1wffko6wjh+ I10w== X-Gm-Message-State: AOAM532cD0M0y57D5L1X1DfnArHG/bWhfq7P3iTUXGkd5CAKtfRGBvpu KtiDV+STP5DrM/li7c/loisTLG6frLJH5g== X-Google-Smtp-Source: ABdhPJwfsF73AhK/hbU4WWS/kWC2NlD/I6EI2YNM4KwTJ2ACCfDHUDvSFCxfFRrommkNoUFjmWhsEQ== X-Received: by 2002:ad4:410d:: with SMTP id i13mr10224088qvp.44.1614975336917; Fri, 05 Mar 2021 12:15:36 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:36 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 12/52] linux: mips: Split librt.abilist in n32 and n64 Date: Fri, 5 Mar 2021 17:14:38 -0300 Message-Id: <20210305201518.798584-13-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The n32 will require the 64 bit time symbols for y2038 support. --- .../linux/mips/mips64/{ => n32}/librt.abilist | 0 .../sysv/linux/mips/mips64/n64/librt.abilist | 37 +++++++++++++++++++ 2 files changed, 37 insertions(+) rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/librt.abilist (100%) create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist diff --git a/sysdeps/unix/sysv/linux/mips/mips64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist similarity index 100% rename from sysdeps/unix/sysv/linux/mips/mips64/librt.abilist rename to sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist new file mode 100644 index 0000000000..1539c1cef9 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/librt.abilist @@ -0,0 +1,37 @@ +GLIBC_2.2 aio_cancel F +GLIBC_2.2 aio_cancel64 F +GLIBC_2.2 aio_error F +GLIBC_2.2 aio_error64 F +GLIBC_2.2 aio_fsync F +GLIBC_2.2 aio_fsync64 F +GLIBC_2.2 aio_init F +GLIBC_2.2 aio_read F +GLIBC_2.2 aio_read64 F +GLIBC_2.2 aio_return F +GLIBC_2.2 aio_return64 F +GLIBC_2.2 aio_suspend F +GLIBC_2.2 aio_suspend64 F +GLIBC_2.2 aio_write F +GLIBC_2.2 aio_write64 F +GLIBC_2.2 lio_listio F +GLIBC_2.2 lio_listio64 F +GLIBC_2.2 shm_open F +GLIBC_2.2 shm_unlink F +GLIBC_2.2 timer_create F +GLIBC_2.2 timer_delete F +GLIBC_2.2 timer_getoverrun F +GLIBC_2.2 timer_gettime F +GLIBC_2.2 timer_settime F +GLIBC_2.3.4 mq_close F +GLIBC_2.3.4 mq_getattr F +GLIBC_2.3.4 mq_notify F +GLIBC_2.3.4 mq_open F +GLIBC_2.3.4 mq_receive F +GLIBC_2.3.4 mq_send F +GLIBC_2.3.4 mq_setattr F +GLIBC_2.3.4 mq_timedreceive F +GLIBC_2.3.4 mq_timedsend F +GLIBC_2.3.4 mq_unlink F +GLIBC_2.4 lio_listio F +GLIBC_2.4 lio_listio64 F +GLIBC_2.7 __mq_open_2 F From patchwork Fri Mar 5 20:14:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42295 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 E890F399C016; Fri, 5 Mar 2021 20:15:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E890F399C016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975341; bh=T5w6NDVkaRgGORrmAPuXjX146hX4+CM/p+Pj1+omZf8=; 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=YqQ6ueSQyjMjZGvBYQWRiyjeEQxNiEUW0LjWBGsvXEgHtumQJOERBmr/YttVl3/zu 9ttMoDvpTSzoWzP9Src6SRKtQKX5ckqmN3iEY53/+tLT5wfva/0BIVnE+quM/3CGJe Jmh/MqdOlz863s0MlSuoPVEdlWKL3nkwYufzVYVY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id 74E41382D43A for ; Fri, 5 Mar 2021 20:15:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 74E41382D43A Received: by mail-qk1-x72a.google.com with SMTP id a9so3243154qkn.13 for ; Fri, 05 Mar 2021 12:15:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T5w6NDVkaRgGORrmAPuXjX146hX4+CM/p+Pj1+omZf8=; b=IhxGJndrBEBOnTL4tFjohiuOPR4ePKhNvSu2lG6rvperNxKq52Jhhjgc7y6I/Uow72 duVCDPcXzFPRYeR3rpSjjbxbw66nFQMvKD5t2J9qP5vbAnRBC9Wx1XcUt8GTTnF2YHjp sSnACCrpK6CWBxalfiUsmgVU3YagX6YWi4d3gdVW0Dkeg4fmVwK9T25AIUPNOLLbSE0J 3blhAeUodG/Gma7cIQg+el7ifaKb/exbejH4HE/EKJ0bg5Dsl2q7LvVf5WYHNVa/jbij qABYdcqK+rasvgjzRmy0C5p98D4p90MhgUre52W9UjrVu7s1z15w8P6NcL3vkJvDsrP7 7LAw== X-Gm-Message-State: AOAM530ibQForRC6JVKSXSaxTROe+QqlULwLs0Q1b6GG9K13V6dIM22A bOrtHn5VxN6JcBdLdJSJVCUebN+n0JMg/w== X-Google-Smtp-Source: ABdhPJzoEiMkmg2IXOTHd5+K98eGVaSwDQNJAJmjGYuQvO308pSv/BIWsd8h3EFZVGdHhoZd5DhPUQ== X-Received: by 2002:a37:6c01:: with SMTP id h1mr3035852qkc.182.1614975337999; Fri, 05 Mar 2021 12:15:37 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:37 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 13/52] linux: mips: Split libanl.abilist in n32 and n64 Date: Fri, 5 Mar 2021 17:14:39 -0300 Message-Id: <20210305201518.798584-14-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The n32 will require the 64 bit time symbols for y2038 support. --- sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libanl.abilist | 0 sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist | 4 ++++ 2 files changed, 4 insertions(+) rename sysdeps/unix/sysv/linux/mips/mips64/{ => n32}/libanl.abilist (100%) create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist similarity index 100% rename from sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist rename to sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist new file mode 100644 index 0000000000..d9a5ed015d --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libanl.abilist @@ -0,0 +1,4 @@ +GLIBC_2.2.3 gai_cancel F +GLIBC_2.2.3 gai_error F +GLIBC_2.2.3 gai_suspend F +GLIBC_2.2.3 getaddrinfo_a F From patchwork Fri Mar 5 20:14:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42296 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 7B6F4399C021; Fri, 5 Mar 2021 20:15:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B6F4399C021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975342; bh=rnQpxUrGPW3VYsI/tBuWgTjJRssMVA/KN5XB0BdhX24=; 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=q9lRopXHGivTNnA8ozeuI0hWeJYUuV3tva6Nz6YOBud6YuiIiOOOBLCQZ9Fogzd+b Yf5L90YIBFTkRYCR0+vzv9PyNWP595TNRSbjbPmDtfAkFvIUIlj2ne37RCsswXigVA 1y/EcQdfM/LrR3TZJOm/ftDANR5we+va7141p1SQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by sourceware.org (Postfix) with ESMTPS id 9909E399C017 for ; Fri, 5 Mar 2021 20:15:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9909E399C017 Received: by mail-qv1-xf30.google.com with SMTP id t1so1620543qvj.8 for ; Fri, 05 Mar 2021 12:15:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rnQpxUrGPW3VYsI/tBuWgTjJRssMVA/KN5XB0BdhX24=; b=pD+KZCNC6E1l3XRIx5rhlLqqSQgPyQ4TFV48DBJnosEIC5bCA/fAADI4cSQU9pL3+D pjihiKmoXXd1t6kc27vx/XcEo9hn1+6t4x5yemlPFhReOi9DzG8EDzACmRSTnKwERZ7O ASLhT9KsIJ8D+4UAiasS0qTI+dTi1Ej7f6mn1DEAg3Ih22vQORs2npA9UF6mnMmlWcoR kgRtVs3F70Ax6BO7Vjd0kKmxbkVwMeT/xDZ8FcDJYtr4k8gGnBmm1WU+r642KmqA/iNd ZF+5S9kTR8IJ/83pNynBqkmL8vAo1KChoqeeQkPWBt7gR6kP5W6n8fDF6HsASFrK8mj9 jQmQ== X-Gm-Message-State: AOAM5314qHhy+0Tf8euz9+sHuFCkVZJKfw0ZlkLL5pDYABD74Geyz6Xc 215U83ZuN0N/uiQ/4k/OGsG6XgjlEnCPDQ== X-Google-Smtp-Source: ABdhPJzLJMHWBDDwOEOWIXUe8YctEqeuBQsl+L8V7A4bgEJRYmjh6Y49J7lyxLOaIMilaWVM8rV8iQ== X-Received: by 2002:a05:6214:2b:: with SMTP id b11mr10983969qvr.3.1614975339086; Fri, 05 Mar 2021 12:15:39 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:38 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 14/52] linux: s390: Add libanl.abilist in s390 and s390x Date: Fri, 5 Mar 2021 17:14:40 -0300 Message-Id: <20210305201518.798584-15-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The s390 will require the 64 bit time symbols for y2038 support. --- sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist | 0 sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist | 4 ++++ 2 files changed, 4 insertions(+) rename sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist (100%) create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist diff --git a/sysdeps/unix/sysv/linux/s390/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist similarity index 100% rename from sysdeps/unix/sysv/linux/s390/libanl.abilist rename to sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist new file mode 100644 index 0000000000..d9a5ed015d --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist @@ -0,0 +1,4 @@ +GLIBC_2.2.3 gai_cancel F +GLIBC_2.2.3 gai_error F +GLIBC_2.2.3 gai_suspend F +GLIBC_2.2.3 getaddrinfo_a F From patchwork Fri Mar 5 20:14:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42298 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 8F879399C027; Fri, 5 Mar 2021 20:15:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F879399C027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975345; bh=3MLbTbxc7tSsz1+GQBTq9U66xOmSWF/z0wVhg1/nRpQ=; 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=OMEXEI1g48+uOYJ/FkCpUeHaseXexrMntmBj5hIE8E5Gnsui7fjelUzi+tgDGSvYE 54McS9sLKvEKo95tFfZWLOF223KusZJ9npAsqB5vI+xyo40B0VWJUZd3WmtA15Fgny erTS/o6BKv730xkf3QTpMN+HgUUBqz+xa8k9P0Z8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by sourceware.org (Postfix) with ESMTPS id 8263B399C01F for ; Fri, 5 Mar 2021 20:15:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8263B399C01F Received: by mail-qv1-xf29.google.com with SMTP id 15so1603587qvp.13 for ; Fri, 05 Mar 2021 12:15:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3MLbTbxc7tSsz1+GQBTq9U66xOmSWF/z0wVhg1/nRpQ=; b=poVMSdQTntL5fKcGPewblPOmzcSbSR4MVmNAbcuSkvB+M+Cj4NhtSJ8PPU/9B6XGha Xr/BnuArukG20bT6fM4DWWhKqgcdq+yDoHvj47Uqts9HTSVIdc3ant1jAxr/iLj/ccoR 4e8f+4eA3gKA7wA+fj3VeFvz5gd8hYjQVnnhXumq1k1j59/Mkk47re/LDNNRM9DWcZbD mNXJQdAz3sKiXJEj/66veLqzyy0CC53arnVLlh2rVjF9BKvUZ3yT/AWlKccQBuozicUT PBukn/R7i4dQS6AC536LxuzCkPzgue1jBmUCn8ZdCe4FJb8KsM3cTuKf9eVXPX51evpb shyQ== X-Gm-Message-State: AOAM531NPgzYn4UBCfHPcVGgbShsHL0DBkkf4m7/wgSBtiOJ8duaZn+Z DFXCvE9QZDw6d/3FSb2Io+uGxw4QeA5sZg== X-Google-Smtp-Source: ABdhPJw4+TaJTLu5DETWOsXH+lAHpsc//kPOLx2QXoMaCDp18DFH5qa7HQt3ofmDQ9wGMzXQ8S7vAA== X-Received: by 2002:a0c:b59f:: with SMTP id g31mr10591356qve.28.1614975340279; Fri, 05 Mar 2021 12:15:40 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:40 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 15/52] login: Consolidate utmp and utmpx headers Date: Fri, 5 Mar 2021 17:14:41 -0300 Message-Id: <20210305201518.798584-16-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It moves the 'struct lastlog', 'struct utmp', and 'struct utmpx' to specific files and consolidates the s390-32 utmp.h and utmpx.h headers. Checked on x86_64-linux-gnu and i686-linux-gnu. I also checked with a build for s390-linux-gnu. --- bits/types/struct_lastlog.h | 34 +++++ bits/types/struct_utmp.h | 55 ++++++++ bits/utmp.h | 48 +------ login/Makefile | 5 +- sysdeps/gnu/bits/struct_utmpx.h | 55 ++++++++ sysdeps/gnu/bits/utmpx.h | 34 +---- .../sysv/linux/s390/bits/struct_lastlog.h | 34 +++++ .../unix/sysv/linux/s390/bits/struct_utmp.h | 51 +++++++ .../s390/bits/{utmpx.h => struct_utmpx.h} | 57 +------- sysdeps/unix/sysv/linux/s390/bits/utmp.h | 127 ------------------ 10 files changed, 239 insertions(+), 261 deletions(-) create mode 100644 bits/types/struct_lastlog.h create mode 100644 bits/types/struct_utmp.h create mode 100644 sysdeps/gnu/bits/struct_utmpx.h create mode 100644 sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h create mode 100644 sysdeps/unix/sysv/linux/s390/bits/struct_utmp.h rename sysdeps/unix/sysv/linux/s390/bits/{utmpx.h => struct_utmpx.h} (56%) delete mode 100644 sysdeps/unix/sysv/linux/s390/bits/utmp.h diff --git a/bits/types/struct_lastlog.h b/bits/types/struct_lastlog.h new file mode 100644 index 0000000000..bde4dd2ad0 --- /dev/null +++ b/bits/types/struct_lastlog.h @@ -0,0 +1,34 @@ +/* The 'struct lastlog' type. + Copyright (C) 2021 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 + . */ + +#ifndef _UTMP_H +# error "Never include directly; use instead." +#endif + +/* The structure describing an entry in the database of + previous logins. */ +struct lastlog +{ +#if __WORDSIZE_TIME64_COMPAT32 + int32_t ll_time; +#else + __time_t ll_time; +#endif + char ll_line[UT_LINESIZE]; + char ll_host[UT_HOSTSIZE]; +}; diff --git a/bits/types/struct_utmp.h b/bits/types/struct_utmp.h new file mode 100644 index 0000000000..76529ea62f --- /dev/null +++ b/bits/types/struct_utmp.h @@ -0,0 +1,55 @@ +/* The 'struct utmp' type, describing entries in the utmp file. + Copyright (C) 2021 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 + . */ + +#ifndef _UTMP_H +# error "Never include directly; use instead." +#endif + +/* The structure describing an entry in the user accounting database. */ +struct utmp +{ + short int ut_type; /* Type of login. */ + pid_t ut_pid; /* Process ID of login process. */ + char ut_line[UT_LINESIZE] + __attribute_nonstring__; /* Devicename. */ + char ut_id[4] + __attribute_nonstring__; /* Inittab ID. */ + char ut_user[UT_NAMESIZE] + __attribute_nonstring__; /* Username. */ + char ut_host[UT_HOSTSIZE] + __attribute_nonstring__; /* Hostname for remote login. */ + struct exit_status ut_exit; /* Exit status of a process marked + as DEAD_PROCESS. */ +/* The ut_session and ut_tv fields must be the same size when compiled + 32- and 64-bit. This allows data files and shared memory to be + shared between 32- and 64-bit applications. */ +#if __WORDSIZE_TIME64_COMPAT32 + int32_t ut_session; /* Session ID, used for windowing. */ + struct + { + int32_t tv_sec; /* Seconds. */ + int32_t tv_usec; /* Microseconds. */ + } ut_tv; /* Time entry was made. */ +#else + long int ut_session; /* Session ID, used for windowing. */ + struct timeval ut_tv; /* Time entry was made. */ +#endif + + int32_t ut_addr_v6[4]; /* Internet address of remote host. */ + char __glibc_reserved[20]; /* Reserved for future use. */ +}; diff --git a/bits/utmp.h b/bits/utmp.h index 7e5512ef26..da2a6ac260 100644 --- a/bits/utmp.h +++ b/bits/utmp.h @@ -31,18 +31,7 @@ #define UT_HOSTSIZE 256 -/* The structure describing an entry in the database of - previous logins. */ -struct lastlog - { -#if __WORDSIZE_TIME64_COMPAT32 - int32_t ll_time; -#else - __time_t ll_time; -#endif - char ll_line[UT_LINESIZE]; - char ll_host[UT_HOSTSIZE]; - }; +#include /* The structure describing the status of a terminated process. This @@ -53,40 +42,7 @@ struct exit_status short int e_exit; /* Process exit status. */ }; - -/* The structure describing an entry in the user accounting database. */ -struct utmp -{ - short int ut_type; /* Type of login. */ - pid_t ut_pid; /* Process ID of login process. */ - char ut_line[UT_LINESIZE] - __attribute_nonstring__; /* Devicename. */ - char ut_id[4] - __attribute_nonstring__; /* Inittab ID. */ - char ut_user[UT_NAMESIZE] - __attribute_nonstring__; /* Username. */ - char ut_host[UT_HOSTSIZE] - __attribute_nonstring__; /* Hostname for remote login. */ - struct exit_status ut_exit; /* Exit status of a process marked - as DEAD_PROCESS. */ -/* The ut_session and ut_tv fields must be the same size when compiled - 32- and 64-bit. This allows data files and shared memory to be - shared between 32- and 64-bit applications. */ -#if __WORDSIZE_TIME64_COMPAT32 - int32_t ut_session; /* Session ID, used for windowing. */ - struct - { - int32_t tv_sec; /* Seconds. */ - int32_t tv_usec; /* Microseconds. */ - } ut_tv; /* Time entry was made. */ -#else - long int ut_session; /* Session ID, used for windowing. */ - struct timeval ut_tv; /* Time entry was made. */ -#endif - - int32_t ut_addr_v6[4]; /* Internet address of remote host. */ - char __glibc_reserved[20]; /* Reserved for future use. */ -}; +#include /* Backwards compatibility hacks. */ #define ut_name ut_user diff --git a/login/Makefile b/login/Makefile index bc72e6e5b4..f7059ac660 100644 --- a/login/Makefile +++ b/login/Makefile @@ -23,7 +23,10 @@ subdir := login include ../Makeconfig -headers := utmp.h bits/utmp.h lastlog.h pty.h +headers := utmp.h bits/utmp.h lastlog.h pty.h \ + bits/types/struct_lastlog.h \ + bits/types/struct_utmp.h \ + bits/struct_utmpx.h routines := getlogin getlogin_r setlogin getlogin_r_chk \ getutent getutent_r getutid getutline getutid_r getutline_r \ diff --git a/sysdeps/gnu/bits/struct_utmpx.h b/sysdeps/gnu/bits/struct_utmpx.h new file mode 100644 index 0000000000..8d6db50c06 --- /dev/null +++ b/sysdeps/gnu/bits/struct_utmpx.h @@ -0,0 +1,55 @@ +/* The 'struct utmpx' type. + Copyright (C) 2021 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 + . */ + +#ifndef _UTMPX_H +# error "Never include directly; use instead." +#endif + +/* The structure describing an entry in the user accounting database. */ +struct utmpx +{ + short int ut_type; /* Type of login. */ + __pid_t ut_pid; /* Process ID of login process. */ + char ut_line[__UT_LINESIZE] + __attribute_nonstring__; /* Devicename. */ + char ut_id[4] + __attribute_nonstring__; /* Inittab ID. */ + char ut_user[__UT_NAMESIZE] + __attribute_nonstring__; /* Username. */ + char ut_host[__UT_HOSTSIZE] + __attribute_nonstring__; /* Hostname for remote login. */ + struct __exit_status ut_exit; /* Exit status of a process marked + as DEAD_PROCESS. */ + +/* The fields ut_session and ut_tv must be the same size when compiled + 32- and 64-bit. This allows files and shared memory to be shared + between 32- and 64-bit applications. */ +#if __WORDSIZE_TIME64_COMPAT32 + __int32_t ut_session; /* Session ID, used for windowing. */ + struct + { + __int32_t tv_sec; /* Seconds. */ + __int32_t tv_usec; /* Microseconds. */ + } ut_tv; /* Time entry was made. */ +#else + long int ut_session; /* Session ID, used for windowing. */ + struct timeval ut_tv; /* Time entry was made. */ +#endif + __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ + char __glibc_reserved[20]; /* Reserved for future use. */ +}; diff --git a/sysdeps/gnu/bits/utmpx.h b/sysdeps/gnu/bits/utmpx.h index c859c5b900..26ec95603f 100644 --- a/sysdeps/gnu/bits/utmpx.h +++ b/sysdeps/gnu/bits/utmpx.h @@ -51,39 +51,7 @@ struct __exit_status }; -/* The structure describing an entry in the user accounting database. */ -struct utmpx -{ - short int ut_type; /* Type of login. */ - __pid_t ut_pid; /* Process ID of login process. */ - char ut_line[__UT_LINESIZE] - __attribute_nonstring__; /* Devicename. */ - char ut_id[4] - __attribute_nonstring__; /* Inittab ID. */ - char ut_user[__UT_NAMESIZE] - __attribute_nonstring__; /* Username. */ - char ut_host[__UT_HOSTSIZE] - __attribute_nonstring__; /* Hostname for remote login. */ - struct __exit_status ut_exit; /* Exit status of a process marked - as DEAD_PROCESS. */ - -/* The fields ut_session and ut_tv must be the same size when compiled - 32- and 64-bit. This allows files and shared memory to be shared - between 32- and 64-bit applications. */ -#if __WORDSIZE_TIME64_COMPAT32 - __int32_t ut_session; /* Session ID, used for windowing. */ - struct - { - __int32_t tv_sec; /* Seconds. */ - __int32_t tv_usec; /* Microseconds. */ - } ut_tv; /* Time entry was made. */ -#else - long int ut_session; /* Session ID, used for windowing. */ - struct timeval ut_tv; /* Time entry was made. */ -#endif - __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ - char __glibc_reserved[20]; /* Reserved for future use. */ -}; +#include /* Values for the `ut_type' field of a `struct utmpx'. */ diff --git a/sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h b/sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h new file mode 100644 index 0000000000..4faa9922f4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h @@ -0,0 +1,34 @@ +/* The 'struct lastlog' type. + Copyright (C) 2021 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 + . */ + +#ifndef _UTMP_H +# error "Never include directly; use instead." +#endif + +/* The structure describing an entry in the database of + previous logins. */ +struct lastlog +{ +#if __WORDSIZE == 32 + int64_t ll_time; +#else + __time_t ll_time; +#endif + char ll_line[UT_LINESIZE]; + char ll_host[UT_HOSTSIZE]; +}; diff --git a/sysdeps/unix/sysv/linux/s390/bits/struct_utmp.h b/sysdeps/unix/sysv/linux/s390/bits/struct_utmp.h new file mode 100644 index 0000000000..c54b789553 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/bits/struct_utmp.h @@ -0,0 +1,51 @@ +/* The 'struct utmp' type, describing entries in the utmp file. + Copyright (C) 2021 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 + . */ + +/* The structure describing an entry in the user accounting database. */ +struct utmp +{ + short int ut_type; /* Type of login. */ + pid_t ut_pid; /* Process ID of login process. */ + char ut_line[UT_LINESIZE] + __attribute_nonstring__; /* Devicename. */ + char ut_id[4] + __attribute_nonstring__; /* Inittab ID. */ + char ut_user[UT_NAMESIZE] + __attribute_nonstring__; /* Username. */ + char ut_host[UT_HOSTSIZE] + __attribute_nonstring__; /* Hostname for remote login. */ + struct exit_status ut_exit; /* Exit status of a process marked + as DEAD_PROCESS. */ +/* The ut_session and ut_tv fields must be the same size when compiled + 32- and 64-bit. This allows data files and shared memory to be + shared between 32- and 64-bit applications. */ +#if __WORDSIZE == 32 + int64_t ut_session; /* Session ID, used for windowing. */ + struct + { + int64_t tv_sec; /* Seconds. */ + int64_t tv_usec; /* Microseconds. */ + } ut_tv; /* Time entry was made. */ +#else + long int ut_session; /* Session ID, used for windowing. */ + struct timeval ut_tv; /* Time entry was made. */ +#endif + + int32_t ut_addr_v6[4]; /* Internet address of remote host. */ + char __glibc_reserved[20]; /* Reserved for future use. */ +}; diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h b/sysdeps/unix/sysv/linux/s390/bits/struct_utmpx.h similarity index 56% rename from sysdeps/unix/sysv/linux/s390/bits/utmpx.h rename to sysdeps/unix/sysv/linux/s390/bits/struct_utmpx.h index c51faf9ac6..f0708b9c6b 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/utmpx.h +++ b/sysdeps/unix/sysv/linux/s390/bits/struct_utmpx.h @@ -1,5 +1,5 @@ -/* Structures and definitions for the user accounting database. GNU version. - Copyright (C) 1997-2021 Free Software Foundation, Inc. +/* The 'struct utmpx' type. + Copyright (C) 2021 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 @@ -17,40 +17,9 @@ . */ #ifndef _UTMPX_H -# error "Never include directly; use instead." +# error "Never include directly; use instead." #endif -#include -#include -#include - - -#ifdef __USE_GNU -# include -# define _PATH_UTMPX _PATH_UTMP -# define _PATH_WTMPX _PATH_WTMP -#endif - - -#define __UT_LINESIZE 32 -#define __UT_NAMESIZE 32 -#define __UT_HOSTSIZE 256 - - -/* The structure describing the status of a terminated process. This - type is used in `struct utmpx' below. */ -struct __exit_status - { -#ifdef __USE_GNU - short int e_termination; /* Process termination status. */ - short int e_exit; /* Process exit status. */ -#else - short int __e_termination; /* Process termination status. */ - short int __e_exit; /* Process exit status. */ -#endif - }; - - /* The structure describing an entry in the user accounting database. */ struct utmpx { @@ -84,23 +53,3 @@ struct utmpx __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ char __glibc_reserved[20]; /* Reserved for future use. */ }; - - -/* Values for the `ut_type' field of a `struct utmpx'. */ -#define EMPTY 0 /* No valid user accounting information. */ - -#ifdef __USE_GNU -# define RUN_LVL 1 /* The system's runlevel. */ -#endif -#define BOOT_TIME 2 /* Time of system boot. */ -#define NEW_TIME 3 /* Time after system clock changed. */ -#define OLD_TIME 4 /* Time when system clock changed. */ - -#define INIT_PROCESS 5 /* Process spawned by the init process. */ -#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ -#define USER_PROCESS 7 /* Normal process. */ -#define DEAD_PROCESS 8 /* Terminated process. */ - -#ifdef __USE_GNU -# define ACCOUNTING 9 /* System accounting. */ -#endif diff --git a/sysdeps/unix/sysv/linux/s390/bits/utmp.h b/sysdeps/unix/sysv/linux/s390/bits/utmp.h deleted file mode 100644 index 4172fa04cc..0000000000 --- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h +++ /dev/null @@ -1,127 +0,0 @@ -/* The `struct utmp' type, describing entries in the utmp file. GNU version. - Copyright (C) 1993-2021 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 - . */ - -#ifndef _UTMP_H -# error "Never include directly; use instead." -#endif - -#include -#include -#include -#include - - -#define UT_LINESIZE 32 -#define UT_NAMESIZE 32 -#define UT_HOSTSIZE 256 - - -/* The structure describing an entry in the database of - previous logins. */ -struct lastlog - { -#if __WORDSIZE == 32 - int64_t ll_time; -#else - __time_t ll_time; -#endif - char ll_line[UT_LINESIZE]; - char ll_host[UT_HOSTSIZE]; - }; - - -/* The structure describing the status of a terminated process. This - type is used in `struct utmp' below. */ -struct exit_status - { - short int e_termination; /* Process termination status. */ - short int e_exit; /* Process exit status. */ - }; - - -/* The structure describing an entry in the user accounting database. */ -struct utmp -{ - short int ut_type; /* Type of login. */ - pid_t ut_pid; /* Process ID of login process. */ - char ut_line[UT_LINESIZE] - __attribute_nonstring__; /* Devicename. */ - char ut_id[4] - __attribute_nonstring__; /* Inittab ID. */ - char ut_user[UT_NAMESIZE] - __attribute_nonstring__; /* Username. */ - char ut_host[UT_HOSTSIZE] - __attribute_nonstring__; /* Hostname for remote login. */ - struct exit_status ut_exit; /* Exit status of a process marked - as DEAD_PROCESS. */ -/* The ut_session and ut_tv fields must be the same size when compiled - 32- and 64-bit. This allows data files and shared memory to be - shared between 32- and 64-bit applications. */ -#if __WORDSIZE == 32 - int64_t ut_session; /* Session ID, used for windowing. */ - struct - { - int64_t tv_sec; /* Seconds. */ - int64_t tv_usec; /* Microseconds. */ - } ut_tv; /* Time entry was made. */ -#else - long int ut_session; /* Session ID, used for windowing. */ - struct timeval ut_tv; /* Time entry was made. */ -#endif - - int32_t ut_addr_v6[4]; /* Internet address of remote host. */ - char __glibc_reserved[20]; /* Reserved for future use. */ -}; - -/* Backwards compatibility hacks. */ -#define ut_name ut_user -#ifndef _NO_UT_TIME -/* We have a problem here: `ut_time' is also used otherwise. Define - _NO_UT_TIME if the compiler complains. */ -# define ut_time ut_tv.tv_sec -#endif -#define ut_xtime ut_tv.tv_sec -#define ut_addr ut_addr_v6[0] - - -/* Values for the `ut_type' field of a `struct utmp'. */ -#define EMPTY 0 /* No valid user accounting information. */ - -#define RUN_LVL 1 /* The system's runlevel. */ -#define BOOT_TIME 2 /* Time of system boot. */ -#define NEW_TIME 3 /* Time after system clock changed. */ -#define OLD_TIME 4 /* Time when system clock changed. */ - -#define INIT_PROCESS 5 /* Process spawned by the init process. */ -#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */ -#define USER_PROCESS 7 /* Normal process. */ -#define DEAD_PROCESS 8 /* Terminated process. */ - -#define ACCOUNTING 9 - -/* Old Linux name for the EMPTY type. */ -#define UT_UNKNOWN EMPTY - - -/* Tell the user that we have a modern system with UT_HOST, UT_PID, - UT_TYPE, UT_ID and UT_TV fields. */ -#define _HAVE_UT_TYPE 1 -#define _HAVE_UT_PID 1 -#define _HAVE_UT_ID 1 -#define _HAVE_UT_TV 1 -#define _HAVE_UT_HOST 1 From patchwork Fri Mar 5 20:14:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42297 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 0CBD5399C01F; Fri, 5 Mar 2021 20:15:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0CBD5399C01F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975345; bh=FekgnyVul78cdF123mU/MPpeauHlljIipJ8AMMHVyUA=; 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=xhi35u/okSEeVnI5dAWo48O1X3wm4Ev2COxVyUavp0HzMmfss+Lti/2ef/5nFb73x UrwoZXQoQniQs4/K6sxfXHqYzgPmPaI/ImhxN3qoEGKVNuDuePEV0sIepcss3MXVtD 0Kl78qQUF7f0M574h4s3kJlbWLxm/aRmtTBTCcSM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by sourceware.org (Postfix) with ESMTPS id 4E4553897807 for ; Fri, 5 Mar 2021 20:15:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4E4553897807 Received: by mail-qk1-x734.google.com with SMTP id b130so3253224qkc.10 for ; Fri, 05 Mar 2021 12:15:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FekgnyVul78cdF123mU/MPpeauHlljIipJ8AMMHVyUA=; b=HYC0JPPqNP35eR/um6wBiTk+DA+NnJDQQT5mciB7hY7GZVfIwiaNugxCMGAJYC2e4W Boub737oryUc4gay7aTup2fE2+dhtQNPOyAMQqSsblMY4A5UTCOiNYR0vVJ57RhpHJbX xdd3JEWGrH0U9dtp+4IZvkQO5E7ubxTYrJt/odx9m/Avy99yqq5VlO3n5ibgynv7eS9B Qu9NbftMI8iFVhhwBVP7E2AJvq3K6z7u1gpiWEVzaD1e7Qp+msCiWoeHZMG2G1VYwLQr H+AMicgOQEtWFWOXcJeuUrvx6eHKHhVitNHMbbGLH4Vl2KSvps+kNk9WsFoxm4wG4V4p bzJA== X-Gm-Message-State: AOAM530L9bdu+FiQnH1IhoMkMKjVBwuOpS1psdBlkC5cEnnOFNPfldNL q4u6EP6mhD+H6Q4BzUdIwZg0fox9HPI2Fw== X-Google-Smtp-Source: ABdhPJzy3vGLerNTsuO4VUYyB+rNCiSh9dOVL99U7rDBXJImGFzfGmKyyF/Ce+qzwhRKFE2nkrDVcg== X-Received: by 2002:a37:4783:: with SMTP id u125mr10994842qka.186.1614975341513; Fri, 05 Mar 2021 12:15:41 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:41 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 16/52] login: Move gnu utmpx to default implementation Date: Fri, 5 Mar 2021 17:14:42 -0300 Message-Id: <20210305201518.798584-17-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It removes one indirection where generic implementation assumes that utmp and utmpx might differ and allows the optimize the symbol alias where getutmp is the same as getumpx. Checked with make check run-built-tests=no on all afftected ABIs. --- .../gnu/bits => bits/types}/struct_utmpx.h | 0 {sysdeps/gnu/bits => bits}/utmpx.h | 2 +- include/utmpx.h | 1 + login/Makefile | 2 +- login/getutmp.c | 34 ++++++++++++++++-- login/getutmpx.c | 35 +------------------ login/updwtmp.c | 11 +++++- {sysdeps/gnu => login}/utmpx.h | 0 sysdeps/gnu/getutmp.c | 34 ------------------ sysdeps/gnu/getutmpx.c | 1 - sysdeps/gnu/updwtmp.c | 31 ---------------- .../unix/sysv/linux/s390/s390-32/getutmp.c | 21 ++++------- .../unix/sysv/linux/s390/s390-32/updwtmp.c | 2 +- 13 files changed, 54 insertions(+), 120 deletions(-) rename {sysdeps/gnu/bits => bits/types}/struct_utmpx.h (100%) rename {sysdeps/gnu/bits => bits}/utmpx.h (98%) create mode 100644 include/utmpx.h rename {sysdeps/gnu => login}/utmpx.h (100%) delete mode 100644 sysdeps/gnu/getutmp.c delete mode 100644 sysdeps/gnu/getutmpx.c delete mode 100644 sysdeps/gnu/updwtmp.c diff --git a/sysdeps/gnu/bits/struct_utmpx.h b/bits/types/struct_utmpx.h similarity index 100% rename from sysdeps/gnu/bits/struct_utmpx.h rename to bits/types/struct_utmpx.h diff --git a/sysdeps/gnu/bits/utmpx.h b/bits/utmpx.h similarity index 98% rename from sysdeps/gnu/bits/utmpx.h rename to bits/utmpx.h index 26ec95603f..b2947b1c13 100644 --- a/sysdeps/gnu/bits/utmpx.h +++ b/bits/utmpx.h @@ -51,7 +51,7 @@ struct __exit_status }; -#include +#include /* Values for the `ut_type' field of a `struct utmpx'. */ diff --git a/include/utmpx.h b/include/utmpx.h new file mode 100644 index 0000000000..cfe9b7c054 --- /dev/null +++ b/include/utmpx.h @@ -0,0 +1 @@ +#include diff --git a/login/Makefile b/login/Makefile index f7059ac660..5e2cb1da06 100644 --- a/login/Makefile +++ b/login/Makefile @@ -26,7 +26,7 @@ include ../Makeconfig headers := utmp.h bits/utmp.h lastlog.h pty.h \ bits/types/struct_lastlog.h \ bits/types/struct_utmp.h \ - bits/struct_utmpx.h + bits/types/struct_utmpx.h routines := getlogin getlogin_r setlogin getlogin_r_chk \ getutent getutent_r getutid getutline getutid_r getutline_r \ diff --git a/login/getutmp.c b/login/getutmp.c index 0401e041dd..60aafb5067 100644 --- a/login/getutmp.c +++ b/login/getutmp.c @@ -17,17 +17,47 @@ #include #include +#include +#define getutmpx __redirect_getutmpx #include +#undef getutmpx + +#define CHECK_SIZE_AND_OFFSET(field) \ + _Static_assert (sizeof ((struct utmp){0}.field) \ + == sizeof ((struct utmpx){0}.field), \ + "sizeof ((struct utmp){0}." #field " != " \ + "sizeof ((struct utmpx){0}" #field); \ + _Static_assert (offsetof (struct utmp, field) \ + == offsetof (struct utmpx, field), \ + "offsetof (struct utmp, " #field ") != " \ + "offsetof (struct utmpx, " #field ")"); + +/* This ensure the getutmp to getutmpx alias is valid. */ +_Static_assert (sizeof (struct utmp) == sizeof (struct utmpx), + "sizeof (struct utmp) != sizeof (struct utmpx)"); +CHECK_SIZE_AND_OFFSET (ut_type) +CHECK_SIZE_AND_OFFSET (ut_pid) +CHECK_SIZE_AND_OFFSET (ut_line) +CHECK_SIZE_AND_OFFSET (ut_user) +CHECK_SIZE_AND_OFFSET (ut_id) +CHECK_SIZE_AND_OFFSET (ut_host) +CHECK_SIZE_AND_OFFSET (ut_tv) + /* Copy the information in UTMPX to UTMP. */ void -getutmp (const struct utmpx *utmpx, struct utmp *utmp) +__getutmp (const struct utmpx *utmpx, struct utmp *utmp) { + memset (utmp, 0, sizeof (struct utmpx)); utmp->ut_type = utmpx->ut_type; utmp->ut_pid = utmpx->ut_pid; memcpy (utmp->ut_line, utmpx->ut_line, sizeof (utmp->ut_line)); memcpy (utmp->ut_user, utmpx->ut_user, sizeof (utmp->ut_user)); memcpy (utmp->ut_id, utmpx->ut_id, sizeof (utmp->ut_id)); memcpy (utmp->ut_host, utmpx->ut_host, sizeof (utmp->ut_host)); - utmp->ut_tv = utmpx->ut_tv; + utmp->ut_tv.tv_sec = utmpx->ut_tv.tv_sec; + utmp->ut_tv.tv_usec = utmpx->ut_tv.tv_usec; } + +weak_alias (__getutmp, getutmp) +strong_alias (__getutmp, getutmpx) diff --git a/login/getutmpx.c b/login/getutmpx.c index 228726a05a..839eb6826e 100644 --- a/login/getutmpx.c +++ b/login/getutmpx.c @@ -1,34 +1 @@ -/* Copyright (C) 1999-2021 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 -#include - -/* Copy the information in UTMP to UTMPX. */ -void -getutmpx (const struct utmp *utmp, struct utmpx *utmpx) -{ - memset (utmpx, 0, sizeof (struct utmpx)); - utmpx->ut_type = utmp->ut_type; - utmpx->ut_pid = utmp->ut_pid; - memcpy (utmpx->ut_line, utmp->ut_line, sizeof (utmp->ut_line)); - memcpy (utmpx->ut_user, utmp->ut_user, sizeof (utmp->ut_user)); - memcpy (utmpx->ut_id, utmp->ut_id, sizeof (utmp->ut_id)); - memcpy (utmpx->ut_host, utmp->ut_host, sizeof (utmp->ut_host)); - utmpx->ut_tv = utmp->ut_tv; -} +/* Implemented by getutmp.c. */ diff --git a/login/updwtmp.c b/login/updwtmp.c index 0558198464..ae67cfc10a 100644 --- a/login/updwtmp.c +++ b/login/updwtmp.c @@ -17,11 +17,20 @@ . */ #include +#include +#include #include "utmp-private.h" #ifndef TRANSFORM_UTMP_FILE_NAME -# define TRANSFORM_UTMP_FILE_NAME(file_name) (file_name) +# define TRANSFORM_UTMP_FILE_NAME(file_name) \ + ((strcmp (file_name, _PATH_UTMP "x") == 0 \ + && __access (_PATH_UTMP "x", F_OK) != 0) \ + ? _PATH_UTMP \ + : ((strcmp (file_name, _PATH_WTMP "x") == 0 \ + && __access (_PATH_WTMP "x", F_OK) != 0) \ + ? _PATH_WTMP \ + : file_name)) #endif void diff --git a/sysdeps/gnu/utmpx.h b/login/utmpx.h similarity index 100% rename from sysdeps/gnu/utmpx.h rename to login/utmpx.h diff --git a/sysdeps/gnu/getutmp.c b/sysdeps/gnu/getutmp.c deleted file mode 100644 index 4ce9d65ce0..0000000000 --- a/sysdeps/gnu/getutmp.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (C) 1999-2021 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 -#include -#ifndef _UTMPX_H -/* This is an ugly hack but we must not see the getutmpx declaration. */ -# define getutmpx XXXgetutmpx -# include -# undef getutmpx -#endif - -void -getutmp (const struct utmpx *utmpx, struct utmp *utmp) -{ - assert (sizeof (struct utmp) == sizeof (struct utmpx)); - memcpy (utmp, utmpx, sizeof (struct utmp)); -} -strong_alias (getutmp, getutmpx) diff --git a/sysdeps/gnu/getutmpx.c b/sysdeps/gnu/getutmpx.c deleted file mode 100644 index f393734a63..0000000000 --- a/sysdeps/gnu/getutmpx.c +++ /dev/null @@ -1 +0,0 @@ -/* We don't need a separate version. it is the same as getutmp(). */ diff --git a/sysdeps/gnu/updwtmp.c b/sysdeps/gnu/updwtmp.c deleted file mode 100644 index a1cb93d75d..0000000000 --- a/sysdeps/gnu/updwtmp.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 1998-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Mark Kettenis , 1998. - - 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 - -#define TRANSFORM_UTMP_FILE_NAME(file_name) \ - ((strcmp (file_name, _PATH_UTMP "x") == 0 \ - && __access (_PATH_UTMP "x", F_OK) != 0) \ - ? _PATH_UTMP \ - : ((strcmp (file_name, _PATH_WTMP "x") == 0 \ - && __access (_PATH_WTMP "x", F_OK) != 0) \ - ? _PATH_WTMP \ - : file_name)) - -#include diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c index 5820701f21..6ffea2a553 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c +++ b/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c @@ -16,22 +16,15 @@ License along with the GNU C Library; if not, see . */ -#include -#include -/* This is an ugly hack but we must not see the getutmpx declaration. */ -#define getutmpx XXXgetutmpx -#include -#undef getutmpx +#undef weak_alias +#define weak_alias(a, b) +#undef strong_alias +#define strong_alias(a, b) -#include "utmp-compat.h" +#include -#undef weak_alias -#define weak_alias(n,a) -#define getutmp __getutmp -#define getutmpx __getutmpx -#include "sysdeps/gnu/getutmp.c" -#undef getutmp -#undef getutmpx +#include "utmp-compat.h" default_symbol_version (__getutmp, getutmp, UTMP_COMPAT_BASE); +_strong_alias (__getutmp, __getutmpx) default_symbol_version (__getutmpx, getutmpx, UTMP_COMPAT_BASE); diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c index d4aa0ce2ac..7ef8e85c00 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c +++ b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c @@ -25,7 +25,7 @@ # undef weak_alias # define weak_alias(n,a) #endif -#include "sysdeps/gnu/updwtmp.c" +#include #if defined SHARED default_symbol_version (__updwtmp, updwtmp, UTMP_COMPAT_BASE); From patchwork Fri Mar 5 20:14:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42300 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 257AE399C02E; Fri, 5 Mar 2021 20:15:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 257AE399C02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975347; bh=d3ATAvcm6wwNiIzYIe/Y7ix6EvehC0yWdrSUp8hTgpU=; 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=xTaxKL16Gf7oHQE3vDMUyi53N+IVZ8/h4ygpcY3fLPFpdN7+He1i1XrrKjh/C+Ltb hQ5u6M0FWUsiQ0Z5s8e6udLtF47CFJ0nMLAK6smiijxQV0wUsqZSmY/x3yrD/BxuQz lN2qEDwdCXpd1QNtra6G+D95AAqRNWgc1x6FY1Mg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by sourceware.org (Postfix) with ESMTPS id A0603399C01E for ; Fri, 5 Mar 2021 20:15:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A0603399C01E Received: by mail-qk1-x731.google.com with SMTP id a9so3243412qkn.13 for ; Fri, 05 Mar 2021 12:15:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d3ATAvcm6wwNiIzYIe/Y7ix6EvehC0yWdrSUp8hTgpU=; b=uUk6NmSkmo9fzWs3++/1VQLGFK/FUxFF+LxZXOuzqiAMR/KaRjyy+m1SmmD0usZA9k 7vEirn6gBQ5r7sXws/IuwNo2xKkPoLXZ6RQ7aOJUQIaXUgKkURtAZgbuhtlsxsOgd8yJ tR+8DJAXDgwoKlc7HrnQ+Dhe9I12Igb4ASVPgOZPyGl63Y6OAPu7Ufft+bUxCYVU42ff urixVXdJW1lHKmVtUSKin6nUtt2SRkFewQe3jjer+cwB7LO4ZGnrC1nenWoivYfZLcIi 28uEejfBzrtQYyNxDYjHDZ7dHB5vYgdFuj4daCjTyw2Pi/55VhOrExEbmgquJDkehJC+ qXew== X-Gm-Message-State: AOAM53294SQGiA2CqyRyfvyq9OYBLNJJUQAUxQaLUrj+3RoVJL8En0/q ohmofwLqdltT5STSM0ikAywmGjUgu/SwsQ== X-Google-Smtp-Source: ABdhPJziNhLgXgzI4WmPWCar+xwbWL7U3tK50CkEa4HMUIKH0aSceK13S0sXfybJFjKt/2E8bs97UQ== X-Received: by 2002:a37:9b82:: with SMTP id d124mr10600254qke.489.1614975342769; Fri, 05 Mar 2021 12:15:42 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:42 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 17/52] Consolidate and simplify internal utmp definitions Date: Fri, 5 Mar 2021 17:14:43 -0300 Message-Id: <20210305201518.798584-18-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The TRANSFORM_UTMP_FILE_NAME macro is refactored to the inline function utmp_file_name_time32 and the __utmp_equal function is removed and inlined on its only usage (matches_last_entry at utmp_file.c). Checked with make check run-built-tests=no on all afftected ABIs. --- login/updwtmp.c | 14 +---- sysdeps/gnu/utmp_file.c => login/utmp-path.h | 32 ++++++++---- login/utmp_file.c | 26 ++++++--- manual/users.texi | 4 +- sysdeps/generic/paths.h | 8 +-- sysdeps/generic/utmp-equal.h | 42 --------------- sysdeps/unix/sysv/linux/paths.h | 6 ++- sysdeps/unix/sysv/linux/updwtmp.c | 37 ------------- sysdeps/unix/sysv/linux/utmp-path.h | 55 ++++++++++++++++++++ sysdeps/unix/sysv/linux/utmp_file.c | 37 ------------- 10 files changed, 107 insertions(+), 154 deletions(-) rename sysdeps/gnu/utmp_file.c => login/utmp-path.h (50%) delete mode 100644 sysdeps/generic/utmp-equal.h delete mode 100644 sysdeps/unix/sysv/linux/updwtmp.c create mode 100644 sysdeps/unix/sysv/linux/utmp-path.h delete mode 100644 sysdeps/unix/sysv/linux/utmp_file.c diff --git a/login/updwtmp.c b/login/updwtmp.c index ae67cfc10a..e67a9cf2d9 100644 --- a/login/updwtmp.c +++ b/login/updwtmp.c @@ -21,22 +21,12 @@ #include #include "utmp-private.h" - -#ifndef TRANSFORM_UTMP_FILE_NAME -# define TRANSFORM_UTMP_FILE_NAME(file_name) \ - ((strcmp (file_name, _PATH_UTMP "x") == 0 \ - && __access (_PATH_UTMP "x", F_OK) != 0) \ - ? _PATH_UTMP \ - : ((strcmp (file_name, _PATH_WTMP "x") == 0 \ - && __access (_PATH_WTMP "x", F_OK) != 0) \ - ? _PATH_WTMP \ - : file_name)) -#endif +#include void __updwtmp (const char *wtmp_file, const struct utmp *utmp) { - const char *file_name = TRANSFORM_UTMP_FILE_NAME (wtmp_file); + const char *file_name = utmp_file_name_time32 (wtmp_file); __libc_updwtmp (file_name, utmp); } diff --git a/sysdeps/gnu/utmp_file.c b/login/utmp-path.h similarity index 50% rename from sysdeps/gnu/utmp_file.c rename to login/utmp-path.h index 696fb38fa8..351a932862 100644 --- a/sysdeps/gnu/utmp_file.c +++ b/login/utmp-path.h @@ -1,6 +1,6 @@ -/* Copyright (C) 1998-2021 Free Software Foundation, Inc. +/* Handle {u,w}tmp and {u,w}tmpx file name usage. + Copyright (C) 1998-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Mark Kettenis , 1998. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -16,16 +16,26 @@ License along with the GNU C Library; if not, see . */ +#ifndef _UTMP_PATH_H +#define _UTMP_PATH_H 1 + #include #include -#define TRANSFORM_UTMP_FILE_NAME(file_name) \ - ((strcmp (file_name, _PATH_UTMP "x") == 0 \ - && __access (_PATH_UTMP "x", F_OK) != 0) \ - ? _PATH_UTMP \ - : ((strcmp (file_name, _PATH_WTMP "x") == 0 \ - && __access (_PATH_WTMP "x", F_OK) != 0) \ - ? _PATH_WTMP \ - : file_name)) +/* The function returns the utmp database for 32-bit utmp{x} entries based + on FILE_NAME. If the argument ends with 'x' and the file does not + exits the default old utmp{x} name is returned instead. */ +static inline const char * +utmp_file_name_time32 (const char *file_name) +{ + if (strcmp (file_name, _PATH_UTMP_BASE "x") == 0 + && __access (_PATH_UTMP_BASE "x", F_OK) != 0) + return _PATH_UTMP_BASE; + else if (strcmp (file_name, _PATH_WTMP_BASE "x") == 0 + && __access (_PATH_WTMP_BASE "x", F_OK) != 0) + return _PATH_UTMP_BASE; + + return file_name; +} -#include +#endif /* _UTMP_PATH_H */ diff --git a/login/utmp_file.c b/login/utmp_file.c index 8c0b3a0bb4..377209b26d 100644 --- a/login/utmp_file.c +++ b/login/utmp_file.c @@ -32,7 +32,7 @@ #include #include "utmp-private.h" -#include "utmp-equal.h" +#include /* Descriptor for the file and position. */ @@ -60,7 +60,21 @@ matches_last_entry (const struct utmp *data) return data->ut_type == last_entry.ut_type; else /* For the process-related entries, a full match is needed. */ - return __utmp_equal (&last_entry, data); + return (data->ut_type == INIT_PROCESS + || data->ut_type == LOGIN_PROCESS + || data->ut_type == USER_PROCESS + || data->ut_type == DEAD_PROCESS) + && (last_entry.ut_type == INIT_PROCESS + || last_entry.ut_type == LOGIN_PROCESS + || last_entry.ut_type == USER_PROCESS + || last_entry.ut_type == DEAD_PROCESS) + && (data->ut_id[0] && last_entry.ut_id[0] + ? strncmp (data->ut_id, last_entry.ut_id, + sizeof last_entry.ut_id) + == 0 + : (strncmp (data->ut_line, last_entry.ut_line, + sizeof last_entry.ut_line) + == 0)); } /* Locking timeout. */ @@ -129,10 +143,6 @@ file_unlock (int fd) __fcntl64_nocancel (fd, F_SETLKW, &fl); } -#ifndef TRANSFORM_UTMP_FILE_NAME -# define TRANSFORM_UTMP_FILE_NAME(file_name) (file_name) -#endif - int __libc_setutent (void) { @@ -140,7 +150,7 @@ __libc_setutent (void) { const char *file_name; - file_name = TRANSFORM_UTMP_FILE_NAME (__libc_utmp_file_name); + file_name = utmp_file_name_time32 (__libc_utmp_file_name); file_writable = false; file_fd = __open_nocancel @@ -353,7 +363,7 @@ __libc_pututline (const struct utmp *data) if (! file_writable) { /* We must make the file descriptor writable before going on. */ - const char *file_name = TRANSFORM_UTMP_FILE_NAME (__libc_utmp_file_name); + const char *file_name = utmp_file_name_time32 (__libc_utmp_file_name); int new_fd = __open_nocancel (file_name, O_RDWR | O_LARGEFILE | O_CLOEXEC); diff --git a/manual/users.texi b/manual/users.texi index ec22ce6c1c..dcaca1dcf1 100644 --- a/manual/users.texi +++ b/manual/users.texi @@ -1234,7 +1234,7 @@ over again. @c pututline_unknown @mtasurace:utent @acsfd @c setutent_unknown dup @mtasurace:utent @acsfd @c pututline_file @mtascusig:ALRM @mtascutimer @acsfd -@c TRANSFORM_UTMP_FILE_NAME ok +@c utmp_file_name_time32 ok @c strcmp dup ok @c acesss dup ok @c open_not_cancel_2 dup @acsfd @@ -1427,7 +1427,7 @@ the following function: @standards{SVID, utmp.h} @safety{@prelim{}@mtunsafe{@mtascusig{:ALRM} @mtascutimer{}}@asunsafe{}@acunsafe{@acsfd{}}} @c updwtmp @mtascusig:ALRM @mtascutimer @acsfd -@c TRANSFORM_UTMP_FILE_NAME dup ok +@c utmp_file_name_time32 dup ok @c *libc_utmp_file_functions->updwtmp = updwtmp_file @mtascusig:ALRM @mtascutimer @acsfd @c open_not_cancel_2 dup @acsfd @c LOCK_FILE dup @mtascusig:ALRM @mtascutimer diff --git a/sysdeps/generic/paths.h b/sysdeps/generic/paths.h index 893b4c2286..99a791ce31 100644 --- a/sysdeps/generic/paths.h +++ b/sysdeps/generic/paths.h @@ -60,10 +60,12 @@ #define _PATH_SHELLS "/etc/shells" #define _PATH_TTY "/dev/tty" #define _PATH_UNIX "/vmunix" -#define _PATH_UTMP "/var/run/utmp" -#define _PATH_UTMP_DB "/var/run/utmp.db" +#define _PATH_UTMP_BASE "/var/run/utmp" +#define _PATH_UTMP _PATH_UTMP_BASE +#define _PATH_UTMP_DB _PATH_UTMP_BASE ".db" #define _PATH_VI "/usr/bin/vi" -#define _PATH_WTMP "/var/log/wtmp" +#define _PATH_WTMP_BASE "/var/log/wtmp" +#define _PATH_WTMP _PATH_WTMP_BASE /* Provide trailing slash, since mostly used for building pathnames. */ #define _PATH_DEV "/dev/" diff --git a/sysdeps/generic/utmp-equal.h b/sysdeps/generic/utmp-equal.h deleted file mode 100644 index b1c4f008b9..0000000000 --- a/sysdeps/generic/utmp-equal.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Helper function for utmp functions to see if two entries are equal. - Copyright (C) 1996-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper - and Paul Janzen , 1996. - - 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 - -#include "utmp-private.h" - -/* Test whether two entries match. */ -static int -__utmp_equal (const struct utmp *entry, const struct utmp *match) -{ - return (entry->ut_type == INIT_PROCESS - || entry->ut_type == LOGIN_PROCESS - || entry->ut_type == USER_PROCESS - || entry->ut_type == DEAD_PROCESS) - && (match->ut_type == INIT_PROCESS - || match->ut_type == LOGIN_PROCESS - || match->ut_type == USER_PROCESS - || match->ut_type == DEAD_PROCESS) - && (entry->ut_id[0] && match->ut_id[0] - ? strncmp (entry->ut_id, match->ut_id, sizeof match->ut_id) == 0 - : (strncmp (entry->ut_line, match->ut_line, sizeof match->ut_line) - == 0)); -} diff --git a/sysdeps/unix/sysv/linux/paths.h b/sysdeps/unix/sysv/linux/paths.h index 1342ab3a96..3b8aeab788 100644 --- a/sysdeps/unix/sysv/linux/paths.h +++ b/sysdeps/unix/sysv/linux/paths.h @@ -61,9 +61,11 @@ #define _PATH_SHELLS "/etc/shells" #define _PATH_TTY "/dev/tty" #define _PATH_UNIX "/boot/vmlinux" -#define _PATH_UTMP "/var/run/utmp" +#define _PATH_UTMP_BASE "/var/run/utmp" +#define _PATH_UTMP _PATH_UTMP_BASE #define _PATH_VI "/usr/bin/vi" -#define _PATH_WTMP "/var/log/wtmp" +#define _PATH_WTMP_BASE "/var/log/wtmp" +#define _PATH_WTMP _PATH_WTMP_BASE /* Provide trailing slash, since mostly used for building pathnames. */ #define _PATH_DEV "/dev/" diff --git a/sysdeps/unix/sysv/linux/updwtmp.c b/sysdeps/unix/sysv/linux/updwtmp.c deleted file mode 100644 index 93d72e75a6..0000000000 --- a/sysdeps/unix/sysv/linux/updwtmp.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 1998-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Mark Kettenis , 1998. - - 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 - -#define TRANSFORM_UTMP_FILE_NAME(file_name) \ - ((strcmp (file_name, _PATH_UTMP) == 0 \ - && __access (_PATH_UTMP "x", F_OK) == 0) \ - ? (_PATH_UTMP "x") \ - : ((strcmp (file_name, _PATH_WTMP) == 0 \ - && __access ( _PATH_WTMP "x", F_OK) == 0) \ - ? (_PATH_WTMP "x") \ - : ((strcmp (file_name, _PATH_UTMP "x") == 0 \ - && __access (_PATH_UTMP "x", F_OK) != 0) \ - ? _PATH_UTMP \ - : ((strcmp (file_name, _PATH_WTMP "x") == 0 \ - && __access (_PATH_WTMP "x", F_OK) != 0) \ - ? _PATH_WTMP \ - : file_name)))) - -#include diff --git a/sysdeps/unix/sysv/linux/utmp-path.h b/sysdeps/unix/sysv/linux/utmp-path.h new file mode 100644 index 0000000000..f39222d62f --- /dev/null +++ b/sysdeps/unix/sysv/linux/utmp-path.h @@ -0,0 +1,55 @@ +/* Handle {u,w}tmp and {u,w}tmpx file name usage. + Copyright (C) 1998-2021 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 + . */ + +#ifndef _UTMP_PATH_H +#define _UTMP_PATH_H 1 + +#include +#include + + +/* The function returns the utmp database for 32-bit utmp{x} entries based + on FILE_NAME: + + - if the default {x,w}utmp name is used but a file name ending with 'x' + exists it is returned instead + + - if the argument ends with 'x' and the file is not accessible the default + {x,w}utmp is returned instead. + + - if neither 1. nor 2. applies, the FILE_NAME is returned instead. */ +static inline const char * +utmp_file_name_time32 (const char *file_name) +{ + if (strcmp (file_name, _PATH_UTMP_BASE) == 0 + && __access (_PATH_UTMP_BASE "x", F_OK) == 0) + return _PATH_UTMP_BASE "x"; + else if (strcmp (file_name, _PATH_WTMP_BASE) == 0 + && __access (_PATH_WTMP_BASE "x", F_OK) == 0) + return _PATH_WTMP_BASE "x"; + else if (strcmp (file_name, _PATH_UTMP_BASE "x") == 0 + && __access (_PATH_UTMP_BASE "x", F_OK) != 0) + return _PATH_UTMP_BASE; + else if (strcmp (file_name, _PATH_WTMP_BASE "x") == 0 + && __access (_PATH_WTMP_BASE "x", F_OK) != 0) + return _PATH_WTMP_BASE; + + return file_name; +} + +#endif /* _UTMP_PATH_H */ diff --git a/sysdeps/unix/sysv/linux/utmp_file.c b/sysdeps/unix/sysv/linux/utmp_file.c deleted file mode 100644 index 78d10db8c8..0000000000 --- a/sysdeps/unix/sysv/linux/utmp_file.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 1998-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Mark Kettenis , 1998. - - 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 - -#define TRANSFORM_UTMP_FILE_NAME(file_name) \ - ((strcmp (file_name, _PATH_UTMP) == 0 \ - && __access (_PATH_UTMP "x", F_OK) == 0) \ - ? (_PATH_UTMP "x") \ - : ((strcmp (file_name, _PATH_WTMP) == 0 \ - && __access ( _PATH_WTMP "x", F_OK) == 0) \ - ? (_PATH_WTMP "x") \ - : ((strcmp (file_name, _PATH_UTMP "x") == 0 \ - && __access (_PATH_UTMP "x", F_OK) != 0) \ - ? _PATH_UTMP \ - : ((strcmp (file_name, _PATH_WTMP "x") == 0 \ - && __access (_PATH_WTMP "x", F_OK) != 0) \ - ? _PATH_WTMP \ - : file_name)))) - -#include From patchwork Fri Mar 5 20:14:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42299 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 9694E399C02A; Fri, 5 Mar 2021 20:15:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9694E399C02A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975346; bh=DFc92L40JDRdAlfuvzLefh2174ou269jlR3ufwTVj0I=; 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=rCPhv+Kp1zUz4+SLR3+G0kjHitcxv+zUrWjhJ7go023SkQf1KjEKi39WfpJir58Rb 8r0J175o0zP9ztdkdIYAM0sLDcij8DHZXE8qdePySLZwBF/OZ5N023tykmL2jhzEtJ h43kf20P/vcD0vS4WRRvTnlNHG5ePM/lltKDR2IU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id 92ACD382D435 for ; Fri, 5 Mar 2021 20:15:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 92ACD382D435 Received: by mail-qt1-x836.google.com with SMTP id h9so2760246qtq.7 for ; Fri, 05 Mar 2021 12:15:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DFc92L40JDRdAlfuvzLefh2174ou269jlR3ufwTVj0I=; b=LoijWdOgSQYTtnhtaCpC70UINISD22dzS/DY6zVdXsmK5z4vO15Tx9rxq1503qvWOz RwMIq3L/suNYE0LOzMIktw8hsT/5AhpUjqeEeqUKErG+wcuhuTKH07uc+M7drEWgTMJx NWyfCTTP3W11BCDc3CrDrhxBsB8VyFABP4/fjZ3KUal/OMz+65YsS28F223KNPOEXCi6 q8cVxv0exEVUGHp9TxVsG6upEy6JBYoQhDdTepX3Rl6ofa5gQpBmssnG+/mwqL28hoWA W+YLgNyZddgFGOqmHGruMXTNTmyZ9OhSY5NoKx5/QUJp77aKKH9HUwpG+6pw/m7onWJ3 SgZQ== X-Gm-Message-State: AOAM532DCS44hKIUdA8jaaflSJyOzfV03/tcsaVEGGFaVNa+S5bQPycR Fu4SJIIMswii//P50lmBGIreeQqJ0thPSw== X-Google-Smtp-Source: ABdhPJzJNjF1b5FhLyHLBeZ7/v8jHDwz77uSr/1H9bYQnjEMRhSJRD+TALY7uX08KDTdmD+DAqRIrA== X-Received: by 2002:ac8:4710:: with SMTP id f16mr3493754qtp.165.1614975344048; Fri, 05 Mar 2021 12:15:44 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:43 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 18/52] support: Add 'touch' command Date: Fri, 5 Mar 2021 17:14:44 -0300 Message-Id: <20210305201518.798584-19-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It allow creates empty files with an specific mode. --- support/test-container.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/support/test-container.c b/support/test-container.c index 28cc44d9f1..0d85bfb357 100644 --- a/support/test-container.c +++ b/support/test-container.c @@ -104,6 +104,7 @@ int verbose = 0; cwd PATH exec FILE mkdirp MODE DIR + touch MODE FILE variables: $B/ build dir, equivalent to $(common-objpfx) @@ -129,6 +130,7 @@ int verbose = 0; - 'cwd': set test working directory - 'exec': change test binary location (may end in /) - 'mkdirp': A minimal "mkdir -p FILE" command. + - 'touch': A minimal 'touch' command to create empty files. * mytest.root/postclean.req causes fresh rsync (with delete) after test if present @@ -1018,6 +1020,15 @@ main (int argc, char **argv) TEST_COMPARE (errno, 0); xmkdirp (the_words[2], m); } + else if (nt == 3 && strcmp (the_words[0], "touch") == 0) + { + long int m; + errno = 0; + m = strtol (the_words[1], NULL, 0); + TEST_COMPARE (errno, 0); + + xclose (xopen (the_words[2], O_WRONLY | O_TRUNC | O_CREAT, m)); + } else if (nt > 0 && the_words[0][0] != '#') { fprintf (stderr, "\033[31minvalid [%s]\033[0m\n", the_words[0]); From patchwork Fri Mar 5 20:14:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42301 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 3D01C399C034; Fri, 5 Mar 2021 20:15:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D01C399C034 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975348; bh=mgfKBAPGLXEa9oY6OHVGqh5VKmcvjDDIEBIglONCiXs=; 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=ojp2UXAk5ZhAHLoTbsCp6f3yibVS+PSTsy+1XrxjnCRdnvljQYVwr04U26ml5xMDx o6+rD4wc6nCquHVtRfifssBzhZXd1J9GZDtfF8vQeoDk0SfDdPtSgDVmap28gQCTul xO+FgRz0TIo0X/o4eMade/wZmbSdZRDHxDLgXbek= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by sourceware.org (Postfix) with ESMTPS id C0054399C029 for ; Fri, 5 Mar 2021 20:15:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C0054399C029 Received: by mail-qv1-xf2e.google.com with SMTP id gi9so1616020qvb.10 for ; Fri, 05 Mar 2021 12:15:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mgfKBAPGLXEa9oY6OHVGqh5VKmcvjDDIEBIglONCiXs=; b=YwElbsbbM7QUtC+6LMvctY7wD7ZJyg71hwWFqNjkYmnOktatzwU4SIYlkxlkjpKg7n G/2SQQNIP9g/gn4JClBlaszI2yiqvtFKevNaosAcxXemzVICu4wPH7pUI4LJJLrZPF1c E5Ft/9wEqwtK3CRrSGLQJWHh1L7UMoq/dKoiJ8WLADmf7tvu7ZDHQJSf11V5UPNVCike Xm0LoDDbb1lyq+CQJbBsNlOfNWi/mQdHieAMjleTM3mw9UFFeZjTZcUFsnMV38y5TQKK 1mY77gdjNaAKaotuoHqCqhvUQ+EOv67x7jfzhysdHcAwstoDh/GL2i9Ve0FFYNYxMEcH /0pA== X-Gm-Message-State: AOAM531SiGCSL8lEyQINFPXsxEPVKxwzM7uIeCEAaAz5ynZKtjJTKbYQ YSCq+FvBmswkd5J7XEuHypv5GZlGw/TTnA== X-Google-Smtp-Source: ABdhPJxpcoGzeXIMOACs45h/RWIciNJ3d/4iFya8PkE2+wdEPBzgwbts1UlRDa9AchvOfmizcwiPsA== X-Received: by 2002:a0c:c1cc:: with SMTP id v12mr10206630qvh.47.1614975345112; Fri, 05 Mar 2021 12:15:45 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:44 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 19/52] Add tests-container-internal rules Date: Fri, 5 Mar 2021 17:14:45 -0300 Message-Id: <20210305201518.798584-20-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It is similar to test-container, but build with -MODULE_NAME=nonlib (similar to test-internal). --- Makefile | 2 +- Makerules | 3 ++- Rules | 12 +++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 50f99ca611..71c7d8b5ec 100644 --- a/Makefile +++ b/Makefile @@ -589,7 +589,7 @@ else LINKS_DSO_PROGRAM = links-dso-program endif -$(tests-container) $(addsuffix /tests,$(subdirs)) : \ +$(tests-container) $(tests-container-internal) $(addsuffix /tests,$(subdirs)) : \ $(objpfx)testroot.pristine/install.stamp $(objpfx)testroot.pristine/install.stamp : test -d $(objpfx)testroot.pristine || \ diff --git a/Makerules b/Makerules index ca9885436e..fc5251ffad 100644 --- a/Makerules +++ b/Makerules @@ -1290,7 +1290,7 @@ xcheck: xtests # that almost all internal declarations from config.h, libc-symbols.h, and # include/*.h are not available to 'testsuite' code, but are to 'nonlib' code. all-testsuite := $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) \ - $(tests-container)) + $(tests-container) $(tests-container-internal)) ifneq (,$(all-testsuite)) cpp-srcs-left = $(all-testsuite) lib := testsuite @@ -1298,6 +1298,7 @@ include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left)) endif all-nonlib := $(strip $(tests-internal) $(test-internal-extras) \ + $(tests-container-internal) \ $(others) $(others-extras)) ifneq (,$(all-nonlib)) cpp-srcs-left = $(all-nonlib) diff --git a/Rules b/Rules index 082625bb71..67c6f009e4 100644 --- a/Rules +++ b/Rules @@ -148,13 +148,15 @@ others: $(py-const) ifeq ($(run-built-tests),no) tests: $(addprefix $(objpfx),$(filter-out $(tests-unsupported), \ $(tests) $(tests-internal) \ - $(tests-container)) \ + $(tests-container) \ + $(tests-container-internal)) \ $(test-srcs)) $(tests-special) \ $(tests-printers-programs) xtests: tests $(xtests-special) else tests: $(tests:%=$(objpfx)%.out) $(tests-internal:%=$(objpfx)%.out) \ $(tests-container:%=$(objpfx)%.out) \ + $(tests-container-internal:%=$(objpfx)%.out) \ $(tests-mcheck:%=$(objpfx)%-mcheck.out) \ $(tests-special) $(tests-printers-out) xtests: tests $(xtests:%=$(objpfx)%.out) $(xtests-special) @@ -166,7 +168,7 @@ ifeq ($(run-built-tests),no) tests-expected = else tests-expected = $(tests) $(tests-internal) $(tests-printers) \ - $(tests-container) $(tests-mcheck:%=%-mcheck) + $(tests-container) $(tests-container-internal) $(tests-mcheck:%=%-mcheck) endif tests: $(..)scripts/merge-test-results.sh -s $(objpfx) $(subdir) \ @@ -180,7 +182,7 @@ xtests: ifeq ($(build-programs),yes) binaries-all-notests = $(others) $(sysdep-others) binaries-all-tests = $(tests) $(tests-internal) $(xtests) $(test-srcs) \ - $(tests-container) + $(tests-container) $(tests-container-internal) binaries-all = $(binaries-all-notests) $(binaries-all-tests) binaries-static-notests = $(others-static) binaries-static-tests = $(tests-static) $(xtests-static) @@ -289,8 +291,8 @@ $(objpfx)%.out: /dev/null $(objpfx)% # Make it 2nd arg for canned sequence. # Any tests that require an isolated container (filesystem, network # and pid namespaces) in which to run, should be added to -# tests-container. -$(tests-container:%=$(objpfx)%.out): $(objpfx)%.out : $(if $(wildcard $(objpfx)%.files),$(objpfx)%.files,/dev/null) $(objpfx)% +# tests-container or tests-container-internal. +$(tests-container:%=$(objpfx)%.out) $(tests-container-internal:%=$(objpfx)%.out): $(objpfx)%.out : $(if $(wildcard $(objpfx)%.files),$(objpfx)%.files,/dev/null) $(objpfx)% $(test-wrapper-env) $(run-program-env) $(run-via-rtld-prefix) \ $(common-objpfx)support/test-container env $(run-program-env) $($*-ENV) \ $(host-test-program-cmd) $($*-ARGS) > $@; \ From patchwork Fri Mar 5 20:14:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42313 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 2D452399F015; Fri, 5 Mar 2021 20:16:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D452399F015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975365; bh=S/wXb0l2rCwcGUcxapubwbzqq4RLHVm3nF007GRRVi0=; 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=nSMd1F9Br1dHpHvp4wZC4EfFgQ0UdJmKgzJ53wAFvZewuYG+XzL7pvui9+yTyt+if K77BSzmW8OcduaIJRpiPsQddC7m2cezd4WoA3hp1iLnvNdXl2wIN3k+sgRu8FJ16le k/I8YpSlrxxgMVwl59LbnxX3fIC/aD3cVzPqsb1Y= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by sourceware.org (Postfix) with ESMTPS id 86722382D438 for ; Fri, 5 Mar 2021 20:15:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 86722382D438 Received: by mail-qv1-xf35.google.com with SMTP id gi9so1616123qvb.10 for ; Fri, 05 Mar 2021 12:15:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S/wXb0l2rCwcGUcxapubwbzqq4RLHVm3nF007GRRVi0=; b=XB2yU9gM+AcOSkRU5eOyLrRQcz/OqPavm1pFe1cdyBkCds4AXgYmzWSB//wHtC8AtI h/jKiow80GJtT9WFh4PTqjWrCxZkaYqp5I4fow/wboLcs6pFQlKDZw/5rwmtmJ1Fmt/J 6Oe6fRJZxRFar6/iXo7G5GDC8CADeqXDexPEBQZanyhwNirZSUGACd9C4nNwdG/qesis /78/BrOSElp/5Nzz09ZapOObYObghAzWnHhPxErKHJ7Yx+wiIVc8+bqMF49RNd4fJE0Y FnkIcoAwk6epzuNZFO3H4Rb7BvMVRUuD7fn/0csDnpvGgAHN5DOq7JYP2i2cs0ho2YT4 m7NA== X-Gm-Message-State: AOAM533lm0tUTsKq6cgg7aPQ2YOqAEoxXaaBHhETSaPfuk0tkdu5Jg2O 3EocgdjngqRYdX8XTTuHazY7v9wQm/G9Ew== X-Google-Smtp-Source: ABdhPJxO6ppQdAhD1OovInHqn3n7w0N10bkxL6vm7pacxHx6c9LSSzPHaIq12R8X5ToqAAdNah2QRQ== X-Received: by 2002:a0c:b9a2:: with SMTP id v34mr10384957qvf.17.1614975347098; Fri, 05 Mar 2021 12:15:47 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:46 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 20/52] login: Add 64-bit time support to utmp/utmpx Date: Fri, 5 Mar 2021 17:14:46 -0300 Message-Id: <20210305201518.798584-21-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The new struct has the same size for 32-bit and 64-bit architecture with two main differences compared to the 32-bit time one: 1. ut_session is now 64-bit and it is mainly to set the ut_tv member alignment to be similar on both 32-bit and 64-bit architecture (for architectures that support multiple ABIs with different wordsize, such as x86 and powerpc). 2. The internal tv_sec and tv_usec for ut_tv are now 64-bit. Although it does not fully fix BZ#17470 nor BZ#18235, it might allow define the type as 'struct timeval' for __TIMESIZE=64 (thus fixing the aforementioned bug in this build configuration). Different than laid out on the Y2038 Proofness Design [1], the 'utmp.trans' strategy is not used. Instead: - New file names are defined for _PATH_UTMP, _PATH_WTMP, and _PATH_UTMP_DB (if applicable) and used as default for the new 2.34 utmp{x} symbols. - The new utmp{x} symbols read/write 64-bit time_t entries as default. However if the old _PATH_UTMP or _PATH_WTMP is passed on utm{x}pname or updwtmp, the implementation read 32-bit utmp{x} entries and convert it to 64-bit ones. - The compat symbols read/write 32-bit time_t entries as default. If the default _PATH_UTMP or _PATH_WTMP is passed on utm{x}pname or updwtmp, the implementation reads 64-bit entries and convert to 32-bit ones. The idea is not to maintain multiple databases with different formats (which has underlying issues due to complexity, how to handle entries that might overflow, and increases the security surface of BZ#24492), but rather to move new application to use y2038 entries (which currently affects 64-bit architecture as well, modulo s390). If required the system might provide a tool to convert the old format to newer one by opening the old file with utmpname and copying the entries to the new format with updwtmp. Also, for new 64-bit databases the path is not redirected to use the utmpx one depending of the file existance (utmp_file_name_time32). This is undocumented behavior most likely added be compatible with Solaris (which defines different utmp dabases for utmpx files). The s390 is an outlier: the 31-bit ABI added 64-bit time support on GLIBC 2.8 and 64-bit has support since its inclusion. The s390 ABI follows the above design, but with a different ABI base version (2.8 vs 2.34). The s390x instead does not have support to read/write 32-bit registers and does not provide compat symbols. Checked on x86_64-linux-gnu and i686-linux-gnu. [1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign#utmp_types_and_APIs --- bits/types/struct_utmp.h | 12 +- bits/types/struct_utmpx.h | 11 +- include/utmp.h | 5 +- login/Makefile | 9 +- login/Versions | 24 + login/getutent.c | 7 +- login/getutent_r.c | 48 +- login/getutid.c | 7 +- login/getutid_r.c | 33 +- login/getutline.c | 7 +- login/getutline_r.c | 33 +- login/getutmp.c | 10 +- login/getutxent.c | 9 +- login/getutxid.c | 9 +- login/getutxline.c | 9 +- login/login.c | 10 +- .../linux/s390/s390-32 => login}/login32.c | 16 +- login/pututxline.c | 9 +- login/tst-utmp-default.c | 292 +++++++++++ .../tst-utmp-default.script | 10 + login/tst-utmp32.c | 318 ++++++++++++ login/tst-utmp32.root/tst-utmp32.script | 7 + login/updwtmp.c | 25 +- login/updwtmpx.c | 9 +- .../utmp-convert.h => login/utmp-convert.c | 59 +-- .../getutent.c => login/utmp-convert.h | 28 +- login/utmp-path.h | 2 +- login/utmp-private.h | 24 +- login/utmp32.c | 247 ++++++++++ .../linux/s390/s390-32 => login}/utmp32.h | 9 + login/utmp_file.c | 459 +++++++++++------- login/utmpname.c | 8 + login/utmpx32.c | 112 +++++ .../linux/s390/s390-32 => login}/utmpx32.h | 6 +- sysdeps/generic/paths.h | 7 +- sysdeps/generic/utmp-compat.h | 3 + sysdeps/mach/hurd/i386/libc.abilist | 15 + sysdeps/mach/hurd/i386/libutil.abilist | 1 + sysdeps/unix/sysv/linux/aarch64/libc.abilist | 15 + .../unix/sysv/linux/aarch64/libutil.abilist | 1 + sysdeps/unix/sysv/linux/alpha/libc.abilist | 15 + sysdeps/unix/sysv/linux/alpha/libutil.abilist | 1 + sysdeps/unix/sysv/linux/arc/libc.abilist | 15 + sysdeps/unix/sysv/linux/arc/libutil.abilist | 1 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 15 + .../unix/sysv/linux/arm/be/libutil.abilist | 1 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 15 + .../unix/sysv/linux/arm/le/libutil.abilist | 1 + sysdeps/unix/sysv/linux/csky/libc.abilist | 15 + sysdeps/unix/sysv/linux/csky/libutil.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 15 + sysdeps/unix/sysv/linux/hppa/libutil.abilist | 1 + sysdeps/unix/sysv/linux/i386/libc.abilist | 15 + sysdeps/unix/sysv/linux/i386/libutil.abilist | 1 + sysdeps/unix/sysv/linux/ia64/libc.abilist | 15 + sysdeps/unix/sysv/linux/ia64/libutil.abilist | 1 + .../sysv/linux/m68k/coldfire/libc.abilist | 15 + .../sysv/linux/m68k/coldfire/libutil.abilist | 1 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 15 + .../sysv/linux/m68k/m680x0/libutil.abilist | 1 + .../sysv/linux/microblaze/be/libc.abilist | 15 + .../sysv/linux/microblaze/be/libutil.abilist | 1 + .../sysv/linux/microblaze/le/libc.abilist | 15 + .../sysv/linux/microblaze/le/libutil.abilist | 1 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 15 + .../sysv/linux/mips/mips32/libutil.abilist | 1 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 15 + .../sysv/linux/mips/mips64/libutil.abilist | 1 + .../sysv/linux/mips/mips64/n32/libc.abilist | 15 + .../sysv/linux/mips/mips64/n64/libc.abilist | 15 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 15 + sysdeps/unix/sysv/linux/nios2/libutil.abilist | 1 + sysdeps/unix/sysv/linux/paths.h | 5 +- .../linux/powerpc/powerpc32/fpu/libc.abilist | 15 + .../linux/powerpc/powerpc32/libutil.abilist | 1 + .../powerpc/powerpc32/nofpu/libc.abilist | 15 + .../linux/powerpc/powerpc64/be/libc.abilist | 15 + .../powerpc/powerpc64/be/libutil.abilist | 1 + .../linux/powerpc/powerpc64/le/libc.abilist | 15 + .../powerpc/powerpc64/le/libutil.abilist | 1 + .../unix/sysv/linux/riscv/rv32/libc.abilist | 15 + .../sysv/linux/riscv/rv32/libutil.abilist | 1 + .../unix/sysv/linux/riscv/rv64/libc.abilist | 15 + .../sysv/linux/riscv/rv64/libutil.abilist | 1 + .../unix/sysv/linux/s390/s390-32/getutent_r.c | 38 -- .../unix/sysv/linux/s390/s390-32/getutid.c | 32 -- .../unix/sysv/linux/s390/s390-32/getutid_r.c | 35 -- .../unix/sysv/linux/s390/s390-32/getutline.c | 32 -- .../sysv/linux/s390/s390-32/getutline_r.c | 34 -- .../unix/sysv/linux/s390/s390-32/getutmp.c | 30 -- .../unix/sysv/linux/s390/s390-32/getutxent.c | 30 -- .../unix/sysv/linux/s390/s390-32/getutxid.c | 30 -- .../unix/sysv/linux/s390/s390-32/getutxline.c | 30 -- sysdeps/unix/sysv/linux/s390/s390-32/login.c | 35 -- .../unix/sysv/linux/s390/s390-32/pututxline.c | 30 -- .../unix/sysv/linux/s390/s390-32/updwtmp.c | 32 -- .../unix/sysv/linux/s390/s390-32/updwtmpx.c | 30 -- .../sysv/linux/s390/s390-32/utmp-compat.h | 2 +- sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c | 184 ------- .../sysv/linux/s390/s390-32/utmpx-convert.h | 85 ---- .../unix/sysv/linux/s390/s390-32/utmpx32.c | 139 ------ .../sysv/linux/s390/s390-64/utmp-compat.h | 3 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 15 + sysdeps/unix/sysv/linux/sh/be/libutil.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 15 + sysdeps/unix/sysv/linux/sh/le/libutil.abilist | 1 + .../sysv/linux/sparc/sparc32/libc.abilist | 15 + .../sysv/linux/sparc/sparc32/libutil.abilist | 1 + .../sysv/linux/sparc/sparc64/libc.abilist | 15 + .../sysv/linux/sparc/sparc64/libutil.abilist | 1 + sysdeps/unix/sysv/linux/utmp-path.h | 3 +- .../unix/sysv/linux/x86_64/64/libc.abilist | 15 + .../unix/sysv/linux/x86_64/64/libutil.abilist | 1 + .../unix/sysv/linux/x86_64/x32/libc.abilist | 15 + .../sysv/linux/x86_64/x32/libutil.abilist | 1 + 115 files changed, 2108 insertions(+), 1117 deletions(-) rename {sysdeps/unix/sysv/linux/s390/s390-32 => login}/login32.c (72%) create mode 100644 login/tst-utmp-default.c create mode 100644 login/tst-utmp-default.root/tst-utmp-default.script create mode 100644 login/tst-utmp32.c create mode 100644 login/tst-utmp32.root/tst-utmp32.script rename sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h => login/utmp-convert.c (58%) rename sysdeps/unix/sysv/linux/s390/s390-32/getutent.c => login/utmp-convert.h (59%) create mode 100644 login/utmp32.c rename {sysdeps/unix/sysv/linux/s390/s390-32 => login}/utmp32.h (78%) create mode 100644 login/utmpx32.c rename {sysdeps/unix/sysv/linux/s390/s390-32 => login}/utmpx32.h (93%) create mode 100644 sysdeps/generic/utmp-compat.h delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutid.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutline.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/login.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/utmp-compat.h diff --git a/bits/types/struct_utmp.h b/bits/types/struct_utmp.h index 76529ea62f..5f0d1cf822 100644 --- a/bits/types/struct_utmp.h +++ b/bits/types/struct_utmp.h @@ -38,18 +38,16 @@ struct utmp /* The ut_session and ut_tv fields must be the same size when compiled 32- and 64-bit. This allows data files and shared memory to be shared between 32- and 64-bit applications. */ -#if __WORDSIZE_TIME64_COMPAT32 - int32_t ut_session; /* Session ID, used for windowing. */ + int64_t ut_session; /* Session ID, used for windowing. */ +#if __TIMESIZE != 64 struct { - int32_t tv_sec; /* Seconds. */ - int32_t tv_usec; /* Microseconds. */ + int64_t tv_sec; /* Seconds. */ + int64_t tv_usec; /* Microseconds. */ } ut_tv; /* Time entry was made. */ #else - long int ut_session; /* Session ID, used for windowing. */ struct timeval ut_tv; /* Time entry was made. */ #endif - int32_t ut_addr_v6[4]; /* Internet address of remote host. */ - char __glibc_reserved[20]; /* Reserved for future use. */ + char __glibc_reserved[8]; /* Reserved for future use. */ }; diff --git a/bits/types/struct_utmpx.h b/bits/types/struct_utmpx.h index 8d6db50c06..d3be1ee1ed 100644 --- a/bits/types/struct_utmpx.h +++ b/bits/types/struct_utmpx.h @@ -39,17 +39,16 @@ struct utmpx /* The fields ut_session and ut_tv must be the same size when compiled 32- and 64-bit. This allows files and shared memory to be shared between 32- and 64-bit applications. */ -#if __WORDSIZE_TIME64_COMPAT32 - __int32_t ut_session; /* Session ID, used for windowing. */ + __int64_t ut_session; /* Session ID, used for windowing. */ +#if __TIMESIZE != 64 struct { - __int32_t tv_sec; /* Seconds. */ - __int32_t tv_usec; /* Microseconds. */ + __int64_t tv_sec; /* Seconds. */ + __int64_t tv_usec; /* Microseconds. */ } ut_tv; /* Time entry was made. */ #else - long int ut_session; /* Session ID, used for windowing. */ struct timeval ut_tv; /* Time entry was made. */ #endif __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ - char __glibc_reserved[20]; /* Reserved for future use. */ + char __glibc_reserved[8]; /* Reserved for future use. */ }; diff --git a/include/utmp.h b/include/utmp.h index 374184e9b2..7a205c13e2 100644 --- a/include/utmp.h +++ b/include/utmp.h @@ -9,7 +9,7 @@ libc_hidden_proto (__updwtmp) extern int __utmpname (const char *__file) attribute_hidden; extern struct utmp *__getutent (void); libc_hidden_proto (__getutent) -extern void __setutent (void) attribute_hidden; +extern void __setutent (void); extern void __endutent (void) attribute_hidden; extern struct utmp *__getutid (const struct utmp *__id); libc_hidden_proto (__getutid) @@ -26,6 +26,9 @@ extern int __getutline_r (const struct utmp *__line, struct utmp *__buffer, struct utmp **__result); libc_hidden_proto (__getutline_r) +extern void __login (const struct utmp *ut); +hidden_proto (__login) + libutil_hidden_proto (login_tty) # endif /* !_ISOMAC */ diff --git a/login/Makefile b/login/Makefile index 5e2cb1da06..794d061604 100644 --- a/login/Makefile +++ b/login/Makefile @@ -31,7 +31,7 @@ headers := utmp.h bits/utmp.h lastlog.h pty.h \ routines := getlogin getlogin_r setlogin getlogin_r_chk \ getutent getutent_r getutid getutline getutid_r getutline_r \ utmp_file utmpname updwtmp getpt grantpt unlockpt ptsname \ - ptsname_r_chk + ptsname_r_chk utmp32 utmpx32 utmp-convert CFLAGS-grantpt.c += -DLIBEXECDIR='"$(libexecdir)"' @@ -49,11 +49,16 @@ vpath %.c programs tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \ tst-pututxline-lockfail tst-pututxline-cache +ifeq ($(have-GLIBC_2.33),yes) +tests-container-internal := tst-utmp32 +tests-container := tst-utmp-default +endif + # Build the -lutil library with these extra functions. extra-libs := libutil extra-libs-others := $(extra-libs) -libutil-routines:= login login_tty logout logwtmp openpty forkpty +libutil-routines:= login login_tty logout logwtmp openpty forkpty login32 include ../Rules diff --git a/login/Versions b/login/Versions index 475fcf063f..d28ecdca9f 100644 --- a/login/Versions +++ b/login/Versions @@ -45,10 +45,34 @@ libc { __getlogin_r_chk; __ptsname_r_chk; } + GLIBC_2.34 { + getutent; + getutent_r; + getutid; + getutid_r; + getutline; + getutline_r; + getutmp; + getutmpx; + getutxent; + getutxid; + getutxline; + pututline; + pututxline; + updwtmp; + updwtmpx; + } + GLIBC_PRIVATE { + # Used on compat login from libutil. + __utmp_convert32to64; + } } libutil { GLIBC_2.0 { forkpty; login; login_tty; logout; logwtmp; openpty; } + GLIBC_2.34 { + login; + } } diff --git a/login/getutent.c b/login/getutent.c index c2428bfb3e..57cbe76506 100644 --- a/login/getutent.c +++ b/login/getutent.c @@ -18,7 +18,8 @@ #include #include - +#include +#include /* Local buffer to store the result. */ libc_freeres_ptr (static struct utmp *buffer); @@ -42,4 +43,8 @@ __getutent (void) return result; } libc_hidden_def (__getutent) +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __getutent, getutent, UTMP_COMPAT_BASE); +#else weak_alias (__getutent, getutent) +#endif diff --git a/login/getutent_r.c b/login/getutent_r.c index 0af48acec8..72e9e0d070 100644 --- a/login/getutent_r.c +++ b/login/getutent_r.c @@ -20,8 +20,11 @@ #include #include #include +#include +#include +#include +#include -#include "utmp-private.h" /* We need to protect the opening of the file. */ __libc_lock_define_initialized (, __libc_utmp_lock attribute_hidden) @@ -32,7 +35,12 @@ __setutent (void) { __libc_lock_lock (__libc_utmp_lock); - __libc_setutent (); +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) + if (__libc_utmpname_mode == UTMPNAME_TIME32) + __libc_setutent32 (); + else +#endif + __libc_setutent (); __libc_lock_unlock (__libc_utmp_lock); } @@ -46,14 +54,32 @@ __getutent_r (struct utmp *buffer, struct utmp **result) __libc_lock_lock (__libc_utmp_lock); - retval = __libc_getutent_r (buffer, result); +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) + if (__libc_utmpname_mode == UTMPNAME_TIME32) + { + struct utmp32 out32; + struct utmp32 *out32p; + retval = __libc_getutent32_r (&out32, &out32p); + if (retval == 0) + { + __utmp_convert32to64 (out32p, buffer); + *result = buffer; + } + } + else +#endif + retval = __libc_getutent_r (buffer, result); __libc_lock_unlock (__libc_utmp_lock); return retval; } libc_hidden_def (__getutent_r) +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __getutent_r, getutent_r, UTMP_COMPAT_BASE); +#else weak_alias (__getutent_r, getutent_r) +#endif struct utmp * @@ -63,14 +89,28 @@ __pututline (const struct utmp *data) __libc_lock_lock (__libc_utmp_lock); - buffer = __libc_pututline (data); +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) + if (__libc_utmpname_mode == UTMPNAME_TIME32) + { + struct utmp32 in32; + __utmp_convert64to32 (data, &in32); + struct utmp32 *out32p = __libc_pututline32 (&in32); + buffer = out32p != NULL ? (struct utmp *) data : NULL; + } + else +#endif + buffer = __libc_pututline (data); __libc_lock_unlock (__libc_utmp_lock); return buffer; } libc_hidden_def (__pututline) +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __pututline, pututline, UTMP_COMPAT_BASE); +#else weak_alias (__pututline, pututline) +#endif void diff --git a/login/getutid.c b/login/getutid.c index d986b9d892..ace3e840b7 100644 --- a/login/getutid.c +++ b/login/getutid.c @@ -18,7 +18,8 @@ #include #include - +#include +#include /* Local buffer to store the result. */ libc_freeres_ptr (static struct utmp *buffer); @@ -40,4 +41,8 @@ __getutid (const struct utmp *id) return result; } libc_hidden_def (__getutid) +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __getutid, getutid, UTMP_COMPAT_BASE); +#else weak_alias (__getutid, getutid) +#endif diff --git a/login/getutid_r.c b/login/getutid_r.c index 68f40a6e24..f763a0f748 100644 --- a/login/getutid_r.c +++ b/login/getutid_r.c @@ -21,9 +21,10 @@ #include #include #include - -#include "utmp-private.h" - +#include +#include +#include +#include /* We have to use the lock in getutent_r.c. */ __libc_lock_define (extern, __libc_utmp_lock attribute_hidden) @@ -48,11 +49,35 @@ __getutid_r (const struct utmp *id, struct utmp *buffer, struct utmp **result) __libc_lock_lock (__libc_utmp_lock); - retval = __libc_getutid_r (id, buffer, result); +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) + if (__libc_utmpname_mode == UTMPNAME_TIME32) + { + struct utmp32 in32; + struct utmp32 out32; + struct utmp32 *out32p; + + __utmp_convert64to32 (id, &in32); + + retval = __libc_getutid32_r (&in32, &out32, &out32p); + if (retval == 0) + { + __utmp_convert32to64 (out32p, buffer); + *result = buffer; + } + else + *result = NULL; + } + else +#endif + retval = __libc_getutid_r (id, buffer, result); __libc_lock_unlock (__libc_utmp_lock); return retval; } libc_hidden_def (__getutid_r) +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __getutid_r, getutid_r, UTMP_COMPAT_BASE); +#else weak_alias (__getutid_r, getutid_r) +#endif diff --git a/login/getutline.c b/login/getutline.c index 2c8320c9a9..59a56d1ff8 100644 --- a/login/getutline.c +++ b/login/getutline.c @@ -18,7 +18,8 @@ #include #include - +#include +#include /* Local buffer to store the result. */ libc_freeres_ptr (static struct utmp *buffer); @@ -41,4 +42,8 @@ __getutline (const struct utmp *line) return result; } libc_hidden_def (__getutline) +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __getutline, getutline, UTMP_COMPAT_BASE); +#else weak_alias (__getutline, getutline) +#endif diff --git a/login/getutline_r.c b/login/getutline_r.c index 39b8a5830f..0f04f9eaa0 100644 --- a/login/getutline_r.c +++ b/login/getutline_r.c @@ -20,9 +20,10 @@ #include #include #include - -#include "utmp-private.h" - +#include +#include +#include +#include /* We have to use the lock in getutent_r.c. */ __libc_lock_define (extern, __libc_utmp_lock attribute_hidden) @@ -36,11 +37,35 @@ __getutline_r (const struct utmp *line, struct utmp *buffer, __libc_lock_lock (__libc_utmp_lock); - retval = __libc_getutline_r (line, buffer, result); +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) + if (__libc_utmpname_mode == UTMPNAME_TIME32) + { + struct utmp32 in32; + struct utmp32 out32; + struct utmp32 *out32p; + + __utmp_convert64to32 (line, &in32); + + retval = __libc_getutline32_r (&in32, &out32, &out32p); + if (retval == 0) + { + __utmp_convert32to64 (out32p, buffer); + *result = buffer; + } + else + *result = NULL; + } + else +#endif + retval = __libc_getutline_r (line, buffer, result); __libc_lock_unlock (__libc_utmp_lock); return retval; } libc_hidden_def (__getutline_r) +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __getutline_r, getutline_r, UTMP_COMPAT_BASE); +#else weak_alias (__getutline_r, getutline_r) +#endif diff --git a/login/getutmp.c b/login/getutmp.c index 60aafb5067..f2873cc9cd 100644 --- a/login/getutmp.c +++ b/login/getutmp.c @@ -21,6 +21,8 @@ #define getutmpx __redirect_getutmpx #include #undef getutmpx +#include +#include #define CHECK_SIZE_AND_OFFSET(field) \ _Static_assert (sizeof ((struct utmp){0}.field) \ @@ -59,5 +61,11 @@ __getutmp (const struct utmpx *utmpx, struct utmp *utmp) utmp->ut_tv.tv_usec = utmpx->ut_tv.tv_usec; } -weak_alias (__getutmp, getutmp) +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __getutmp, getutmp, UTMP_COMPAT_BASE); +strong_alias (__getutmp, __getutmpx) +versioned_symbol (libc, __getutmpx, getutmpx, UTMP_COMPAT_BASE); +#else +strong_alias (__getutmp, getutmp) strong_alias (__getutmp, getutmpx) +#endif diff --git a/login/getutxent.c b/login/getutxent.c index a6794bac70..bd5a62b5fe 100644 --- a/login/getutxent.c +++ b/login/getutxent.c @@ -18,9 +18,16 @@ #include #include +#include +#include struct utmpx * -getutxent (void) +__getutxent (void) { return (struct utmpx *) __getutent (); } +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __getutxent, getutxent, UTMP_COMPAT_BASE); +#else +weak_alias (__getutxent, getutxent) +#endif diff --git a/login/getutxid.c b/login/getutxid.c index ae3b9fe7b0..ec33512eb4 100644 --- a/login/getutxid.c +++ b/login/getutxid.c @@ -18,9 +18,16 @@ #include #include +#include +#include struct utmpx * -getutxid (const struct utmpx *id) +__getutxid (const struct utmpx *id) { return (struct utmpx *) __getutid ((const struct utmp *) id); } +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __getutxid, getutxid, UTMP_COMPAT_BASE); +#else +weak_alias (__getutxid, getutxid) +#endif diff --git a/login/getutxline.c b/login/getutxline.c index 274716bf7a..6baac67fc3 100644 --- a/login/getutxline.c +++ b/login/getutxline.c @@ -18,9 +18,16 @@ #include #include +#include +#include struct utmpx * -getutxline (const struct utmpx *line) +__getutxline (const struct utmpx *line) { return (struct utmpx *) __getutline ((const struct utmp *) line); } +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __getutxline, getutxline, UTMP_COMPAT_BASE); +#else +weak_alias (__getutxline, getutxline) +#endif diff --git a/login/login.c b/login/login.c index d280c13f1f..56cbf37dfe 100644 --- a/login/login.c +++ b/login/login.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include /* Return the result of ttyname in the buffer pointed to by TTY, which should @@ -78,7 +80,7 @@ tty_name (int fd, char **tty, size_t buf_len) } void -login (const struct utmp *ut) +__login (const struct utmp *ut) { #ifdef PATH_MAX char _tty[PATH_MAX + UT_LINESIZE]; @@ -137,3 +139,9 @@ login (const struct utmp *ut) /* Update the WTMP file. Here we have to add a new entry. */ updwtmp (_PATH_WTMP, ©); } +hidden_def (__login) +#if SHLIB_COMPAT(libutil, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libutil, __login, login, UTMP_COMPAT_BASE); +#else +weak_alias (__login, login) +#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/login32.c b/login/login32.c similarity index 72% rename from sysdeps/unix/sysv/linux/s390/s390-32/login32.c rename to login/login32.c index 45419bc092..29fd77d566 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/login32.c +++ b/login/login32.c @@ -1,5 +1,5 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . +/* Write utmp and wtmp entries, 32-bit time compat version. + Copyright (C) 2008-2021 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 @@ -16,21 +16,23 @@ License along with the GNU C Library; if not, see . */ -#include #include -#include +#include +#include #include "utmp32.h" #include "utmp-convert.h" +#if SHLIB_COMPAT(libutil, GLIBC_2_0, UTMP_COMPAT_BASE) /* Write the given entry into utmp and wtmp. */ void login32 (const struct utmp32 *entry) { struct utmp in64; - utmp_convert32to64 (entry, &in64); - login (&in64); + __utmp_convert32to64 (entry, &in64); + __login (&in64); } -symbol_version (login32, login, GLIBC_2.0); +compat_symbol (libutil, login32, login, GLIBC_2_0); +#endif diff --git a/login/pututxline.c b/login/pututxline.c index 8b38f1fd97..2b49dfe767 100644 --- a/login/pututxline.c +++ b/login/pututxline.c @@ -18,9 +18,16 @@ #include #include +#include +#include struct utmpx * -pututxline (const struct utmpx *utmpx) +__pututxline (const struct utmpx *utmpx) { return (struct utmpx *) __pututline ((const struct utmp *) utmpx); } +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __pututxline, pututxline, UTMP_COMPAT_BASE); +#else +weak_alias (__pututxline, pututxline) +#endif diff --git a/login/tst-utmp-default.c b/login/tst-utmp-default.c new file mode 100644 index 0000000000..5cc997f97d --- /dev/null +++ b/login/tst-utmp-default.c @@ -0,0 +1,292 @@ +/* Tests for UTMP functions using default and old UTMP_FILE. + Copyright (C) 2021 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 +#include + +#include +#include + +/* The default utmp{x} functions read and write the exported 64-bit time_t + utmp/utmpx struct as default with the only exception when the old + UTMP_FILE ('/var/run/utmp') or WUTMP_FILE ('/var/run/wtmp') is set + explicitly with utmpname or updwtmp. In this case old 32-bit time_t + entries are read / write instead. */ + +static struct utmp entry[] = +{ +#define UT(a) .ut_tv = { .tv_sec = (a)} + + { .ut_type = BOOT_TIME, .ut_pid = 1, UT(1000) }, + { .ut_type = RUN_LVL, .ut_pid = 1, UT(2000) }, + { .ut_type = INIT_PROCESS, .ut_pid = 5, .ut_id = "si", UT(3000) }, + { .ut_type = LOGIN_PROCESS, .ut_pid = 23, .ut_line = "tty1", .ut_id = "1", + .ut_user = "LOGIN", UT(4000) }, + { .ut_type = USER_PROCESS, .ut_pid = 24, .ut_line = "tty2", .ut_id = "2", + .ut_user = "albert", UT(8000) }, + { .ut_type = USER_PROCESS, .ut_pid = 196, .ut_line = "ttyp0", .ut_id = "p0", + .ut_user = "niels", UT(10000) }, + { .ut_type = DEAD_PROCESS, .ut_line = "ttyp1", .ut_id = "p1", UT(16000) }, + { .ut_type = EMPTY }, + { .ut_type = EMPTY } +}; +const size_t entry_size = sizeof (entry) / sizeof (entry[0]); + +static time_t entry_time = 20000; +static pid_t entry_pid = 234; + +static void +compare_utmp (const struct utmp *left, const struct utmp *right) +{ + TEST_COMPARE (left->ut_type, right->ut_type); + TEST_COMPARE (left->ut_pid, right->ut_pid); + TEST_COMPARE_BLOB (left->ut_line, sizeof (left->ut_line), + right->ut_line, sizeof (right->ut_line)); + TEST_COMPARE_BLOB (left->ut_id, sizeof (left->ut_id), + right->ut_id, sizeof (right->ut_id)); + TEST_COMPARE_BLOB (left->ut_user, sizeof (left->ut_user), + right->ut_user, sizeof (right->ut_user)); + TEST_COMPARE_BLOB (left->ut_host, sizeof (left->ut_host), + right->ut_host, sizeof (right->ut_host)); + TEST_COMPARE (left->ut_exit.e_termination, right->ut_exit.e_termination); + TEST_COMPARE (left->ut_exit.e_exit, right->ut_exit.e_exit); + TEST_COMPARE (left->ut_tv.tv_sec, right->ut_tv.tv_sec); + TEST_COMPARE (left->ut_tv.tv_usec, right->ut_tv.tv_usec); + TEST_COMPARE_BLOB (left->ut_addr_v6, sizeof (left->ut_addr_v6), + right->ut_addr_v6, sizeof (right->ut_addr_v6)); +} + +static void +do_init (void) +{ + setutent (); + + for (int n = 0; n < entry_size; n++) + TEST_VERIFY (pututline (&entry[n]) != NULL); + + endutent (); +} + +static void +do_check (void) +{ + struct utmp *ut; + int n; + + setutent (); + + n = 0; + while ((ut = getutent ())) + { + TEST_VERIFY (n <= entry_size); + compare_utmp (ut, &entry[n]); + n++; + } + TEST_COMPARE (n, entry_size); + + endutent (); +} + +static void +simulate_login (const char *line, const char *user) +{ + for (int n = 0; n < entry_size; n++) + { + if (strcmp (line, entry[n].ut_line) == 0 + || entry[n].ut_type == DEAD_PROCESS) + { + if (entry[n].ut_pid == DEAD_PROCESS) + entry[n].ut_pid = (entry_pid += 27); + entry[n].ut_type = USER_PROCESS; + strncpy (entry[n].ut_user, user, sizeof (entry[n].ut_user)); + entry[n].ut_tv.tv_sec = (entry_time += 1000); + setutent (); + + TEST_VERIFY (pututline (&entry[n]) != NULL); + + endutent (); + + return; + } + } + + FAIL_EXIT1 ("no entries available"); +} + +static void +simulate_logout (const char *line) +{ + int n; + + for (n = 0; n < entry_size; n++) + { + if (strcmp (line, entry[n].ut_line) == 0) + { + entry[n].ut_type = DEAD_PROCESS; + strncpy (entry[n].ut_user, "", sizeof (entry[n].ut_user)); + entry[n].ut_tv.tv_sec = (entry_time += 1000); + setutent (); + + TEST_VERIFY (pututline (&entry[n]) != NULL); + + endutent (); + + return; + } + } + + FAIL_EXIT1 ("no entries available"); +} + +static void +check_login (const char *line) +{ + struct utmp *up; + struct utmp ut; + + setutent (); + + strcpy (ut.ut_line, line); + up = getutline (&ut); + TEST_VERIFY (up != NULL); + + endutent (); + + for (int n = 0; n < entry_size; n++) + { + if (strcmp (line, entry[n].ut_line) == 0) + { + compare_utmp (up, &entry[n]); + return; + } + } + + FAIL_EXIT1 ("bogus entry for line `%s'", line); +} + +static void +check_logout (const char *line) +{ + struct utmp ut; + + setutent (); + + strcpy (ut.ut_line, line); + TEST_VERIFY (getutline (&ut) == NULL); + + endutent (); +} + +static void +check_id (const char *id) +{ + struct utmp *up; + struct utmp ut; + + setutent (); + + ut.ut_type = USER_PROCESS; + strcpy (ut.ut_id, id); + up = getutid (&ut); + TEST_VERIFY (up != NULL); + + endutent (); + + for (int n = 0; n < entry_size; n++) + { + if (strcmp (id, entry[n].ut_id) == 0) + { + compare_utmp (up, &entry[n]); + return; + } + } + + FAIL_EXIT1 ("bogus entry for ID `%s'", id); +} + +static void +check_type (int type) +{ + struct utmp *up; + struct utmp ut; + int n; + + setutent (); + + ut.ut_type = type; + up = getutid (&ut); + TEST_VERIFY (up != NULL); + + endutent (); + + for (n = 0; n < entry_size; n++) + { + if (type == entry[n].ut_type) + { + compare_utmp (up, &entry[n]); + return; + } + } + + FAIL_EXIT1 ("bogus entry for type `%d'", type); +} + +static void +run_test (void) +{ + do_init (); + do_check (); + + simulate_login ("tty1", "erwin"); + do_check (); + + simulate_login ("ttyp1", "paul"); + do_check (); + + simulate_logout ("tty2"); + do_check (); + + simulate_logout ("ttyp0"); + do_check (); + + simulate_login ("ttyp2", "richard"); + do_check (); + + check_login ("tty1"); + check_logout ("ttyp0"); + check_id ("p1"); + check_id ("2"); + check_id ("si"); + check_type (BOOT_TIME); + check_type (RUN_LVL); +} + +static int +do_test (void) +{ + utmpname (UTMP_FILE); + run_test (); + + utmpname ("/var/run/utmp"); + run_test (); + + return 0; +} + +#include diff --git a/login/tst-utmp-default.root/tst-utmp-default.script b/login/tst-utmp-default.root/tst-utmp-default.script new file mode 100644 index 0000000000..26ef984f5f --- /dev/null +++ b/login/tst-utmp-default.root/tst-utmp-default.script @@ -0,0 +1,10 @@ +# We create empty UTMP_FILE and WTMP_FILE +mkdirp 0755 /var/run +touch 0664 /var/run/utmp.v2 +touch 0664 /var/run/wtmp.v2 +# Same for the old files as well +touch 0664 /var/run/utmp +touch 0664 /var/run/wtmp + +# Must run localedef as root to write into default paths. +su diff --git a/login/tst-utmp32.c b/login/tst-utmp32.c new file mode 100644 index 0000000000..d4a356102a --- /dev/null +++ b/login/tst-utmp32.c @@ -0,0 +1,318 @@ +/* Tests for UTMP compat mode. + Copyright (C) 2021 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 +#include + +/* The test check the compat utmp/utmpx routines for the two operation modes: + + 1. Use the default UTMP_FILE which uses the default code path which + read/write 64-bit entries and converts to 32-bit time_t utmp/utmpx + entries. + + 2. Set a non default path with utmpname, which uses the compat code + path to read/write 32-bit time_t utmp/utmpx entries. */ + +#include +#include +#include + +#include +#include +#include + +#include + +compat_symbol_reference (libc, setutent, setutent, GLIBC_2_0); +compat_symbol_reference (libc, pututline, pututline, GLIBC_2_0); +compat_symbol_reference (libc, getutline, getutline, GLIBC_2_0); +compat_symbol_reference (libc, getutent, getutent, GLIBC_2_0); +compat_symbol_reference (libc, getutid, getutid, GLIBC_2_0); + +static struct utmp32 entry[] = +{ +#define UT(a) .ut_tv = { .tv_sec = (a)} + + { .ut_type = BOOT_TIME, .ut_pid = 1, UT(1000) }, + { .ut_type = RUN_LVL, .ut_pid = 1, UT(2000) }, + { .ut_type = INIT_PROCESS, .ut_pid = 5, .ut_id = "si", UT(3000) }, + { .ut_type = LOGIN_PROCESS, .ut_pid = 23, .ut_line = "tty1", .ut_id = "1", + .ut_user = "LOGIN", UT(4000) }, + { .ut_type = USER_PROCESS, .ut_pid = 24, .ut_line = "tty2", .ut_id = "2", + .ut_user = "albert", UT(8000) }, + { .ut_type = USER_PROCESS, .ut_pid = 196, .ut_line = "ttyp0", .ut_id = "p0", + .ut_user = "niels", UT(10000) }, + { .ut_type = DEAD_PROCESS, .ut_line = "ttyp1", .ut_id = "p1", UT(16000) }, + { .ut_type = EMPTY }, + { .ut_type = EMPTY } +}; + +static time_t entry_time = 20000; +static pid_t entry_pid = 234; + +static void +compare_utmp32 (const struct utmp32 *left, const struct utmp32 *right) +{ + TEST_COMPARE (left->ut_type, right->ut_type); + TEST_COMPARE (left->ut_pid, right->ut_pid); + TEST_COMPARE_BLOB (left->ut_line, sizeof (left->ut_line), + right->ut_line, sizeof (right->ut_line)); + TEST_COMPARE_BLOB (left->ut_id, sizeof (left->ut_id), + right->ut_id, sizeof (right->ut_id)); + TEST_COMPARE_BLOB (left->ut_user, sizeof (left->ut_user), + right->ut_user, sizeof (right->ut_user)); + TEST_COMPARE_BLOB (left->ut_host, sizeof (left->ut_host), + right->ut_host, sizeof (right->ut_host)); + TEST_COMPARE (left->ut_exit.e_termination, right->ut_exit.e_termination); + TEST_COMPARE (left->ut_exit.e_exit, right->ut_exit.e_exit); + TEST_COMPARE (left->ut_tv.tv_sec, right->ut_tv.tv_sec); + TEST_COMPARE (left->ut_tv.tv_usec, right->ut_tv.tv_usec); + TEST_COMPARE_BLOB (left->ut_addr_v6, sizeof (left->ut_addr_v6), + right->ut_addr_v6, sizeof (right->ut_addr_v6)); +} + +static void +do_init (void) +{ + setutent (); + + for (int n = 0; n < array_length (entry); n++) + TEST_VERIFY (pututline ((const struct utmp *) &entry[n]) != NULL); + + endutent (); +} + +static void +do_check (void) +{ + int n; + + setutent (); + + n = 0; + while (1) + { + struct utmp32 *ut = (struct utmp32 *) getutent (); + if (ut == NULL) + break; + TEST_VERIFY (n <= array_length (entry)); + compare_utmp32 (ut, &entry[n]); + n++; + } + TEST_COMPARE (n, array_length (entry)); + + endutent (); +} + +static void +simulate_login (const char *line, const char *user) +{ + for (int n = 0; n diff --git a/login/tst-utmp32.root/tst-utmp32.script b/login/tst-utmp32.root/tst-utmp32.script new file mode 100644 index 0000000000..4aadc63335 --- /dev/null +++ b/login/tst-utmp32.root/tst-utmp32.script @@ -0,0 +1,7 @@ +# We create empty UTMP_FILE and WTMP_FILE +mkdirp 0755 /var/run +touch 0664 /var/run/utmp.v2 +touch 0664 /var/run/wtmp.v2 + +# Must run localedef as root to write into default paths. +su diff --git a/login/updwtmp.c b/login/updwtmp.c index e67a9cf2d9..e61d933aa3 100644 --- a/login/updwtmp.c +++ b/login/updwtmp.c @@ -19,16 +19,31 @@ #include #include #include - -#include "utmp-private.h" +#include #include +#include +#include +#include void __updwtmp (const char *wtmp_file, const struct utmp *utmp) { - const char *file_name = utmp_file_name_time32 (wtmp_file); - - __libc_updwtmp (file_name, utmp); +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) + if (strcmp (wtmp_file, _PATH_WTMP_BASE) == 0 + || strcmp (wtmp_file, _PATH_WTMP_BASE) == 0) + { + const char *file_name = utmp_file_name_time32 (wtmp_file); + struct utmp32 in32; + __utmp_convert64to32 (utmp, &in32); + __libc_updwtmp32 (file_name, &in32); + } + else +#endif + __libc_updwtmp (wtmp_file, utmp); } libc_hidden_def (__updwtmp) +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __updwtmp, updwtmp, UTMP_COMPAT_BASE); +#else weak_alias (__updwtmp, updwtmp) +#endif diff --git a/login/updwtmpx.c b/login/updwtmpx.c index ba06645dfd..93c3fd3f2d 100644 --- a/login/updwtmpx.c +++ b/login/updwtmpx.c @@ -18,9 +18,16 @@ #include #include +#include +#include void -updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx) +__updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx) { __updwtmp (wtmpx_file, (const struct utmp *) utmpx); } +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +versioned_symbol (libc, __updwtmpx, updwtmpx, UTMP_COMPAT_BASE); +#else +weak_alias (__updwtmpx, updwtmpx) +#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h b/login/utmp-convert.c similarity index 58% rename from sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h rename to login/utmp-convert.c index 9418afb0f4..8d55ddfa4f 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-convert.h +++ b/login/utmp-convert.c @@ -1,5 +1,5 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . +/* Converto to/from 64-bit to 32-bit time_t utmp/utmpx struct. + Copyright (C) 2008-2021 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 @@ -16,71 +16,42 @@ License along with the GNU C Library; if not, see . */ - -/* This file provides functions converting between the 32 and 64 bit - struct utmp variants. */ - -#ifndef _UTMP_CONVERT_H -#define _UTMP_CONVERT_H 1 - #include - -#include "utmp32.h" +#include /* Convert the 64 bit struct utmp value in FROM to the 32 bit version returned in TO. */ -static inline void -utmp_convert64to32 (const struct utmp *from, struct utmp32 *to) +void +__utmp_convert64to32 (const struct utmp *from, struct utmp32 *to) { -#if _HAVE_UT_TYPE - 0 to->ut_type = from->ut_type; -#endif -#if _HAVE_UT_PID - 0 to->ut_pid = from->ut_pid; -#endif memcpy (to->ut_line, from->ut_line, UT_LINESIZE); memcpy (to->ut_user, from->ut_user, UT_NAMESIZE); -#if _HAVE_UT_ID - 0 memcpy (to->ut_id, from->ut_id, 4); -#endif -#if _HAVE_UT_HOST - 0 memcpy (to->ut_host, from->ut_host, UT_HOSTSIZE); -#endif to->ut_exit = from->ut_exit; - to->ut_session = (int32_t) from->ut_session; -#if _HAVE_UT_TV - 0 - to->ut_tv.tv_sec = (int32_t) from->ut_tv.tv_sec; - to->ut_tv.tv_usec = (int32_t) from->ut_tv.tv_usec; -#endif + to->ut_session = from->ut_session; + to->ut_tv.tv_sec = from->ut_tv.tv_sec; + to->ut_tv.tv_usec = from->ut_tv.tv_usec; memcpy (to->ut_addr_v6, from->ut_addr_v6, 4 * 4); } /* Convert the 32 bit struct utmp value in FROM to the 64 bit version returned in TO. */ -static inline void -utmp_convert32to64 (const struct utmp32 *from, struct utmp *to) +void +__utmp_convert32to64 (const struct utmp32 *from, struct utmp *to) { -#if _HAVE_UT_TYPE - 0 to->ut_type = from->ut_type; -#endif -#if _HAVE_UT_PID - 0 to->ut_pid = from->ut_pid; -#endif memcpy (to->ut_line, from->ut_line, UT_LINESIZE); memcpy (to->ut_user, from->ut_user, UT_NAMESIZE); -#if _HAVE_UT_ID - 0 memcpy (to->ut_id, from->ut_id, 4); -#endif -#if _HAVE_UT_HOST - 0 memcpy (to->ut_host, from->ut_host, UT_HOSTSIZE); -#endif to->ut_exit = from->ut_exit; - to->ut_session = (int64_t) from->ut_session; -#if _HAVE_UT_TV - 0 - to->ut_tv.tv_sec = (int64_t) from->ut_tv.tv_sec; - to->ut_tv.tv_usec = (int64_t) from->ut_tv.tv_usec; -#endif - memcpy (to->ut_addr_v6, from->ut_addr_v6, 4 * 4); + to->ut_session = from->ut_session; + to->ut_tv.tv_sec = from->ut_tv.tv_sec; + to->ut_tv.tv_usec = from->ut_tv.tv_usec; + memcpy (to->ut_addr_v6, from->ut_addr_v6, sizeof (to->ut_addr_v6)); } - -#endif /* utmp-convert.h */ +libc_hidden_def (__utmp_convert32to64) diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutent.c b/login/utmp-convert.h similarity index 59% rename from sysdeps/unix/sysv/linux/s390/s390-32/getutent.c rename to login/utmp-convert.h index 7774a59580..43125f249d 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getutent.c +++ b/login/utmp-convert.h @@ -16,17 +16,23 @@ License along with the GNU C Library; if not, see . */ -#include -#include -#include "utmp-compat.h" +/* This file provides functions converting between the 32 and 64 bit + struct utmp variants. */ -#if defined SHARED -# undef weak_alias -# define weak_alias(n,a) -#endif -#include "login/getutent.c" +#ifndef _UTMP_CONVERT_H +#define _UTMP_CONVERT_H 1 -#if defined SHARED -default_symbol_version (__getutent, getutent, UTMP_COMPAT_BASE); -#endif +#include + +/* Convert the 64 bit struct utmp value in FROM to the 32 bit version + returned in TO. */ +void __utmp_convert64to32 (const struct utmp *from, struct utmp32 *to) + attribute_hidden; + +/* Convert the 32 bit struct utmp value in FROM to the 64 bit version + returned in TO. */ +void __utmp_convert32to64 (const struct utmp32 *from, struct utmp *to); +libc_hidden_proto (__utmp_convert32to64); + +#endif /* utmp-convert.h */ diff --git a/login/utmp-path.h b/login/utmp-path.h index 351a932862..27191b23a4 100644 --- a/login/utmp-path.h +++ b/login/utmp-path.h @@ -19,8 +19,8 @@ #ifndef _UTMP_PATH_H #define _UTMP_PATH_H 1 -#include #include +#include /* The function returns the utmp database for 32-bit utmp{x} entries based on FILE_NAME. If the argument ends with 'x' and the file does not diff --git a/login/utmp-private.h b/login/utmp-private.h index 00632ce51d..689ee82273 100644 --- a/login/utmp-private.h +++ b/login/utmp-private.h @@ -22,23 +22,43 @@ #define _UTMP_PRIVATE_H 1 #include +#include +#include #include /* These functions check for initialization, but not perform any locking. */ -int __libc_setutent (void) attribute_hidden; +void __libc_setutent (void) attribute_hidden; +void __libc_endutent (void) attribute_hidden; + int __libc_getutent_r (struct utmp *, struct utmp **) attribute_hidden; int __libc_getutid_r (const struct utmp *, struct utmp *, struct utmp **) attribute_hidden; int __libc_getutline_r (const struct utmp *, struct utmp *, struct utmp **) attribute_hidden; struct utmp *__libc_pututline (const struct utmp *) attribute_hidden; -void __libc_endutent (void) attribute_hidden; int __libc_updwtmp (const char *, const struct utmp *) attribute_hidden; +void __libc_setutent32 (void) attribute_hidden; +int __libc_getutent32_r (struct utmp32 *, struct utmp32 **) attribute_hidden; +int __libc_getutid32_r (const struct utmp32 *, struct utmp32 *, + struct utmp32 **) attribute_hidden; +int __libc_getutline32_r (const struct utmp32 *, struct utmp32 *, + struct utmp32 **) attribute_hidden; +struct utmp32 *__libc_pututline32 (const struct utmp32 *) attribute_hidden; +int __libc_updwtmp32 (const char *, const struct utmp32 *) attribute_hidden; + /* Current file name. */ extern const char *__libc_utmp_file_name attribute_hidden; +enum __libc_utmpname_mode_t +{ + UTMPNAME_TIME64, + UTMPNAME_TIME32, + UTMPNAME_UNDEF +}; +extern enum __libc_utmpname_mode_t __libc_utmpname_mode attribute_hidden; + /* Locks access to the global data. */ __libc_lock_define (extern, __libc_utmp_lock attribute_hidden) diff --git a/login/utmp32.c b/login/utmp32.c new file mode 100644 index 0000000000..427bd97449 --- /dev/null +++ b/login/utmp32.c @@ -0,0 +1,247 @@ +/* Compability symbols for utmp with 32-bit entry times. + Copyright (C) 2008-2020 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 +#include +#include + +#include +#include +#include +#include + +#include +#include + +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) + +/* The compat utmp{x} functions are used for 32-bit time_t utmp/utmpx struct + and they use two operation modes: + + 1. Read/write 64-bit utmp{x} entries and convert them to/from 32-bit utmp. + This is done for the exported UTMP_FILE / WUTMP_FILE + (__libc_utmpname_mode equal to UTMPNAME_TIME64). + + 2. Read/write 32-bit utmp if the target file is any other than the default + UTMP_FILE / WUTMP_FILE ones. + + It allows maintaining the already set file format for old records, while + also allowing reading newer ones (which might be created with call to the + default utmp/utmpx symbol version). */ + +int +__getutid32_r (const struct utmp32 *id, struct utmp32 *buffer, + struct utmp32 **result) +{ + int r; + + switch (id->ut_type) + { + case RUN_LVL: + case BOOT_TIME: + case OLD_TIME: + case NEW_TIME: + case INIT_PROCESS: + case LOGIN_PROCESS: + case USER_PROCESS: + case DEAD_PROCESS: + break; + default: + __set_errno (EINVAL); + *result = NULL; + return -1; + } + + __libc_lock_lock (__libc_utmp_lock); + + if (__libc_utmpname_mode == UTMPNAME_TIME64) + { + struct utmp in64; + struct utmp out64; + struct utmp *out64p; + + __utmp_convert32to64 (id, &in64); + + r = __libc_getutid_r (&in64, &out64, &out64p); + if (r == 0) + { + __utmp_convert64to32 (out64p, buffer); + *result = buffer; + } + else + *result = NULL; + } + else + r = __libc_getutid32_r (id, buffer, result); + + __libc_lock_unlock (__libc_utmp_lock); + + return r; +} +compat_symbol (libc, __getutid32_r, getutid_r, GLIBC_2_0); + +struct utmp32 * +__getutid32 (const struct utmp32 *id) +{ + static struct utmp32 *out32 = NULL; + if (out32 == NULL) + { + out32 = malloc (sizeof (struct utmp32)); + if (out32 == NULL) + return NULL; + } + + struct utmp32 *result; + return __getutid32_r (id, out32, &result) < 0 ? NULL : result; +} +compat_symbol (libc, __getutid32, getutid, GLIBC_2_0); + +int +__getutline32_r (const struct utmp32 *line, + struct utmp32 *buffer, struct utmp32 **result) +{ + int r; + + __libc_lock_lock (__libc_utmp_lock); + + if (__libc_utmpname_mode == UTMPNAME_TIME64) + { + struct utmp in64; + struct utmp out64; + struct utmp *out64p; + + __utmp_convert32to64 (line, &in64); + + r = __libc_getutline_r (&in64, &out64, &out64p); + if (r == 0) + { + __utmp_convert64to32 (out64p, buffer); + *result = buffer; + } + else + *result = NULL; + } + else + r = __libc_getutline32_r (line, buffer, result); + + __libc_lock_unlock (__libc_utmp_lock); + + return r; +} +compat_symbol (libc, __getutline32_r, getutline_r, GLIBC_2_0); + +struct utmp32 * +__getutline32 (const struct utmp32 *line) +{ + static struct utmp32 *out32 = NULL; + if (out32 == NULL) + { + out32 = malloc (sizeof (struct utmp32)); + if (out32 == NULL) + return NULL; + } + + struct utmp32 *result; + return __getutline32_r (line, out32, &result) < 0 ? NULL : result; +} +compat_symbol (libc, __getutline32, getutline, GLIBC_2_0); + +struct utmp32 * +__pututline32 (const struct utmp32 *line) +{ + struct utmp32 *r; + + __libc_lock_lock (__libc_utmp_lock); + + if (__libc_utmpname_mode == UTMPNAME_TIME64) + { + struct utmp in64; + __utmp_convert32to64 (line, &in64); + struct utmp *out64p = __libc_pututline (&in64); + r = out64p != NULL ? (struct utmp32 *) line : NULL; + } + else + r = __libc_pututline32 (line); + + __libc_lock_unlock (__libc_utmp_lock); + + return r; +} +compat_symbol (libc, __pututline32, pututline, GLIBC_2_0); + +int +__getutent32_r (struct utmp32 *buffer, struct utmp32 **result) +{ + int r; + + __libc_lock_lock (__libc_utmp_lock); + + if (__libc_utmpname_mode == UTMPNAME_TIME64) + { + struct utmp out64; + struct utmp *out64p; + r = __libc_getutent_r (&out64, &out64p); + if (r == 0) + { + __utmp_convert64to32 (out64p, buffer); + *result = buffer; + } + } + else + r = __libc_getutent32_r (buffer, result); + + __libc_lock_unlock (__libc_utmp_lock); + + return r; +} +compat_symbol (libc, __getutent32_r, getutent_r, GLIBC_2_0); + +struct utmp32 * +__getutent32 (void) +{ + static struct utmp32 *out32 = NULL; + if (out32 == NULL) + { + out32 = malloc (sizeof (struct utmp32)); + if (out32 == NULL) + return NULL; + } + + struct utmp32 *result; + return __getutent32_r (out32, &result) < 0 ? NULL : result; +} +compat_symbol (libc, __getutent32, getutent, GLIBC_2_0); + +void +__updwtmp32 (const char *wtmp_file, const struct utmp32 *utmp) +{ + const char *file_name = utmp_file_name_time32 (wtmp_file); + + if (__libc_utmpname_mode == UTMPNAME_TIME64) + { + struct utmp in32; + __utmp_convert32to64 (utmp, &in32); + __libc_updwtmp (file_name, &in32); + } + else + __libc_updwtmp32 (file_name, utmp); +} +compat_symbol (libc, __updwtmp32, updwtmp, GLIBC_2_0); + +#endif /* SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h b/login/utmp32.h similarity index 78% rename from sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h rename to login/utmp32.h index 002b5377d6..a3440a4c73 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.h +++ b/login/utmp32.h @@ -47,5 +47,14 @@ struct utmp32 char __glibc_reserved[20]; /* Reserved for future use. */ }; +int __getutid32_r (const struct utmp32 *, struct utmp32 *, struct utmp32 **); +struct utmp32 *__getutid32 (const struct utmp32 *); +int __getutline32_r (const struct utmp32 *, struct utmp32 *, + struct utmp32 **); +struct utmp32 *__getutline32 (const struct utmp32 *line); +struct utmp32 *__pututline32 (const struct utmp32 *line); +int __getutent32_r (struct utmp32 *, struct utmp32 **); +struct utmp32 *__getutent32 (void); +void __updwtmp32 (const char *wtmp_file, const struct utmp32 *utmp); #endif /* utmp32.h */ diff --git a/login/utmp_file.c b/login/utmp_file.c index 377209b26d..ee1fe51b43 100644 --- a/login/utmp_file.c +++ b/login/utmp_file.c @@ -17,22 +17,16 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include -#include #include -#include #include -#include -#include -#include -#include -#include +#include #include -#include "utmp-private.h" +#include #include +#include +#include /* Descriptor for the file and position. */ @@ -40,41 +34,91 @@ static int file_fd = -1; static bool file_writable; static off64_t file_offset; + +/* The utmp{x} internal functions work on two operations modes + + 1. Read/write 64-bit time utmp{x} entries using the exported + 'struct utmp{x}' + + 2. Read/write 32-bit time utmp{x} entries using the old 'struct utmp32' + + The operation mode mainly change the register size and how to interpret + the 'last_entry' buffered record. */ +enum operation_mode_t +{ + UTMP_TIME64, + UTMP_TIME32 +}; +static enum operation_mode_t cur_mode = UTMP_TIME64; + +enum +{ + utmp_buffer_size = MAX (sizeof (struct utmp), sizeof (struct utmp32)) +}; + /* Cache for the last read entry. */ -static struct utmp last_entry; +static char last_entry[utmp_buffer_size]; + +static inline size_t last_entry_size (enum operation_mode_t mode) +{ + return mode == UTMP_TIME64 ? sizeof (struct utmp) : sizeof (struct utmp32); +} + +static inline short int last_entry_type (enum operation_mode_t mode) +{ + short int r; + if (mode == UTMP_TIME32) + memcpy (&r, last_entry + offsetof (struct utmp32, ut_type), sizeof (r)); + else + memcpy (&r, last_entry + offsetof (struct utmp, ut_type), sizeof (r)); + return r; +} + +static inline const char *last_entry_id (enum operation_mode_t mode) +{ + if (mode == UTMP_TIME64) + return ((struct utmp *) (last_entry))->ut_id; + return ((struct utmp32 *) (last_entry))->ut_id; +} + +static inline const char *last_entry_line (enum operation_mode_t mode) +{ + if (mode == UTMP_TIME64) + return ((struct utmp *) (last_entry))->ut_line; + return ((struct utmp32 *) (last_entry))->ut_line; +} -/* Returns true if *ENTRY matches last_entry, based on - data->ut_type. */ +/* Returns true if *ENTRY matches last_entry, based on data->ut_type. */ static bool -matches_last_entry (const struct utmp *data) +matches_last_entry (enum operation_mode_t mode, short int type, + const char *id, const char *line) { if (file_offset <= 0) /* Nothing has been read. last_entry is stale and cannot match. */ return false; - if (data->ut_type == RUN_LVL - || data->ut_type == BOOT_TIME - || data->ut_type == OLD_TIME - || data->ut_type == NEW_TIME) - /* For some entry types, only a type match is required. */ - return data->ut_type == last_entry.ut_type; - else - /* For the process-related entries, a full match is needed. */ - return (data->ut_type == INIT_PROCESS - || data->ut_type == LOGIN_PROCESS - || data->ut_type == USER_PROCESS - || data->ut_type == DEAD_PROCESS) - && (last_entry.ut_type == INIT_PROCESS - || last_entry.ut_type == LOGIN_PROCESS - || last_entry.ut_type == USER_PROCESS - || last_entry.ut_type == DEAD_PROCESS) - && (data->ut_id[0] && last_entry.ut_id[0] - ? strncmp (data->ut_id, last_entry.ut_id, - sizeof last_entry.ut_id) - == 0 - : (strncmp (data->ut_line, last_entry.ut_line, - sizeof last_entry.ut_line) - == 0)); + switch (type) + { + case RUN_LVL: + case BOOT_TIME: + case OLD_TIME: + case NEW_TIME: + /* For some entry types, only a type match is required. */ + return type == last_entry_type (mode); + default: + /* For the process-related entries, a full match is needed. */ + return (type == INIT_PROCESS + || type == LOGIN_PROCESS + || type == USER_PROCESS + || type == DEAD_PROCESS) + && (last_entry_type (mode) == INIT_PROCESS + || last_entry_type (mode) == LOGIN_PROCESS + || last_entry_type (mode) == USER_PROCESS + || last_entry_type (mode) == DEAD_PROCESS) + && (id[0] != '\0' && last_entry_id (mode)[0] != '\0' + ? strncmp (id, last_entry_id (mode), 4 * sizeof (char)) == 0 + : (strncmp (line, last_entry_id (mode), UT_LINESIZE) == 0)); + } } /* Locking timeout. */ @@ -143,33 +187,40 @@ file_unlock (int fd) __fcntl64_nocancel (fd, F_SETLKW, &fl); } -int -__libc_setutent (void) +static bool +internal_setutent (enum operation_mode_t mode) { if (file_fd < 0) { - const char *file_name; - - file_name = utmp_file_name_time32 (__libc_utmp_file_name); + const char *file_name = mode == UTMP_TIME64 + ?__libc_utmp_file_name + : utmp_file_name_time32 (__libc_utmp_file_name); file_writable = false; file_fd = __open_nocancel (file_name, O_RDONLY | O_LARGEFILE | O_CLOEXEC); if (file_fd == -1) - return 0; + return false; + cur_mode = mode; } __lseek64 (file_fd, 0, SEEK_SET); file_offset = 0; - return 1; + return true; } /* Preform initialization if necessary. */ static bool -maybe_setutent (void) +maybe_setutent (enum operation_mode_t mode) { - return file_fd >= 0 || __libc_setutent (); + if (file_fd >= 0 && cur_mode != mode) + { + __close_nocancel_nostatus (file_fd); + file_fd = -1; + file_offset = 0; + } + return file_fd >= 0 || internal_setutent (mode); } /* Reads the entry at file_offset, storing it in last_entry and @@ -177,40 +228,34 @@ maybe_setutent (void) for EOF, and 1 for a successful read. last_entry and file_offset are only updated on a successful and complete read. */ static ssize_t -read_last_entry (void) +read_last_entry (enum operation_mode_t mode) { - struct utmp buffer; - ssize_t nbytes = __pread64_nocancel (file_fd, &buffer, sizeof (buffer), - file_offset); + char buffer[utmp_buffer_size]; + const size_t size = last_entry_size (mode); + ssize_t nbytes = __pread64_nocancel (file_fd, &buffer, size, file_offset); if (nbytes < 0) return -1; - else if (nbytes != sizeof (buffer)) + else if (nbytes != size) /* Assume EOF. */ return 0; else { - last_entry = buffer; - file_offset += sizeof (buffer); + memcpy (last_entry, buffer, size); + file_offset += size; return 1; } } -int -__libc_getutent_r (struct utmp *buffer, struct utmp **result) +static int +internal_getutent_r (enum operation_mode_t mode, void *buffer) { int saved_errno = errno; - if (!maybe_setutent ()) - { - /* Not available. */ - *result = NULL; - return -1; - } - - if (try_file_lock (file_fd, F_RDLCK)) + if (!maybe_setutent (mode) + || try_file_lock (file_fd, F_RDLCK)) return -1; - ssize_t nbytes = read_last_entry (); + ssize_t nbytes = read_last_entry (mode); file_unlock (file_fd); if (nbytes <= 0) /* Read error or EOF. */ @@ -220,111 +265,86 @@ __libc_getutent_r (struct utmp *buffer, struct utmp **result) EOF is treated like an EOF (missing complete record at the end). */ __set_errno (saved_errno); - *result = NULL; return -1; } - memcpy (buffer, &last_entry, sizeof (struct utmp)); - *result = buffer; - + memcpy (buffer, &last_entry, last_entry_size (mode)); return 0; } - /* Search for *ID, updating last_entry and file_offset. Return 0 on success and -1 on failure. Does not perform locking; for that see internal_getut_r below. */ -static int -internal_getut_nolock (const struct utmp *id) +static bool +internal_getut_nolock (enum operation_mode_t mode, short int type, + const char *id, const char *line) { - while (1) + while (true) { - ssize_t nbytes = read_last_entry (); + ssize_t nbytes = read_last_entry (mode); if (nbytes < 0) - return -1; + return false; if (nbytes == 0) { /* End of file reached. */ __set_errno (ESRCH); - return -1; + return false; } - if (matches_last_entry (id)) + if (matches_last_entry (mode, type, id, line)) break; } - - return 0; + return true; } /* Search for *ID, updating last_entry and file_offset. Return 0 on success and -1 on failure. If the locking operation failed, write true to *LOCK_FAILED. */ -static int -internal_getut_r (const struct utmp *id, bool *lock_failed) +static bool +internal_getut_r (enum operation_mode_t mode, short int type, const char *id, + const char *line) { if (try_file_lock (file_fd, F_RDLCK)) - { - *lock_failed = true; - return -1; - } + return false; - int result = internal_getut_nolock (id); + bool r = internal_getut_nolock (mode, type, id, line); file_unlock (file_fd); - return result; + return r; } -/* For implementing this function we don't use the getutent_r function - because we can avoid the reposition on every new entry this way. */ -int -__libc_getutid_r (const struct utmp *id, struct utmp *buffer, - struct utmp **result) +static int +internal_getutid_r (enum operation_mode_t mode, short int type, + const char *id, const char *line, void *buffer) { - if (!maybe_setutent ()) - { - *result = NULL; - return -1; - } + if (!maybe_setutent (mode)) + return -1; /* We don't have to distinguish whether we can lock the file or whether there is no entry. */ - bool lock_failed = false; - if (internal_getut_r (id, &lock_failed) < 0) - { - *result = NULL; - return -1; - } + if (! internal_getut_r (mode, type, id, line)) + return -1; - memcpy (buffer, &last_entry, sizeof (struct utmp)); - *result = buffer; + memcpy (buffer, &last_entry, last_entry_size (mode)); return 0; } /* For implementing this function we don't use the getutent_r function because we can avoid the reposition on every new entry this way. */ -int -__libc_getutline_r (const struct utmp *line, struct utmp *buffer, - struct utmp **result) +static int +internal_getutline_r (enum operation_mode_t mode, const char *line, + void *buffer) { - if (!maybe_setutent ()) - { - *result = NULL; - return -1; - } - - if (try_file_lock (file_fd, F_RDLCK)) - { - *result = NULL; - return -1; - } + if (!maybe_setutent (mode) + || try_file_lock (file_fd, F_RDLCK)) + return -1; while (1) { - ssize_t nbytes = read_last_entry (); + ssize_t nbytes = read_last_entry (mode); if (nbytes < 0) { file_unlock (file_fd); - *result = NULL; return -1; } if (nbytes == 0) @@ -332,48 +352,45 @@ __libc_getutline_r (const struct utmp *line, struct utmp *buffer, /* End of file reached. */ file_unlock (file_fd); __set_errno (ESRCH); - *result = NULL; return -1; } /* Stop if we found a user or login entry. */ - if ((last_entry.ut_type == USER_PROCESS - || last_entry.ut_type == LOGIN_PROCESS) - && (strncmp (line->ut_line, last_entry.ut_line, sizeof line->ut_line) - == 0)) + if ((last_entry_type (mode) == USER_PROCESS + || last_entry_type (mode) == LOGIN_PROCESS) + && (strncmp (line, last_entry_line (mode), UT_LINESIZE) == 0)) break; } file_unlock (file_fd); - memcpy (buffer, &last_entry, sizeof (struct utmp)); - *result = buffer; + memcpy (buffer, &last_entry, last_entry_size (mode)); return 0; } - -struct utmp * -__libc_pututline (const struct utmp *data) +static bool +internal_pututline (enum operation_mode_t mode, short int type, + const char *id, const char *line, const void *data) { - if (!maybe_setutent ()) - return NULL; - - struct utmp *pbuf; + if (!maybe_setutent (mode)) + return false; if (! file_writable) { /* We must make the file descriptor writable before going on. */ - const char *file_name = utmp_file_name_time32 (__libc_utmp_file_name); + const char *file_name = mode == UTMP_TIME64 + ? __libc_utmp_file_name + : utmp_file_name_time32 (__libc_utmp_file_name); int new_fd = __open_nocancel (file_name, O_RDWR | O_LARGEFILE | O_CLOEXEC); if (new_fd == -1) - return NULL; + return false; if (__dup2 (new_fd, file_fd) < 0) { __close_nocancel_nostatus (new_fd); - return NULL; + return false; } __close_nocancel_nostatus (new_fd); file_writable = true; @@ -381,31 +398,32 @@ __libc_pututline (const struct utmp *data) /* Exclude other writers before validating the cache. */ if (try_file_lock (file_fd, F_WRLCK)) - return NULL; + return false; /* Find the correct place to insert the data. */ + const size_t utmp_size = last_entry_size (mode); bool found = false; - if (matches_last_entry (data)) + if (matches_last_entry (mode, type, id, line)) { /* Read back the entry under the write lock. */ - file_offset -= sizeof (last_entry); - ssize_t nbytes = read_last_entry (); + file_offset -= utmp_size; + ssize_t nbytes = read_last_entry (mode); if (nbytes < 0) { file_unlock (file_fd); - return NULL; + return false; } if (nbytes == 0) /* End of file reached. */ found = false; else - found = matches_last_entry (data); + found = matches_last_entry (mode, type, id, line); } if (!found) /* Search forward for the entry. */ - found = internal_getut_nolock (data) >= 0; + found = internal_getut_nolock (mode, type, id, line); off64_t write_offset; if (!found) @@ -416,26 +434,25 @@ __libc_pututline (const struct utmp *data) /* Round down to the next multiple of the entry size. This ensures any partially-written record is overwritten by the new record. */ - write_offset = (write_offset / sizeof (struct utmp) - * sizeof (struct utmp)); + write_offset = write_offset / utmp_size * utmp_size; } else /* Overwrite last_entry. */ - write_offset = file_offset - sizeof (struct utmp); + write_offset = file_offset - utmp_size; /* Write the new data. */ ssize_t nbytes; if (__lseek64 (file_fd, write_offset, SEEK_SET) < 0 - || (nbytes = __write_nocancel (file_fd, data, sizeof (struct utmp))) < 0) + || (nbytes = __write_nocancel (file_fd, data, utmp_size)) < 0) { /* There is no need to recover the file position because all reads use pread64, and any future write is preceded by another seek. */ file_unlock (file_fd); - return NULL; + return false; } - if (nbytes != sizeof (struct utmp)) + if (nbytes != utmp_size) { /* If we appended a new record this is only partially written. Remove it. */ @@ -445,30 +462,18 @@ __libc_pututline (const struct utmp *data) /* Assume that the write failure was due to missing disk space. */ __set_errno (ENOSPC); - return NULL; + return false; } file_unlock (file_fd); - file_offset = write_offset + sizeof (struct utmp); - pbuf = (struct utmp *) data; - - return pbuf; -} - + file_offset = write_offset + utmp_size; -void -__libc_endutent (void) -{ - if (file_fd >= 0) - { - __close_nocancel_nostatus (file_fd); - file_fd = -1; - } + return true; } - -int -__libc_updwtmp (const char *file, const struct utmp *utmp) +static int +internal_updwtmp (enum operation_mode_t mode, const char *file, + const void *utmp) { int result = -1; off64_t offset; @@ -487,9 +492,10 @@ __libc_updwtmp (const char *file, const struct utmp *utmp) /* Remember original size of log file. */ offset = __lseek64 (fd, 0, SEEK_END); - if (offset % sizeof (struct utmp) != 0) + const size_t utmp_size = last_entry_size (mode); + if (offset % utmp_size != 0) { - offset -= offset % sizeof (struct utmp); + offset -= offset % utmp_size; __ftruncate64 (fd, offset); if (__lseek64 (fd, 0, SEEK_END) < 0) @@ -499,8 +505,7 @@ __libc_updwtmp (const char *file, const struct utmp *utmp) /* Write the entry. If we can't write all the bytes, reset the file size back to the original size. That way, no partial entries will remain. */ - if (__write_nocancel (fd, utmp, sizeof (struct utmp)) - != sizeof (struct utmp)) + if (__write_nocancel (fd, utmp, utmp_size) != utmp_size) { __ftruncate64 (fd, offset); goto unlock_return; @@ -516,3 +521,113 @@ unlock_return: return result; } + +void +__libc_setutent (void) +{ + internal_setutent (UTMP_TIME64); +} + +void +__libc_setutent32 (void) +{ + internal_setutent (UTMP_TIME32); +} + +int +__libc_getutent_r (struct utmp *buffer, struct utmp **result) +{ + int r = internal_getutent_r (UTMP_TIME64, buffer); + *result = r == 0 ? buffer : NULL; + return r; +} + +/* For implementing this function we don't use the getutent_r function + because we can avoid the reposition on every new entry this way. */ +int +__libc_getutid_r (const struct utmp *id, struct utmp *buffer, + struct utmp **result) +{ + int r = internal_getutid_r (UTMP_TIME64, id->ut_type, id->ut_id, + id->ut_line, buffer); + *result = r == 0? buffer : NULL; + return r; +} + +/* For implementing this function we don't use the getutent_r function + because we can avoid the reposition on every new entry this way. */ +int +__libc_getutline_r (const struct utmp *line, struct utmp *buffer, + struct utmp **result) +{ + int r = internal_getutline_r (UTMP_TIME64, line->ut_line, buffer); + *result = r == 0 ? buffer : NULL; + return r; +} + +struct utmp * +__libc_pututline (const struct utmp *line) +{ + return internal_pututline (UTMP_TIME64, line->ut_type, line->ut_id, + line->ut_line, line) + ? (struct utmp *) line : NULL; +} + +void +__libc_endutent (void) +{ + if (file_fd >= 0) + { + __close_nocancel_nostatus (file_fd); + file_fd = -1; + } +} + +int +__libc_updwtmp (const char *file, const struct utmp *utmp) +{ + return internal_updwtmp (UTMP_TIME64, file, utmp); +} + +#if SHLIB_COMPAT(libc, GLIBC_2_0, UTMP_COMPAT_BASE) +int +__libc_getutent32_r (struct utmp32 *buffer, struct utmp32 **result) +{ + int r = internal_getutent_r (UTMP_TIME32, buffer); + *result = r == 0 ? buffer : NULL; + return r; +} + +int +__libc_getutid32_r (const struct utmp32 *id, struct utmp32 *buffer, + struct utmp32 **result) +{ + int r = internal_getutid_r (UTMP_TIME32, id->ut_type, id->ut_id, + id->ut_line, buffer); + *result = r == 0 ? buffer : NULL; + return r; +} + +int +__libc_getutline32_r (const struct utmp32 *line, struct utmp32 *buffer, + struct utmp32 **result) +{ + int r = internal_getutline_r (UTMP_TIME32, line->ut_line, buffer); + *result = r == 0 ? buffer : NULL; + return r; +} + +struct utmp32 * +__libc_pututline32 (const struct utmp32 *line) +{ + return internal_pututline (UTMP_TIME32, line->ut_type, line->ut_id, + line->ut_line, line) + ? (struct utmp32 *) line : NULL; +} + +int +__libc_updwtmp32 (const char *file, const struct utmp32 *utmp) +{ + return internal_updwtmp (UTMP_TIME32, file, utmp); +} +#endif diff --git a/login/utmpname.c b/login/utmpname.c index c85c27fe68..c5c5bc458a 100644 --- a/login/utmpname.c +++ b/login/utmpname.c @@ -29,6 +29,7 @@ static const char default_file_name[] = _PATH_UTMP; /* Current file name. */ const char *__libc_utmp_file_name = (const char *) default_file_name; +enum __libc_utmpname_mode_t __libc_utmpname_mode = UTMPNAME_TIME64; /* We have to use the lock in getutent_r.c. */ __libc_lock_define (extern, __libc_utmp_lock attribute_hidden) @@ -66,6 +67,13 @@ __utmpname (const char *file) } } + if (strcmp (__libc_utmp_file_name, _PATH_UTMP) == 0) + __libc_utmpname_mode = UTMPNAME_TIME64; + else if (strcmp (__libc_utmp_file_name, _PATH_UTMP_BASE) == 0) + __libc_utmpname_mode = UTMPNAME_TIME32; + else + __libc_utmpname_mode = UTMPNAME_UNDEF; + result = 0; done: diff --git a/login/utmpx32.c b/login/utmpx32.c new file mode 100644 index 0000000000..3bbfddf5fe --- /dev/null +++ b/login/utmpx32.c @@ -0,0 +1,112 @@ +/* Compability symbols for utmpx with 32-bit entry times. + Copyright (C) 2008-2021 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 +#include +#include +#include +#include + +#include +#include + +#include +#include + +#if SHLIB_COMPAT(libc, GLIBC_2_1, UTMP_COMPAT_BASE) + +# define CHECK_SIZE_AND_OFFSET(field) \ + _Static_assert (sizeof ((struct utmp32){0}.field) \ + == sizeof ((struct utmpx32){0}.field), \ + "sizeof ((struct utmp32){0}." #field " != " \ + "sizeof ((struct utmpx32){0}" #field); \ + _Static_assert (offsetof (struct utmp32, field) \ + == offsetof (struct utmpx32, field), \ + "offsetof (struct utmp32, " #field ") != " \ + "offsetof (struct utmpx32, " #field ")"); + +/* Sanity check to call the utmp symbols. */ +_Static_assert (sizeof (struct utmpx32) == sizeof (struct utmp32), + "sizeof (struct utmpx32) != sizeof (struct utmp32)"); +CHECK_SIZE_AND_OFFSET (ut_type) +CHECK_SIZE_AND_OFFSET (ut_pid) +CHECK_SIZE_AND_OFFSET (ut_line) +CHECK_SIZE_AND_OFFSET (ut_user) +CHECK_SIZE_AND_OFFSET (ut_id) +CHECK_SIZE_AND_OFFSET (ut_host) +CHECK_SIZE_AND_OFFSET (ut_tv) + +struct utmpx32 * +getutxent32 (void) +{ + return (struct utmpx32 *) __getutent32 (); +} +compat_symbol (libc, getutxent32, getutxent, GLIBC_2_1); + +struct utmpx32 * +getutxid32 (const struct utmpx32 *id) +{ + return (struct utmpx32 *) __getutid32 ((const struct utmp32 *) id); +} +compat_symbol (libc, getutxid32, getutxid, GLIBC_2_1); + +struct utmpx32 * +getutxline32 (const struct utmpx32 *line) +{ + return (struct utmpx32 *) __getutline32 ((const struct utmp32 *) line); +} +compat_symbol (libc, getutxline32, getutxline, GLIBC_2_1); + +struct utmpx32 * +pututxline32 (const struct utmpx32 *utmpx) +{ + return (struct utmpx32 *) __pututline32 ((const struct utmp32 *) utmpx); +} +compat_symbol (libc, pututxline32, pututxline, GLIBC_2_1); + +void +updwtmpx32 (const char *wtmpx_file, const struct utmpx32 *utmpx) +{ + __updwtmp32 (wtmpx_file, (const struct utmp32 *) utmpx); +} +compat_symbol (libc, updwtmpx32, updwtmpx, GLIBC_2_1); + +#endif /* SHLIB_COMPAT(libc, GLIBC_2_1_1, UTMP_COMPAT_BASE) */ + +#if SHLIB_COMPAT(libc, GLIBC_2_1_1, UTMP_COMPAT_BASE) + +void +__getutmp32 (const struct utmpx32 *utmpx, struct utmp32 *utmp) +{ + memset (utmp, 0, sizeof (struct utmpx32)); + utmp->ut_type = utmpx->ut_type; + utmp->ut_pid = utmpx->ut_pid; + memcpy (utmp->ut_line, utmpx->ut_line, sizeof (utmp->ut_line)); + memcpy (utmp->ut_user, utmpx->ut_user, sizeof (utmp->ut_user)); + memcpy (utmp->ut_id, utmpx->ut_id, sizeof (utmp->ut_id)); + memcpy (utmp->ut_host, utmpx->ut_host, sizeof (utmp->ut_host)); + utmp->ut_tv.tv_sec = utmpx->ut_tv.tv_sec; + utmp->ut_tv.tv_usec = utmpx->ut_tv.tv_usec; +} +compat_symbol (libc, __getutmp32, getutmp, GLIBC_2_1_1); + +strong_alias (__getutmp32, __getutmpx32) +compat_symbol (libc, __getutmpx32, getutmpx, GLIBC_2_1_1); + +#endif /* SHLIB_COMPAT(libc, GLIBC_2_1, UTMP_COMPAT_BASE) */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h b/login/utmpx32.h similarity index 93% rename from sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h rename to login/utmpx32.h index b9befad24e..ce1aa680a6 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.h +++ b/login/utmpx32.h @@ -36,11 +36,11 @@ struct utmpx32 char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */ struct __exit_status ut_exit; /* Exit status of a process marked as DEAD_PROCESS. */ - __int64_t ut_session; /* Session ID, used for windowing. */ + __int32_t ut_session; /* Session ID, used for windowing. */ struct { - __int64_t tv_sec; /* Seconds. */ - __int64_t tv_usec; /* Microseconds. */ + __int32_t tv_sec; /* Seconds. */ + __int32_t tv_usec; /* Microseconds. */ } ut_tv; /* Time entry was made. */ __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ diff --git a/sysdeps/generic/paths.h b/sysdeps/generic/paths.h index 99a791ce31..ab2980e14a 100644 --- a/sysdeps/generic/paths.h +++ b/sysdeps/generic/paths.h @@ -61,11 +61,12 @@ #define _PATH_TTY "/dev/tty" #define _PATH_UNIX "/vmunix" #define _PATH_UTMP_BASE "/var/run/utmp" -#define _PATH_UTMP _PATH_UTMP_BASE -#define _PATH_UTMP_DB _PATH_UTMP_BASE ".db" +#define _PATH_WUTMP_VER ".v2" +#define _PATH_UTMP _PATH_UTMP_BASE _PATH_WUTMP_VER +#define _PATH_UTMP_DB _PATH_UTMP_BASE _PATH_WUTMP_VER ".db" #define _PATH_VI "/usr/bin/vi" #define _PATH_WTMP_BASE "/var/log/wtmp" -#define _PATH_WTMP _PATH_WTMP_BASE +#define _PATH_WTMP _PATH_WTMP_BASE _PATH_WUTMP_VER /* Provide trailing slash, since mostly used for building pathnames. */ #define _PATH_DEV "/dev/" diff --git a/sysdeps/generic/utmp-compat.h b/sysdeps/generic/utmp-compat.h new file mode 100644 index 0000000000..68cc4e0f46 --- /dev/null +++ b/sysdeps/generic/utmp-compat.h @@ -0,0 +1,3 @@ +/* This macro defines the glibc version tag at which the 64 bit struct + utmp functions have been added to the 32 bit glibc. */ +#define UTMP_COMPAT_BASE GLIBC_2_34 diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index e10a286d2e..3a657d5e0d 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2204,6 +2204,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/mach/hurd/i386/libutil.abilist b/sysdeps/mach/hurd/i386/libutil.abilist index 1dd59e0afb..a64b052368 100644 --- a/sysdeps/mach/hurd/i386/libutil.abilist +++ b/sysdeps/mach/hurd/i386/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.2.6 login_tty F GLIBC_2.2.6 logout F GLIBC_2.2.6 logwtmp F GLIBC_2.2.6 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index bac795262d..4f91e85ba0 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2172,3 +2172,18 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F diff --git a/sysdeps/unix/sysv/linux/aarch64/libutil.abilist b/sysdeps/unix/sysv/linux/aarch64/libutil.abilist index 99889de22e..3294de79be 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libutil.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.17 login_tty F GLIBC_2.17 logout F GLIBC_2.17 logwtmp F GLIBC_2.17 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 897f70db22..764ea51779 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2254,6 +2254,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/alpha/libutil.abilist b/sysdeps/unix/sysv/linux/alpha/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/alpha/libutil.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index 604d259ad6..2ebd24f3a6 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -1932,3 +1932,18 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F diff --git a/sysdeps/unix/sysv/linux/arc/libutil.abilist b/sysdeps/unix/sysv/linux/arc/libutil.abilist index 61f73bc34e..6950302484 100644 --- a/sysdeps/unix/sysv/linux/arc/libutil.abilist +++ b/sysdeps/unix/sysv/linux/arc/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.32 login_tty F GLIBC_2.32 logout F GLIBC_2.32 logwtmp F GLIBC_2.32 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 094236f713..5cfcb00ddb 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -156,6 +156,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0 diff --git a/sysdeps/unix/sysv/linux/arm/be/libutil.abilist b/sysdeps/unix/sysv/linux/arm/be/libutil.abilist index cc1420e68c..d2d7724fa0 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libutil.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libutil.abilist @@ -1,3 +1,4 @@ +GLIBC_2.34 login F GLIBC_2.4 forkpty F GLIBC_2.4 login F GLIBC_2.4 login_tty F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 2bb4d31e81..d140654389 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -153,6 +153,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0 diff --git a/sysdeps/unix/sysv/linux/arm/le/libutil.abilist b/sysdeps/unix/sysv/linux/arm/le/libutil.abilist index cc1420e68c..d2d7724fa0 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libutil.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libutil.abilist @@ -1,3 +1,4 @@ +GLIBC_2.34 login F GLIBC_2.4 forkpty F GLIBC_2.4 login F GLIBC_2.4 login_tty F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index d4291fecfb..11aa688b83 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2116,3 +2116,18 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F diff --git a/sysdeps/unix/sysv/linux/csky/libutil.abilist b/sysdeps/unix/sysv/linux/csky/libutil.abilist index cbd11999a4..25006044fe 100644 --- a/sysdeps/unix/sysv/linux/csky/libutil.abilist +++ b/sysdeps/unix/sysv/linux/csky/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.29 login_tty F GLIBC_2.29 logout F GLIBC_2.29 logwtmp F GLIBC_2.29 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 1fd2a862f6..14eef860ac 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2075,6 +2075,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/hppa/libutil.abilist b/sysdeps/unix/sysv/linux/hppa/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/hppa/libutil.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 943331f01e..e1db1488a9 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2242,6 +2242,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/i386/libutil.abilist b/sysdeps/unix/sysv/linux/i386/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/i386/libutil.abilist +++ b/sysdeps/unix/sysv/linux/i386/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index f530151bde..f5b4433142 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -2107,6 +2107,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/ia64/libutil.abilist b/sysdeps/unix/sysv/linux/ia64/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/ia64/libutil.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 6e76b6dcaa..213853a1f1 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -157,6 +157,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0x98 GLIBC_2.4 _IO_2_1_stdin_ D 0x98 diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist index cc1420e68c..d2d7724fa0 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist @@ -1,3 +1,4 @@ +GLIBC_2.34 login F GLIBC_2.4 forkpty F GLIBC_2.4 login F GLIBC_2.4 login_tty F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 7541b8289f..15dda47ba8 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2187,6 +2187,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 6cf1936c42..3ffd49cbfb 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2167,3 +2167,18 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libutil.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libutil.abilist index 0da0a40c22..eef306314b 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libutil.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.18 login_tty F GLIBC_2.18 logout F GLIBC_2.18 logwtmp F GLIBC_2.18 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index 98730ebcda..2bccbe960a 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2164,3 +2164,18 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libutil.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libutil.abilist index 0da0a40c22..eef306314b 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libutil.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.18 login_tty F GLIBC_2.18 logout F GLIBC_2.18 logwtmp F GLIBC_2.18 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 92fa6cbc73..209f5f588b 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2158,6 +2158,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 265a49e74e..45d976790c 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2156,6 +2156,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist b/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index cfa5e1111b..ab3156c917 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2164,6 +2164,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index 8c03ac52cd..f8d0534156 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -2158,6 +2158,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index 17f5609e06..f56e5ad002 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2205,3 +2205,18 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F diff --git a/sysdeps/unix/sysv/linux/nios2/libutil.abilist b/sysdeps/unix/sysv/linux/nios2/libutil.abilist index 19608bd74d..7ef9a41873 100644 --- a/sysdeps/unix/sysv/linux/nios2/libutil.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.21 login_tty F GLIBC_2.21 logout F GLIBC_2.21 logwtmp F GLIBC_2.21 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/paths.h b/sysdeps/unix/sysv/linux/paths.h index 3b8aeab788..89686bcf88 100644 --- a/sysdeps/unix/sysv/linux/paths.h +++ b/sysdeps/unix/sysv/linux/paths.h @@ -62,10 +62,11 @@ #define _PATH_TTY "/dev/tty" #define _PATH_UNIX "/boot/vmlinux" #define _PATH_UTMP_BASE "/var/run/utmp" -#define _PATH_UTMP _PATH_UTMP_BASE +#define _PATH_UWTMP_VER ".v2" +#define _PATH_UTMP _PATH_UTMP_BASE _PATH_UWTMP_VER #define _PATH_VI "/usr/bin/vi" #define _PATH_WTMP_BASE "/var/log/wtmp" -#define _PATH_WTMP _PATH_WTMP_BASE +#define _PATH_WTMP _PATH_WTMP_BASE _PATH_UWTMP_VER /* Provide trailing slash, since mostly used for building pathnames. */ #define _PATH_DEV "/dev/" diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 76a16e2a6d..cfb457400c 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2214,6 +2214,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 697f072fd4..e1fd74fbad 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2247,6 +2247,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index 2647bb51f1..5c9cdb33b4 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -2077,6 +2077,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libutil.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libutil.abilist index 9cf1da7aa4..fc74cb2c77 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libutil.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.3 login_tty F GLIBC_2.3 logout F GLIBC_2.3 logwtmp F GLIBC_2.3 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index 036b1c8345..4dcac4c766 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2367,3 +2367,18 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libutil.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libutil.abilist index 99889de22e..3294de79be 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libutil.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.17 login_tty F GLIBC_2.17 logout F GLIBC_2.17 logwtmp F GLIBC_2.17 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist index ff3225e16f..69bc04c36c 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist @@ -1934,3 +1934,18 @@ GLIBC_2.33 write F GLIBC_2.33 writev F GLIBC_2.33 wscanf F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist index 59ae944bda..eded210f0b 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.33 login_tty F GLIBC_2.33 logout F GLIBC_2.33 logwtmp F GLIBC_2.33 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index fb5ad9909f..dc4a3223e6 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2134,3 +2134,18 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist index cbfec8d46e..ec3a638024 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.27 login_tty F GLIBC_2.27 logout F GLIBC_2.27 logwtmp F GLIBC_2.27 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c deleted file mode 100644 index eebccece1c..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 -#include - -#include "utmp-compat.h" -#include "utmp-private.h" - -#if defined SHARED -weak_alias (__setutent, setutent) -weak_alias (__endutent, endutent) - -# undef weak_alias -# define weak_alias(n,a) -#endif -#include "login/getutent_r.c" - -#if defined SHARED -default_symbol_version (__getutent_r, getutent_r, UTMP_COMPAT_BASE); -default_symbol_version (__pututline, pututline, UTMP_COMPAT_BASE); -#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutid.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutid.c deleted file mode 100644 index f50d633e48..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getutid.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 - -#include "utmp-compat.h" - -#if defined SHARED -# undef weak_alias -# define weak_alias(n,a) -#endif -#include "login/getutid.c" - -#if defined SHARED -default_symbol_version (__getutid, getutid, UTMP_COMPAT_BASE); -#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c deleted file mode 100644 index 5039b99a94..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 -#include -#include - -#include "utmp-compat.h" -#include "utmp-private.h" - -#if defined SHARED -# undef weak_alias -# define weak_alias(n,a) -#endif -#include "login/getutid_r.c" - -#if defined SHARED -default_symbol_version (__getutid_r, getutid_r, UTMP_COMPAT_BASE); -#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutline.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutline.c deleted file mode 100644 index 32b39575b0..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getutline.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 - -#include "utmp-compat.h" - -#if defined SHARED -# undef weak_alias -# define weak_alias(n,a) -#endif -#include "login/getutline.c" - -#if defined SHARED -default_symbol_version (__getutline, getutline, UTMP_COMPAT_BASE); -#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c deleted file mode 100644 index c9238c5f60..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 -#include - -#include "utmp-compat.h" -#include "utmp-private.h" - -#if defined SHARED -# undef weak_alias -# define weak_alias(n,a) -#endif -#include "login/getutline_r.c" - -#if defined SHARED -default_symbol_version (__getutline_r, getutline_r, UTMP_COMPAT_BASE);; -#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c deleted file mode 100644 index 6ffea2a553..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getutmp.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 - . */ - -#undef weak_alias -#define weak_alias(a, b) -#undef strong_alias -#define strong_alias(a, b) - -#include - -#include "utmp-compat.h" - -default_symbol_version (__getutmp, getutmp, UTMP_COMPAT_BASE); -_strong_alias (__getutmp, __getutmpx) -default_symbol_version (__getutmpx, getutmpx, UTMP_COMPAT_BASE); diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c deleted file mode 100644 index d91795af78..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getutxent.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 - -#include "utmp-compat.h" - -#undef weak_alias -#define weak_alias(n,a) -#define getutxent __getutxent -#include "login/getutxent.c" -#undef getutxent - -default_symbol_version (__getutxent, getutxent, UTMP_COMPAT_BASE); diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c deleted file mode 100644 index d5d457d98d..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getutxid.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 - -#include "utmp-compat.h" - -#undef weak_alias -#define weak_alias(n,a) -#define getutxid __getutxid -#include "login/getutxid.c" -#undef getutxid - -default_symbol_version (__getutxid, getutxid, UTMP_COMPAT_BASE); diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c b/sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c deleted file mode 100644 index ab0189f653..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/getutxline.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 - -#include "utmp-compat.h" - -#undef weak_alias -#define weak_alias(n,a) -#define getutxline __getutxline -#include "login/getutxline.c" -#undef getutxline - -default_symbol_version (__getutxline, getutxline, UTMP_COMPAT_BASE); diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/login.c b/sysdeps/unix/sysv/linux/s390/s390-32/login.c deleted file mode 100644 index 5df028298a..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/login.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 -#include -#include -#include -#include -#include - -#include "utmp-compat.h" - -#undef weak_alias -#define weak_alias(n,a) -#define login __login -#include "login/login.c" -#undef login - -default_symbol_version (__login, login, UTMP_COMPAT_BASE); diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c b/sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c deleted file mode 100644 index 1dfabc8f37..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/pututxline.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 - -#include "utmp-compat.h" - -#undef weak_alias -#define weak_alias(n,a) -#define pututxline __pututxline -#include "login/pututxline.c" -#undef pututxline - -default_symbol_version (__pututxline, pututxline, UTMP_COMPAT_BASE); diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c deleted file mode 100644 index 7ef8e85c00..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmp.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 "utmp-compat.h" -#include "utmp-private.h" - -#if defined SHARED -# undef weak_alias -# define weak_alias(n,a) -#endif -#include - -#if defined SHARED -default_symbol_version (__updwtmp, updwtmp, UTMP_COMPAT_BASE); -#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c b/sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c deleted file mode 100644 index 51cf1f5ae3..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/updwtmpx.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 - -#include "utmp-compat.h" - -#undef weak_alias -#define weak_alias(n,a) -#define updwtmpx __updwtmpx -#include "login/updwtmpx.c" -#undef updwtmpx - -default_symbol_version (__updwtmpx, updwtmpx, UTMP_COMPAT_BASE); diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h b/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h index 28632f72bd..dc4c926cca 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h +++ b/sysdeps/unix/sysv/linux/s390/s390-32/utmp-compat.h @@ -18,4 +18,4 @@ /* This macro defines the glibc version tag at which the 64 bit struct utmp functions have been added to the 32 bit glibc. */ -#define UTMP_COMPAT_BASE GLIBC_2.9 +#define UTMP_COMPAT_BASE GLIBC_2_9 diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c b/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c deleted file mode 100644 index 32496e5421..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/utmp32.c +++ /dev/null @@ -1,184 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 -#include -#include - -#include "utmp32.h" -#include "utmp-convert.h" - -/* Allocate a static buffer to be returned to the caller. As well as - with the existing version of these functions the caller has to be - aware that the contents of this buffer will change with subsequent - calls. */ -#define ALLOCATE_UTMP32_OUT(OUT) \ - static struct utmp32 *OUT = NULL; \ - \ - if (OUT == NULL) \ - { \ - OUT = malloc (sizeof (struct utmp32)); \ - if (OUT == NULL) \ - return NULL; \ - } - -/* Perform a lookup for a utmp entry matching FIELD using function - FUNC. FIELD is converted to a 64 bit utmp and the result is - converted back to 32 bit utmp. */ -#define ACCESS_UTMP_ENTRY(FUNC, FIELD) \ - struct utmp in64; \ - struct utmp *out64; \ - ALLOCATE_UTMP32_OUT (out32); \ - \ - utmp_convert32to64 (FIELD, &in64); \ - out64 = FUNC (&in64); \ - \ - if (out64 == NULL) \ - return NULL; \ - \ - utmp_convert64to32 (out64, out32); \ - \ - return out32; - -/* Search forward from the current point in the utmp file until the - next entry with a ut_type matching ID->ut_type. */ -struct utmp32 * -getutid32 (const struct utmp32 *id) -{ - ACCESS_UTMP_ENTRY (__getutid, id) -} -symbol_version (getutid32, getutid, GLIBC_2.0); - -/* Search forward from the current point in the utmp file until the - next entry with a ut_line matching LINE->ut_line. */ -struct utmp32 * -getutline32 (const struct utmp32 *line) -{ - ACCESS_UTMP_ENTRY (__getutline, line) -} -symbol_version (getutline32, getutline, GLIBC_2.0); - -/* Write out entry pointed to by UTMP_PTR into the utmp file. */ -struct utmp32 * -pututline32 (const struct utmp32 *utmp_ptr) -{ - ACCESS_UTMP_ENTRY (__pututline, utmp_ptr) -} -symbol_version (pututline32, pututline, GLIBC_2.0); - -/* Read next entry from a utmp-like file. */ -struct utmp32 * -getutent32 (void) -{ - struct utmp *out64; - ALLOCATE_UTMP32_OUT (out32); - - out64 = __getutent (); - if (!out64) - return NULL; - - utmp_convert64to32 (out64, out32); - return out32; -} -symbol_version (getutent32, getutent, GLIBC_2.0); - -/* Reentrant versions of the file for handling utmp files. */ - -int -getutent32_r (struct utmp32 *buffer, struct utmp32 **result) -{ - struct utmp out64; - struct utmp *out64p; - int ret; - - ret = __getutent_r (&out64, &out64p); - if (ret == -1) - { - *result = NULL; - return -1; - } - - utmp_convert64to32 (out64p, buffer); - *result = buffer; - - return 0; -} -symbol_version (getutent32_r, getutent_r, GLIBC_2.0); - -int -getutid32_r (const struct utmp32 *id, struct utmp32 *buffer, - struct utmp32 **result) -{ - struct utmp in64; - struct utmp out64; - struct utmp *out64p; - int ret; - - utmp_convert32to64 (id, &in64); - - ret = __getutid_r (&in64, &out64, &out64p); - if (ret == -1) - { - *result = NULL; - return -1; - } - - utmp_convert64to32 (out64p, buffer); - *result = buffer; - - return 0; -} -symbol_version (getutid32_r, getutid_r, GLIBC_2.0); - -int -getutline32_r (const struct utmp32 *line, - struct utmp32 *buffer, struct utmp32 **result) -{ - struct utmp in64; - struct utmp out64; - struct utmp *out64p; - int ret; - - utmp_convert32to64 (line, &in64); - - ret = __getutline_r (&in64, &out64, &out64p); - if (ret == -1) - { - *result = NULL; - return -1; - } - - utmp_convert64to32 (out64p, buffer); - *result = buffer; - - return 0; - -} -symbol_version (getutline32_r, getutline_r, GLIBC_2.0); - -/* Append entry UTMP to the wtmp-like file WTMP_FILE. */ -void -updwtmp32 (const char *wtmp_file, const struct utmp32 *utmp) -{ - struct utmp in32; - - utmp_convert32to64 (utmp, &in32); - __updwtmp (wtmp_file, &in32); -} -symbol_version (updwtmp32, updwtmp, GLIBC_2.0); diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h deleted file mode 100644 index ad7de5c455..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx-convert.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 - . */ - - -/* This file provides functions converting between the 32 and 64 bit - struct utmp variants. */ - -#ifndef _UTMPX_CONVERT_H -#define _UTMPX_CONVERT_H 1 - -#include -#include "utmpx32.h" - -/* Convert the 64 bit struct utmpx value in FROM to the 32 bit version - returned in TO. */ -static inline void -utmpx_convert64to32 (const struct utmpx *from, struct utmpx32 *to) -{ -#if _HAVE_UT_TYPE - 0 - to->ut_type = from->ut_type; -#endif -#if _HAVE_UT_PID - 0 - to->ut_pid = from->ut_pid; -#endif - memcpy (to->ut_line, from->ut_line, __UT_LINESIZE); - memcpy (to->ut_user, from->ut_user, __UT_NAMESIZE); -#if _HAVE_UT_ID - 0 - memcpy (to->ut_id, from->ut_id, 4); -#endif -#if _HAVE_UT_HOST - 0 - memcpy (to->ut_host, from->ut_host, __UT_HOSTSIZE); -#endif - to->ut_exit = from->ut_exit; - to->ut_session = (int32_t) from->ut_session; -#if _HAVE_UT_TV - 0 - to->ut_tv.tv_sec = (int32_t) from->ut_tv.tv_sec; - to->ut_tv.tv_usec = (int32_t) from->ut_tv.tv_usec; -#endif - memcpy (to->ut_addr_v6, from->ut_addr_v6, 4 * 4); -} - -/* Convert the 32 bit struct utmpx value in FROM to the 64 bit version - returned in TO. */ -static inline void -utmpx_convert32to64 (const struct utmpx32 *from, struct utmpx *to) -{ -#if _HAVE_UT_TYPE - 0 - to->ut_type = from->ut_type; -#endif -#if _HAVE_UT_PID - 0 - to->ut_pid = from->ut_pid; -#endif - memcpy (to->ut_line, from->ut_line, __UT_LINESIZE); - memcpy (to->ut_user, from->ut_user, __UT_NAMESIZE); -#if _HAVE_UT_ID - 0 - memcpy (to->ut_id, from->ut_id, 4); -#endif -#if _HAVE_UT_HOST - 0 - memcpy (to->ut_host, from->ut_host, __UT_HOSTSIZE); -#endif - to->ut_exit = from->ut_exit; - to->ut_session = (int64_t) from->ut_session; -#if _HAVE_UT_TV - 0 - to->ut_tv.tv_sec = (int64_t) from->ut_tv.tv_sec; - to->ut_tv.tv_usec = (int64_t) from->ut_tv.tv_usec; -#endif - memcpy (to->ut_addr_v6, from->ut_addr_v6, 4 * 4); -} - -#endif /* utmpx-convert.h */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c b/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c deleted file mode 100644 index ed970961bf..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/utmpx32.c +++ /dev/null @@ -1,139 +0,0 @@ -/* Copyright (C) 2008-2021 Free Software Foundation, Inc. - Contributed by Andreas Krebbel . - 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 -#include -#include - -#include "utmp32.h" -#include "utmp-convert.h" - -#include "utmpx32.h" -#include "utmpx-convert.h" - -/* Allocate a static buffer to be returned to the caller. As well as - with the existing version of these functions the caller has to be - aware that the contents of this buffer will change with subsequent - calls. */ -#define ALLOCATE_UTMPX32_OUT(OUT) \ - static struct utmpx32 *OUT = NULL; \ - \ - if (OUT == NULL) \ - { \ - OUT = malloc (sizeof (struct utmpx32)); \ - if (OUT == NULL) \ - return NULL; \ - } - -/* Perform a lookup for a utmpx entry matching FIELD using function - FUNC. FIELD is converted to a 64 bit utmpx and the result is - converted back to 32 bit utmpx. */ -#define ACCESS_UTMPX_ENTRY(FUNC, FIELD) \ - struct utmpx in64; \ - struct utmpx *out64; \ - ALLOCATE_UTMPX32_OUT (out32); \ - \ - utmpx_convert32to64 (FIELD, &in64); \ - out64 = FUNC (&in64); \ - \ - if (out64 == NULL) \ - return NULL; \ - \ - utmpx_convert64to32 (out64, out32); \ - \ - return out32; - - -/* Get the next entry from the user accounting database. */ -struct utmpx32 * -getutxent32 (void) -{ - struct utmpx *out64; - ALLOCATE_UTMPX32_OUT (out32); - - out64 = __getutxent (); - if (!out64) - return NULL; - - utmpx_convert64to32 (out64, out32); - return out32; - -} -symbol_version (getutxent32, getutxent, GLIBC_2.1); - -/* Get the user accounting database entry corresponding to ID. */ -struct utmpx32 * -getutxid32 (const struct utmpx32 *id) -{ - ACCESS_UTMPX_ENTRY (__getutxid, id); -} -symbol_version (getutxid32, getutxid, GLIBC_2.1); - -/* Get the user accounting database entry corresponding to LINE. */ -struct utmpx32 * -getutxline32 (const struct utmpx32 *line) -{ - ACCESS_UTMPX_ENTRY (__getutxline, line); -} -symbol_version (getutxline32, getutxline, GLIBC_2.1); - -/* Write the entry UTMPX into the user accounting database. */ -struct utmpx32 * -pututxline32 (const struct utmpx32 *utmpx) -{ - ACCESS_UTMPX_ENTRY (__pututxline, utmpx); -} -symbol_version (pututxline32, pututxline, GLIBC_2.1); - -/* Append entry UTMP to the wtmpx-like file WTMPX_FILE. */ -void -updwtmpx32 (const char *wtmpx_file, const struct utmpx32 *utmpx) -{ - struct utmpx in64; - - utmpx_convert32to64 (utmpx, &in64); - __updwtmpx (wtmpx_file, &in64); -} -symbol_version (updwtmpx32, updwtmpx, GLIBC_2.1); - -/* Copy the information in UTMPX to UTMP. */ -void -getutmp32 (const struct utmpx32 *utmpx, struct utmp32 *utmp) -{ - struct utmpx in64; - struct utmp out64; - - utmpx_convert32to64 (utmpx, &in64); - __getutmp (&in64, &out64); - utmp_convert64to32 (&out64, utmp); -} -symbol_version (getutmp32, getutmp, GLIBC_2.1.1); - -/* Copy the information in UTMP to UTMPX. */ -void -getutmpx32 (const struct utmp32 *utmp, struct utmpx32 *utmpx) -{ - struct utmp in64; - struct utmpx out64; - - utmp_convert32to64 (utmp, &in64); - __getutmpx (&in64, &out64); - utmpx_convert64to32 (&out64, utmpx); -} -symbol_version (getutmpx32, getutmpx, GLIBC_2.1.1); diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/utmp-compat.h b/sysdeps/unix/sysv/linux/s390/s390-64/utmp-compat.h new file mode 100644 index 0000000000..fee4b80cc0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-64/utmp-compat.h @@ -0,0 +1,3 @@ +/* s390x already has 64-bit time for struct utmp{x} and lastlog. This define + disable the compat symbols and support to 32-bit entries. */ +#define UTMP_COMPAT_BASE GLIBC_2_0 diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index a3a8be8910..6deb52d706 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2082,6 +2082,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/sh/be/libutil.abilist b/sysdeps/unix/sysv/linux/sh/be/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libutil.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 8f505c5045..17a141d5b9 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2079,6 +2079,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/sh/le/libutil.abilist b/sysdeps/unix/sysv/linux/sh/le/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libutil.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 53ef6304f1..b64b351797 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2203,6 +2203,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index eba0cb156d..e3e01c29fc 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -2130,6 +2130,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist index aa2d35b323..fbff40d968 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.0 login_tty F GLIBC_2.0 logout F GLIBC_2.0 logwtmp F GLIBC_2.0 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/utmp-path.h b/sysdeps/unix/sysv/linux/utmp-path.h index f39222d62f..3cbcf24a41 100644 --- a/sysdeps/unix/sysv/linux/utmp-path.h +++ b/sysdeps/unix/sysv/linux/utmp-path.h @@ -19,9 +19,8 @@ #ifndef _UTMP_PATH_H #define _UTMP_PATH_H 1 -#include #include - +#include /* The function returns the utmp database for 32-bit utmp{x} entries based on FILE_NAME: diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 17ce5dfd58..9995da84a8 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -2089,6 +2089,21 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist index 1356ed4115..f68fa6e9ba 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.2.5 login_tty F GLIBC_2.2.5 logout F GLIBC_2.2.5 logwtmp F GLIBC_2.2.5 openpty F +GLIBC_2.34 login F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index 17a1c83903..adccf45120 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2186,3 +2186,18 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 getutent F +GLIBC_2.34 getutent_r F +GLIBC_2.34 getutid F +GLIBC_2.34 getutid_r F +GLIBC_2.34 getutline F +GLIBC_2.34 getutline_r F +GLIBC_2.34 getutmp F +GLIBC_2.34 getutmpx F +GLIBC_2.34 getutxent F +GLIBC_2.34 getutxid F +GLIBC_2.34 getutxline F +GLIBC_2.34 pututline F +GLIBC_2.34 pututxline F +GLIBC_2.34 updwtmp F +GLIBC_2.34 updwtmpx F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist index cff23106f5..5a66c2b333 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist @@ -4,3 +4,4 @@ GLIBC_2.16 login_tty F GLIBC_2.16 logout F GLIBC_2.16 logwtmp F GLIBC_2.16 openpty F +GLIBC_2.34 login F From patchwork Fri Mar 5 20:14:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42302 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 EC306399C037; Fri, 5 Mar 2021 20:15:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC306399C037 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975352; bh=rLyMxChGAwfT8ViPC1zThax+pyHuxeqDi0CyoG/0EDI=; 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=JFjuIvWxWb6KuNSq5zyYLYAU+XjYdm3hcSjz/cQ2TCgkoLkHeU4tTIhAmhhU6+zz6 pInbU0NPBI2velUdtA7kxPUkTt8OAz9QYbSFLJ3Vz5fxARITQAcaCHrD6zw+PKkhJh 8+3MlcWm3OoNAGdaj7er9gg8W01uTvZHfQKSwxeE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by sourceware.org (Postfix) with ESMTPS id E0DD1399C029 for ; Fri, 5 Mar 2021 20:15:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E0DD1399C029 Received: by mail-qv1-xf30.google.com with SMTP id h7so1638399qvm.2 for ; Fri, 05 Mar 2021 12:15:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rLyMxChGAwfT8ViPC1zThax+pyHuxeqDi0CyoG/0EDI=; b=WAHiJPxpAhiDYaxsCgHYaX1YOCsL4ZXzEgfBOWaYVpf+BPHmzBeP5ybD0RU/35Asvu oGU2fJlxo84/w2pf7UQQ3JhfaCJOqqZgA0gxgJ/tVt8/zrh+bbLujkX94T+0bAm9FS22 AkILuUXxRC6cYuQgnJjqXrUG68CtVl4uvEjdlvTun/qE0Lic25KZRg3YjOn+fmJgSII3 W5eSLAstsGerXC4i+Zn7JKOR1r/lwgBH1O84utxoOrisD8HnxEKSJJx8+Ze7MI/UGyrC KnnP3iaqRpx+DLATlnG14uPH0bxPrw1RwMLrnGAPZNJEDfPUf9V/fKnz9MkI83nZ9Hbc wMEA== X-Gm-Message-State: AOAM530iPEebIEsniTSuqhucSHKLNQmUKwsgcfQHtOTP20skOhAaVL3Q IWH+KReHwNE6yg69MgWG/Opmix5ejEl8Tw== X-Google-Smtp-Source: ABdhPJzUb2gYpEalmilT2/AgynyzuYLm+tunkPv1bS0mDSL50zKvrMeHR/5tISPE+pFzj6hu9YWFpw== X-Received: by 2002:ad4:5ecc:: with SMTP id jm12mr10675308qvb.33.1614975348383; Fri, 05 Mar 2021 12:15:48 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:48 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 21/52] linux: Add pwrite64_nocancel Date: Fri, 5 Mar 2021 17:14:47 -0300 Message-Id: <20210305201518.798584-22-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It is not used internally yet. --- sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/not-cancel.h | 4 +++ sysdeps/unix/sysv/linux/pwrite64_nocancel.c | 29 +++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 sysdeps/unix/sysv/linux/pwrite64_nocancel.c diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index b206f77594..7b3bb30da2 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -280,7 +280,7 @@ sysdep_routines += xstatconv internal_statvfs \ close_nocancel fcntl_nocancel \ open_nocancel open64_nocancel \ openat_nocancel openat64_nocancel \ - read_nocancel pread64_nocancel \ + read_nocancel pread64_nocancel pwrite64_nocancel \ write_nocancel statx_cp stat_t64_cp sysdep_headers += bits/fcntl-linux.h diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h index f06d57426a..27bb3811af 100644 --- a/sysdeps/unix/sysv/linux/not-cancel.h +++ b/sysdeps/unix/sysv/linux/not-cancel.h @@ -46,6 +46,9 @@ __typeof (__read) __read_nocancel; /* Non cancellable pread syscall (LFS version). */ __typeof (__pread64) __pread64_nocancel; +/* Non cancellable pwrite syscall (LFS version). */ +__typeof (__pwrite64) __pwrite64_nocancel; + /* Uncancelable write. */ __typeof (__write) __write_nocancel; @@ -78,6 +81,7 @@ hidden_proto (__openat_nocancel) hidden_proto (__openat64_nocancel) hidden_proto (__read_nocancel) hidden_proto (__pread64_nocancel) +hidden_proto (__pwrite64_nocancel) hidden_proto (__write_nocancel) hidden_proto (__close_nocancel) hidden_proto (__fcntl64_nocancel) diff --git a/sysdeps/unix/sysv/linux/pwrite64_nocancel.c b/sysdeps/unix/sysv/linux/pwrite64_nocancel.c new file mode 100644 index 0000000000..06d0ae14d0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/pwrite64_nocancel.c @@ -0,0 +1,29 @@ +/* Linux pwrite64() syscall implementation -- non-cancellable. + Copyright (C) 2020 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 +#include + +ssize_t +__pwrite64_nocancel (int fd, const void *buf, size_t count, off64_t offset) +{ + return INLINE_SYSCALL_CALL (pwrite64, fd, buf, count, + SYSCALL_LL64_PRW (offset)); +} +hidden_def (__pwrite64_nocancel) From patchwork Fri Mar 5 20:14:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42304 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 11638399C025; Fri, 5 Mar 2021 20:15:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11638399C025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975356; bh=oL+7pevU/Apg55Jm0kFDGdPTSwjozYSMscKrr1cUxrg=; 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=OZUkTdUhlZbqeYDMuXHkjJKhYBxOoI7sLL5r3sj7fjlStdUFiNuT7TVFS90MFIjtV bkzm+SZaMSwk+D3DgDDhII7qXlcbgw4fEKSUQlH1plDYuf563lypNVcLbTHkAetTjz ESEYK1rQYX+/4lKBMG1PL5fMt318KUpTyrc/w5+g= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by sourceware.org (Postfix) with ESMTPS id 095CD399C029 for ; Fri, 5 Mar 2021 20:15:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 095CD399C029 Received: by mail-qt1-x835.google.com with SMTP id v3so2779575qtw.4 for ; Fri, 05 Mar 2021 12:15:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oL+7pevU/Apg55Jm0kFDGdPTSwjozYSMscKrr1cUxrg=; b=nfzl2wj2W7Jr1nb++2Q+uXs7GJcjEa9A+hqSvAAstNaP8tpNnrMk5osNmcBRdZ8Ouf HF6juwiLLOMUjjyELkC1F5CIGCsjweaDtbABp04W3Ih3VP4BwOmRcRGZSI+N/o3+RxN8 uYEgMoJZ+P17WTelTv+ATM7TxHTnwwyTcbsToP21DvqNewq8wD3s69UfyM3hAE8J7mf/ LSgvxrORT3lac3vvJQB9+i72VhoTECQZ04AKkKjfT4LMtsRsXqBLXUv4Yex6UgLzF5CJ m4ia27+Ks79b4mj40xZQfjlQmRw7Y2UY79zH/BrdcC4pGTHXkk6gJo75SbCK9D24g8J0 UWtQ== X-Gm-Message-State: AOAM532tz5ZrHOoHaRWn1ty8YfW1NcAsyicYNP7i77wPPM4uWLK1Zncd DYdIeIdHUfxesImQL2n6u3Sb3NNyHlA49g== X-Google-Smtp-Source: ABdhPJzEtqApb2KD3THfMvFJpS9hZQKIecndG88HcyapvCBaRsgj/fuDr0s/+HaM7z5Vs4LBxyTWuw== X-Received: by 2002:ac8:578f:: with SMTP id v15mr10235814qta.172.1614975349557; Fri, 05 Mar 2021 12:15:49 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:49 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 22/52] login: Use 64-bit time on struct lastlog [BZ #25844] Date: Fri, 5 Mar 2021 17:14:48 -0300 Message-Id: <20210305201518.798584-23-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The new struct has the same size on both 32-bit and 64-bit architectures. As for utmp{x} 64-bit time_t support, a new file name is defined for _PATH_LASTLOG. Also two new symbols are added that read/write 'struct lastlog' entries, 'lastlog_read' and 'lastlog_write'. Both are GNU extensions and handle the 32-bit entry operation if the argument is the old _PATH_LASTLOG path. Different than utmp{x}, no concurrent access is done (such as advisory locking). I modeled these function on how program that access lastlog file uses (such as shadow-utils and util-linux). The s390 is the only architecture that already defined the 'struct lastlog' with 64-bit time_t and to handle s390 has a specific lastlog-compat.h header where 'is_path_lastlog_compat' already return false (thus making both lastlog_read and lastlog_write always read/write registers with 64-bit ll_time). It also fixes BZ#25844 by adding the __attribute_nonstring__ on ll_line and ll_host. Checked on x86_64-linux-gnu and i686-linux-gnu. --- bits/types/struct_lastlog.h | 10 +-- login/Makefile | 4 +- login/Versions | 2 + .../lastlog-compat.h | 25 +++--- login/lastlog_read.c | 78 ++++++++++++++++++ login/lastlog_write.c | 64 +++++++++++++++ login/tst-lastlog.c | 80 +++++++++++++++++++ login/tst-lastlog.root/tst-lastlog.script | 6 ++ login/utmp.h | 11 +++ sysdeps/generic/paths.h | 3 +- sysdeps/mach/hurd/i386/libc.abilist | 2 + sysdeps/unix/sysv/linux/aarch64/libc.abilist | 2 + sysdeps/unix/sysv/linux/alpha/libc.abilist | 2 + sysdeps/unix/sysv/linux/arc/libc.abilist | 2 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 2 + sysdeps/unix/sysv/linux/csky/libc.abilist | 2 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 2 + sysdeps/unix/sysv/linux/i386/libc.abilist | 2 + sysdeps/unix/sysv/linux/ia64/libc.abilist | 2 + .../sysv/linux/m68k/coldfire/libc.abilist | 2 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 2 + .../sysv/linux/microblaze/be/libc.abilist | 2 + .../sysv/linux/microblaze/le/libc.abilist | 2 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 2 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 2 + .../sysv/linux/mips/mips64/n32/libc.abilist | 2 + .../sysv/linux/mips/mips64/n64/libc.abilist | 2 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 2 + sysdeps/unix/sysv/linux/paths.h | 3 +- .../linux/powerpc/powerpc32/fpu/libc.abilist | 2 + .../powerpc/powerpc32/nofpu/libc.abilist | 2 + .../linux/powerpc/powerpc64/be/libc.abilist | 2 + .../linux/powerpc/powerpc64/le/libc.abilist | 2 + .../unix/sysv/linux/riscv/rv32/libc.abilist | 2 + .../unix/sysv/linux/riscv/rv64/libc.abilist | 2 + sysdeps/unix/sysv/linux/s390/lastlog-compat.h | 38 +++++++++ .../unix/sysv/linux/s390/s390-32/libc.abilist | 2 + .../unix/sysv/linux/s390/s390-64/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 2 + .../sysv/linux/sparc/sparc32/libc.abilist | 2 + .../sysv/linux/sparc/sparc64/libc.abilist | 2 + .../unix/sysv/linux/x86_64/64/libc.abilist | 2 + .../unix/sysv/linux/x86_64/x32/libc.abilist | 2 + 45 files changed, 369 insertions(+), 21 deletions(-) rename sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h => login/lastlog-compat.h (77%) create mode 100644 login/lastlog_read.c create mode 100644 login/lastlog_write.c create mode 100644 login/tst-lastlog.c create mode 100644 login/tst-lastlog.root/tst-lastlog.script create mode 100644 sysdeps/unix/sysv/linux/s390/lastlog-compat.h diff --git a/bits/types/struct_lastlog.h b/bits/types/struct_lastlog.h index bde4dd2ad0..d267a24b1b 100644 --- a/bits/types/struct_lastlog.h +++ b/bits/types/struct_lastlog.h @@ -24,11 +24,7 @@ previous logins. */ struct lastlog { -#if __WORDSIZE_TIME64_COMPAT32 - int32_t ll_time; -#else - __time_t ll_time; -#endif - char ll_line[UT_LINESIZE]; - char ll_host[UT_HOSTSIZE]; + int64_t ll_time; + char ll_line[UT_LINESIZE] __attribute_nonstring__; + char ll_host[UT_HOSTSIZE] __attribute_nonstring__; }; diff --git a/login/Makefile b/login/Makefile index 794d061604..7d273d95bc 100644 --- a/login/Makefile +++ b/login/Makefile @@ -31,7 +31,8 @@ headers := utmp.h bits/utmp.h lastlog.h pty.h \ routines := getlogin getlogin_r setlogin getlogin_r_chk \ getutent getutent_r getutid getutline getutid_r getutline_r \ utmp_file utmpname updwtmp getpt grantpt unlockpt ptsname \ - ptsname_r_chk utmp32 utmpx32 utmp-convert + ptsname_r_chk utmp32 utmpx32 utmp-convert \ + lastlog_read lastlog_write CFLAGS-grantpt.c += -DLIBEXECDIR='"$(libexecdir)"' @@ -53,6 +54,7 @@ ifeq ($(have-GLIBC_2.33),yes) tests-container-internal := tst-utmp32 tests-container := tst-utmp-default endif +tests-container += tst-lastlog # Build the -lutil library with these extra functions. extra-libs := libutil diff --git a/login/Versions b/login/Versions index d28ecdca9f..5751fdcb71 100644 --- a/login/Versions +++ b/login/Versions @@ -57,6 +57,8 @@ libc { getutxent; getutxid; getutxline; + lastlog_read; + lastlog_write; pututline; pututxline; updwtmp; diff --git a/sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h b/login/lastlog-compat.h similarity index 77% rename from sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h rename to login/lastlog-compat.h index 4faa9922f4..00403dd19a 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/struct_lastlog.h +++ b/login/lastlog-compat.h @@ -16,19 +16,22 @@ License along with the GNU C Library; if not, see . */ -#ifndef _UTMP_H -# error "Never include directly; use instead." -#endif +#ifndef _LASTLOG_COMPAT_H +#define _LASTLOG_COMPAT_H 1 + +#include -/* The structure describing an entry in the database of - previous logins. */ -struct lastlog +struct lastlog_compat { -#if __WORDSIZE == 32 - int64_t ll_time; -#else - __time_t ll_time; -#endif + int32_t ll_time; char ll_line[UT_LINESIZE]; char ll_host[UT_HOSTSIZE]; }; + +static inline bool +is_path_lastlog_compat (const char *file) +{ + return strcmp (file, "/var/log/lastlog") == 0; +} + +#endif diff --git a/login/lastlog_read.c b/login/lastlog_read.c new file mode 100644 index 0000000000..9880afdf00 --- /dev/null +++ b/login/lastlog_read.c @@ -0,0 +1,78 @@ +/* Read a lastlog entry. + Copyright (C) 2021 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 +#include +#include +#include + +ssize_t +lastlog_read (const char *file, uid_t uid, struct lastlog *ll) +{ + int fd = __open_nocancel (file, O_RDONLY | O_LARGEFILE | O_CLOEXEC); + if (fd == -1) + return -1; + + size_t llsize; + void *data; + +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33) + struct lastlog_compat llcompat; + if (is_path_lastlog_compat (file)) + { + llsize = sizeof (struct lastlog_compat); + data = &llcompat; + } + else +#endif + { + llsize = sizeof (struct lastlog); + data = ll; + } + + off64_t off = llsize * uid; + ssize_t r = __pread64_nocancel (fd, data, llsize, off); + __close_nocancel_nostatus (fd); + +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33) + if (r == llsize && data == &llcompat) + { + ll->ll_time = llcompat.ll_time; + memcpy (ll->ll_line, llcompat.ll_line, UT_LINESIZE); + memcpy (ll->ll_host, llcompat.ll_host, UT_HOSTSIZE); + } +#endif + + if (r == llsize) + { +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33) + if (data == &llcompat) + { + ll->ll_time = llcompat.ll_time; + memcpy (ll->ll_line, llcompat.ll_line, UT_LINESIZE); + memcpy (ll->ll_host, llcompat.ll_host, UT_HOSTSIZE); + } +#endif + /* We need to return the expected 'struct lastlog' size in case of + success. */ + r = sizeof (struct lastlog); + } + + return r; +} diff --git a/login/lastlog_write.c b/login/lastlog_write.c new file mode 100644 index 0000000000..37bad677d0 --- /dev/null +++ b/login/lastlog_write.c @@ -0,0 +1,64 @@ +/* Write a lastlog entry. + Copyright (C) 2021 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 +#include +#include +#include + +ssize_t +lastlog_write (const char *file, uid_t uid, const struct lastlog *ll) +{ + int fd = __open_nocancel (file, O_WRONLY | O_LARGEFILE | O_CLOEXEC); + if (fd == -1) + return -1; + + size_t llsize; + const void *data; + +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33) + struct lastlog_compat llcompat; + if (is_path_lastlog_compat (file)) + { + llcompat.ll_time = ll->ll_time; + memcpy (llcompat.ll_line, ll->ll_line, UT_LINESIZE); + memcpy (llcompat.ll_host, ll->ll_host, UT_HOSTSIZE); + llsize = sizeof (struct lastlog_compat); + data = &llcompat; + } + else +#endif + { + llsize = sizeof (struct lastlog); + data = ll; + } + + off64_t off = llsize * uid; + ssize_t r = __pwrite64_nocancel (fd, data, llsize, off); + __close_nocancel_nostatus (fd); + + /* We need to return the expected 'struct lastlog' size in case of + success. */ +#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33) + if (r == llsize && data == &llcompat) + r = sizeof (struct lastlog); +#endif + + return r; +} diff --git a/login/tst-lastlog.c b/login/tst-lastlog.c new file mode 100644 index 0000000000..f36602df3e --- /dev/null +++ b/login/tst-lastlog.c @@ -0,0 +1,80 @@ +/* Tests for lastlog read/write functions. + Copyright (C) 2021 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 +#include + +#include +#include + +#include + +static struct +{ + uid_t uid; + struct lastlog ll; +} entry[] = +{ + { 0, { .ll_time = 1000, .ll_line = "tty1" } }, + { 1000, { .ll_time = 2000, .ll_line = "pts/0", .ll_host = "127.0.0.1" } }, + { 20, { .ll_time = 3000, .ll_line = "pts/1", .ll_host = "192.168.0.1" } }, + { 30, { .ll_time = 4000, .ll_line = "tty2" } }, +}; +const size_t entry_size = sizeof (entry) / sizeof (entry[0]); + +static void +run_test (const char *filename) +{ + for (int n = 0; n < entry_size; n++) + TEST_COMPARE (lastlog_write (filename, entry[n].uid, &entry[n].ll), + sizeof (struct lastlog)); + + for (int n = 0; n < entry_size; n++) + { + struct lastlog ll; + TEST_COMPARE (lastlog_read (filename, entry[n].uid, &ll), + sizeof (struct lastlog)); + TEST_COMPARE (ll.ll_time, entry[n].ll.ll_time); + TEST_COMPARE_BLOB (ll.ll_line, UT_LINESIZE, + entry[n].ll.ll_line, UT_LINESIZE); + TEST_COMPARE_BLOB (ll.ll_host, UT_HOSTSIZE, + entry[n].ll.ll_host, UT_HOSTSIZE); + } + + /* Check with an non present uid. */ + { + struct lastlog ll; + TEST_COMPARE (lastlog_read (filename, 4000, &ll), 0); + } +} + +static int +do_test (void) +{ + /* The path triggers the read/write of compat (32-bit ll_time) entries + for ABI that used to support it. */ + run_test ("/var/run/lastlog"); + + /* Any other file handles new (64-bit ll_time) entries. */ + run_test ("/var/run/lastlog.v2"); + + return 0; +} + +#include diff --git a/login/tst-lastlog.root/tst-lastlog.script b/login/tst-lastlog.root/tst-lastlog.script new file mode 100644 index 0000000000..ca34ce7021 --- /dev/null +++ b/login/tst-lastlog.root/tst-lastlog.script @@ -0,0 +1,6 @@ +mkdirp 0755 /var/run +touch 0664 /var/run/lastlog +touch 0664 /var/run/lastlog.v2 + +# Must run localedef as root to write into default paths. +su diff --git a/login/utmp.h b/login/utmp.h index 7fc2d5cdf1..02a445ee82 100644 --- a/login/utmp.h +++ b/login/utmp.h @@ -91,6 +91,17 @@ extern int getutline_r (const struct utmp *__line, #endif /* Use misc. */ +#ifdef __USE_GNU +/* Read the struct lastlog LL with UID from file FILE. */ +extern ssize_t lastlog_read (const char *__file, uid_t __uid, + struct lastlog *__ll) + __THROW __nonnull ((1, 3)); +/* Write the struct lastlog LL with UID from file FILE. */ +extern ssize_t lastlog_write (const char *__file, uid_t __uid, + const struct lastlog *__ll) + __THROW __nonnull ((1, 3)); +#endif + __END_DECLS #endif /* utmp.h */ diff --git a/sysdeps/generic/paths.h b/sysdeps/generic/paths.h index ab2980e14a..9321ad7294 100644 --- a/sysdeps/generic/paths.h +++ b/sysdeps/generic/paths.h @@ -46,7 +46,8 @@ #define _PATH_DRUM "/dev/drum" #define _PATH_GSHADOW "/etc/gshadow" #define _PATH_KMEM "/dev/kmem" -#define _PATH_LASTLOG "/var/log/lastlog" +#define _PATH_LASTLOG_VER ".v2" +#define _PATH_LASTLOG "/var/log/lastlog" _PATH_LASTLOG_VER #define _PATH_MAILDIR "/var/mail" #define _PATH_MAN "/usr/share/man" #define _PATH_MEM "/dev/mem" diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 3a657d5e0d..d5e44b181b 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2215,6 +2215,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 4f91e85ba0..1516f80402 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2183,6 +2183,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 764ea51779..5ac4b37c02 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2265,6 +2265,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index 2ebd24f3a6..cefb1394e8 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -1943,6 +1943,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 5cfcb00ddb..8111b49085 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -167,6 +167,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index d140654389..4dba1f2f46 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -164,6 +164,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index 11aa688b83..a5ff3d90ca 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2127,6 +2127,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 14eef860ac..89a0f11166 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2086,6 +2086,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index e1db1488a9..a7c408d18c 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2253,6 +2253,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index f5b4433142..259b8020e8 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -2118,6 +2118,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 213853a1f1..e1171a34aa 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -168,6 +168,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 15dda47ba8..a521506506 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2198,6 +2198,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 3ffd49cbfb..aba642460c 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2178,6 +2178,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index 2bccbe960a..d3d653d144 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2175,6 +2175,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 209f5f588b..a4ce56c34f 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2169,6 +2169,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 45d976790c..51fbf0b1e1 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2167,6 +2167,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index ab3156c917..5642781479 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2175,6 +2175,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index f8d0534156..10954ebee4 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -2169,6 +2169,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index f56e5ad002..848cb2e599 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2216,6 +2216,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/paths.h b/sysdeps/unix/sysv/linux/paths.h index 89686bcf88..b78dff7ae3 100644 --- a/sysdeps/unix/sysv/linux/paths.h +++ b/sysdeps/unix/sysv/linux/paths.h @@ -47,7 +47,8 @@ #define _PATH_GSHADOW "/etc/gshadow" #define _PATH_KLOG "/proc/kmsg" #define _PATH_KMEM "/dev/kmem" -#define _PATH_LASTLOG "/var/log/lastlog" +#define _PATH_LASTLOG_VER ".v2" +#define _PATH_LASTLOG "/var/log/lastlog" _PATH_LASTLOG_VER #define _PATH_MAILDIR "/var/mail" #define _PATH_MAN "/usr/share/man" #define _PATH_MEM "/dev/mem" diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index cfb457400c..93e83fa602 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2225,6 +2225,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index e1fd74fbad..ec0b6d69b1 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2258,6 +2258,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index 5c9cdb33b4..f5bd1db3a0 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -2088,6 +2088,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index 4dcac4c766..27863e57af 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2378,6 +2378,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist index 69bc04c36c..08c5a32d5d 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist @@ -1945,6 +1945,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index dc4a3223e6..88b6fa7fc9 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2145,6 +2145,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/s390/lastlog-compat.h b/sysdeps/unix/sysv/linux/s390/lastlog-compat.h new file mode 100644 index 0000000000..56fadc3b3b --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/lastlog-compat.h @@ -0,0 +1,38 @@ +/* Compat lastlog definitions. s390 definition. + Copyright (C) 2020 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 + . */ + +#ifndef _LASTLOG_COMPAT_H +#define _LASTLOG_COMPAT_H 1 + +/* The s390 changes its lastlog to 64-bit on glibc 2.9 without any handling + of old format. The is_path_lastlog_compat assumes 64-bit as default. */ + +struct lastlog_compat +{ + int64_t ll_time; + char ll_line[UT_LINESIZE]; + char ll_host[UT_HOSTSIZE]; +}; + +static inline bool +is_path_lastlog_compat (const char *file) +{ + return false; +} + +#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index cead75acc5..7bc5c8866b 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2212,6 +2212,8 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 31366dd7e6..e26a24fe65 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -2113,6 +2113,8 @@ GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.4 _IO_fprintf F GLIBC_2.4 _IO_printf F GLIBC_2.4 _IO_sprintf F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 6deb52d706..06143b0283 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2093,6 +2093,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 17a141d5b9..eab2af349b 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2090,6 +2090,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index b64b351797..4783a8fa97 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2214,6 +2214,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index e3e01c29fc..47ded40426 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -2141,6 +2141,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 9995da84a8..0d144a0c10 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -2100,6 +2100,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index adccf45120..a3580872d3 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2197,6 +2197,8 @@ GLIBC_2.34 getutmpx F GLIBC_2.34 getutxent F GLIBC_2.34 getutxid F GLIBC_2.34 getutxline F +GLIBC_2.34 lastlog_read F +GLIBC_2.34 lastlog_write F GLIBC_2.34 pututline F GLIBC_2.34 pututxline F GLIBC_2.34 updwtmp F From patchwork Fri Mar 5 20:14:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42303 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 83A81399C039; Fri, 5 Mar 2021 20:15:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83A81399C039 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975354; bh=8wCZngL7ytrGfWyc3dXwaFmwEvGX4T1XEefRzr/ctZI=; 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=w9BCTbaIKl4L15rw/rqgoV1CwWQ8qRFaOLhtrV7ukm8yWBrDRbn95gC1FKKawqxVk O4Uqf6gkmXLK6Au6/HcZFfWrIJdPKUfkgoG6y4rHLIXv3tXvluzwou86tPaok1GXgP OewZGru/YbajbZhrUVFVCKYm3jrF35awsW8QQSN0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by sourceware.org (Postfix) with ESMTPS id 7596D399C025 for ; Fri, 5 Mar 2021 20:15:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7596D399C025 Received: by mail-qt1-x833.google.com with SMTP id r24so2750836qtt.8 for ; Fri, 05 Mar 2021 12:15:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8wCZngL7ytrGfWyc3dXwaFmwEvGX4T1XEefRzr/ctZI=; b=WU8qMx+OHKJNck91R3ZpwlEyATQsg2FklUly08Q4RIRBBXE549L5Rz5AdQs+Jwiqk0 5wgQcI55MbQ5Vh9CM1PkJOmXZppuYTBoUSwraUE8djmzG2M/bRAAFwG+h/sEhNtxLQB8 7tAQ0J3kCz7PeQiNk82H+1xJXMeA8a7dGoJnqLQVNLwSdFNjloANuxovF3O7JWhPb8IX wPcPHC/g+exO9NUM2ezagYCz+GbRVodImaFwyvijpBubLpmh2ctdg1YF8PIsRKq+S/S4 wxT8h8MPd3qouzwLfTW3SAPWHbyVtt0bQUzh5X3J6UzMCzFT7M95G56is/u1BXNo/i6d AXjw== X-Gm-Message-State: AOAM531YIOLGyDcG6z5/sec1lhgKz/iewgf7KdG3UBmgtyIwQirn7tjZ 1fKB1WB2goyj8SQvJxZdbSsuwnO45gxyKw== X-Google-Smtp-Source: ABdhPJzOAS0EDiTjGIQVROd3IBN2tvoeOZqdo/LBL8WEGDfiCfXzJrDbXKP0e/ufkNh3Z+8pf//oug== X-Received: by 2002:ac8:66d6:: with SMTP id m22mr10587196qtp.56.1614975350830; Fri, 05 Mar 2021 12:15:50 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:50 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 23/52] Remove __WORDSIZE_TIME64_COMPAT32 Date: Fri, 5 Mar 2021 17:14:49 -0300 Message-Id: <20210305201518.798584-24-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" With 'struct utmpx', 'struct utmp', and 'struct lastlog' using 64-bit time unconditionally this macro is not used anymore. --- bits/wordsize.h | 6 ------ sysdeps/aarch64/bits/wordsize.h | 2 -- sysdeps/mips/bits/wordsize.h | 6 ------ sysdeps/powerpc/powerpc32/bits/wordsize.h | 2 -- sysdeps/powerpc/powerpc64/bits/wordsize.h | 2 -- sysdeps/riscv/bits/wordsize.h | 2 -- sysdeps/s390/s390-32/bits/wordsize.h | 2 -- sysdeps/s390/s390-64/bits/wordsize.h | 2 -- sysdeps/sparc/sparc32/bits/wordsize.h | 2 -- sysdeps/sparc/sparc64/bits/wordsize.h | 2 -- sysdeps/unix/sysv/linux/alpha/bits/wordsize.h | 1 - sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h | 2 -- sysdeps/unix/sysv/linux/sparc/bits/wordsize.h | 2 -- sysdeps/wordsize-32/bits/wordsize.h | 1 - sysdeps/wordsize-64/bits/wordsize.h | 1 - sysdeps/x86/bits/wordsize.h | 3 --- 16 files changed, 38 deletions(-) diff --git a/bits/wordsize.h b/bits/wordsize.h index 14edae3a11..e20fd2e4c2 100644 --- a/bits/wordsize.h +++ b/bits/wordsize.h @@ -19,9 +19,3 @@ __WORDSIZE is 32 and ptrdiff_t is type 'int' and leave undefined if __WORDSIZE is 64. */ #define __WORDSIZE32_PTRDIFF_LONG - -/* Set to 1 in order to force time types to be 32 bits instead of 64 bits in - struct lastlog and struct utmp{,x} on 64-bit ports. This may be done in - order to make 64-bit ports compatible with 32-bit ports. Set to 0 for - 64-bit ports where the time types are 64-bits or for any 32-bit ports. */ -#define __WORDSIZE_TIME64_COMPAT32 diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h index 91da566b74..473ab82dbd 100644 --- a/sysdeps/aarch64/bits/wordsize.h +++ b/sysdeps/aarch64/bits/wordsize.h @@ -24,5 +24,3 @@ # define __WORDSIZE32_SIZE_ULONG 1 # define __WORDSIZE32_PTRDIFF_LONG 1 #endif - -#define __WORDSIZE_TIME64_COMPAT32 0 diff --git a/sysdeps/mips/bits/wordsize.h b/sysdeps/mips/bits/wordsize.h index 18ef16c639..de2cfd844c 100644 --- a/sysdeps/mips/bits/wordsize.h +++ b/sysdeps/mips/bits/wordsize.h @@ -19,12 +19,6 @@ #define __WORDSIZE _MIPS_SZPTR -#if _MIPS_SIM == _ABI64 -# define __WORDSIZE_TIME64_COMPAT32 1 -#else -# define __WORDSIZE_TIME64_COMPAT32 0 -#endif - #if __WORDSIZE == 32 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 diff --git a/sysdeps/powerpc/powerpc32/bits/wordsize.h b/sysdeps/powerpc/powerpc32/bits/wordsize.h index 04ca9debf0..df1aa27244 100644 --- a/sysdeps/powerpc/powerpc32/bits/wordsize.h +++ b/sysdeps/powerpc/powerpc32/bits/wordsize.h @@ -2,10 +2,8 @@ #if defined __powerpc64__ # define __WORDSIZE 64 -# define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 -# define __WORDSIZE_TIME64_COMPAT32 0 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/powerpc/powerpc64/bits/wordsize.h b/sysdeps/powerpc/powerpc64/bits/wordsize.h index 04ca9debf0..df1aa27244 100644 --- a/sysdeps/powerpc/powerpc64/bits/wordsize.h +++ b/sysdeps/powerpc/powerpc64/bits/wordsize.h @@ -2,10 +2,8 @@ #if defined __powerpc64__ # define __WORDSIZE 64 -# define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 -# define __WORDSIZE_TIME64_COMPAT32 0 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/riscv/bits/wordsize.h b/sysdeps/riscv/bits/wordsize.h index e7fcc1932c..0d7508bf9c 100644 --- a/sysdeps/riscv/bits/wordsize.h +++ b/sysdeps/riscv/bits/wordsize.h @@ -22,8 +22,6 @@ # error unsupported ABI #endif -#define __WORDSIZE_TIME64_COMPAT32 1 - #if __WORDSIZE == 32 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 diff --git a/sysdeps/s390/s390-32/bits/wordsize.h b/sysdeps/s390/s390-32/bits/wordsize.h index 129e47182b..755050861e 100644 --- a/sysdeps/s390/s390-32/bits/wordsize.h +++ b/sysdeps/s390/s390-32/bits/wordsize.h @@ -7,5 +7,3 @@ # define __WORDSIZE32_SIZE_ULONG 1 # define __WORDSIZE32_PTRDIFF_LONG 0 #endif - -#define __WORDSIZE_TIME64_COMPAT32 0 diff --git a/sysdeps/s390/s390-64/bits/wordsize.h b/sysdeps/s390/s390-64/bits/wordsize.h index 00e88b0628..01245a5b71 100644 --- a/sysdeps/s390/s390-64/bits/wordsize.h +++ b/sysdeps/s390/s390-64/bits/wordsize.h @@ -7,5 +7,3 @@ # define __WORDSIZE32_SIZE_ULONG 1 # define __WORDSIZE32_PTRDIFF_LONG 0 #endif - -#define __WORDSIZE_TIME64_COMPAT32 0 diff --git a/sysdeps/sparc/sparc32/bits/wordsize.h b/sysdeps/sparc/sparc32/bits/wordsize.h index 2f66f10d72..10b73267f0 100644 --- a/sysdeps/sparc/sparc32/bits/wordsize.h +++ b/sysdeps/sparc/sparc32/bits/wordsize.h @@ -2,10 +2,8 @@ #if defined __arch64__ || defined __sparcv9 # define __WORDSIZE 64 -# define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 -# define __WORDSIZE_TIME64_COMPAT32 0 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/sparc/sparc64/bits/wordsize.h b/sysdeps/sparc/sparc64/bits/wordsize.h index 2f66f10d72..10b73267f0 100644 --- a/sysdeps/sparc/sparc64/bits/wordsize.h +++ b/sysdeps/sparc/sparc64/bits/wordsize.h @@ -2,10 +2,8 @@ #if defined __arch64__ || defined __sparcv9 # define __WORDSIZE 64 -# define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 -# define __WORDSIZE_TIME64_COMPAT32 0 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h index cb3c41ddb4..72c5634c0a 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/wordsize.h @@ -16,4 +16,3 @@ . */ #define __WORDSIZE 64 -#define __WORDSIZE_TIME64_COMPAT32 0 diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h index 04ca9debf0..df1aa27244 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h @@ -2,10 +2,8 @@ #if defined __powerpc64__ # define __WORDSIZE 64 -# define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 -# define __WORDSIZE_TIME64_COMPAT32 0 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 #endif diff --git a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h index 7562875ee2..10b73267f0 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/wordsize.h @@ -2,10 +2,8 @@ #if defined __arch64__ || defined __sparcv9 # define __WORDSIZE 64 -# define __WORDSIZE_TIME64_COMPAT32 1 #else # define __WORDSIZE 32 # define __WORDSIZE32_SIZE_ULONG 0 # define __WORDSIZE32_PTRDIFF_LONG 0 -# define __WORDSIZE_TIME64_COMPAT32 0 #endif diff --git a/sysdeps/wordsize-32/bits/wordsize.h b/sysdeps/wordsize-32/bits/wordsize.h index cfa60443fc..bcd2fef565 100644 --- a/sysdeps/wordsize-32/bits/wordsize.h +++ b/sysdeps/wordsize-32/bits/wordsize.h @@ -16,6 +16,5 @@ . */ #define __WORDSIZE 32 -#define __WORDSIZE_TIME64_COMPAT32 0 #define __WORDSIZE32_SIZE_ULONG 0 #define __WORDSIZE32_PTRDIFF_LONG 0 diff --git a/sysdeps/wordsize-64/bits/wordsize.h b/sysdeps/wordsize-64/bits/wordsize.h index f4f0681de5..d875811fab 100644 --- a/sysdeps/wordsize-64/bits/wordsize.h +++ b/sysdeps/wordsize-64/bits/wordsize.h @@ -16,4 +16,3 @@ . */ #define __WORDSIZE 64 -#define __WORDSIZE_TIME64_COMPAT32 0 diff --git a/sysdeps/x86/bits/wordsize.h b/sysdeps/x86/bits/wordsize.h index 70f652bca1..cf250cc6df 100644 --- a/sysdeps/x86/bits/wordsize.h +++ b/sysdeps/x86/bits/wordsize.h @@ -9,9 +9,6 @@ #endif #ifdef __x86_64__ -# define __WORDSIZE_TIME64_COMPAT32 1 /* Both x86-64 and x32 use the 64-bit system call interface. */ # define __SYSCALL_WORDSIZE 64 -#else -# define __WORDSIZE_TIME64_COMPAT32 0 #endif From patchwork Fri Mar 5 20:14:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42305 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 9C694399C032; Fri, 5 Mar 2021 20:15:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C694399C032 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975356; bh=x7mWoXRs5jH/8Yup/jXxpiUGrqhP+ydjlzaU2Y6WL1M=; 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=c2/bc9lXM+zYmZfwnO6sqZVANYFsicfJF+Plv5gv39zgbFwtklMkmgffWnMWX8r+K R05nzTOseGoX88tILKOMTFdBBKbTj/bnOO4xfciH6mCK+LVN8vcn0j0sX8G5Fkk8d9 gka3Y7pasBXSL0l0t51sXqRlrGz1Rjyhb2rJjNu8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by sourceware.org (Postfix) with ESMTPS id CA1BC399C017 for ; Fri, 5 Mar 2021 20:15:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CA1BC399C017 Received: by mail-qv1-xf29.google.com with SMTP id x13so1623372qvj.7 for ; Fri, 05 Mar 2021 12:15:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x7mWoXRs5jH/8Yup/jXxpiUGrqhP+ydjlzaU2Y6WL1M=; b=PRssttsqtCHRq+w7dtO8mcldhojAMgq4vpVfyaCElpJ6D3Jyt2wZ6OguzzS8uaCLh/ 6OCO3GiYNkcrHtCHTt4sX2bZXqS701aaEo7EDw5zn0OcYQ/N8mD8AmOehgE9ViubyAGz laPTf4NaFyFcN7Vm2Wv9SfxPB4VGgNeCqKh4ZanKMBqie8hnZ9zgpZi6jMZWAU2NrI9b 4lNN+EClCsO2fltRV7lHZaNzOQBxflkdYJRWB9qAelAwr2ihEIPcsFMFgbnWgDQl1NhL 9tzzwBTxPnBiE+62PYCoMmp+rn+2rxCBuHgmiEabyyLoAhWhuUFPrU1PD2q0zIOThGGN 1miQ== X-Gm-Message-State: AOAM533iwIFRX87C5dFUTSPV8r3jqYGpSv+l83S45gilyXR6GaiEAeuM lcuzq2pyr0GBAKXjWoEWjCCgJz4SlxOrYg== X-Google-Smtp-Source: ABdhPJw2PM/r7m2Bc/IUY7KQN2N+mJD9OK8ps+ysNAVLeYmCqcwq14Z06VlN2r23smt5VYVp8SXegA== X-Received: by 2002:a0c:9e4b:: with SMTP id z11mr10792334qve.27.1614975351990; Fri, 05 Mar 2021 12:15:51 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:51 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 24/52] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Date: Fri, 5 Mar 2021 17:14:50 -0300 Message-Id: <20210305201518.798584-25-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The constant values will be changed for __TIMESIZE=64, so binaries built with 64-bit time support might fail to work properly on old kernels. Both {get,set}sockopt will retry the syscall with the old constant values and the timeout value adjusted when kernel returns ENOTPROTOPT. It also adds an internal only SO_{RCV,SND}TIMEO where COMPAT_SO_{RCV,SND}TIMEO_OLD indicates pre 32 bit time support and COMPAT_SO_{RCV,SND}TIMEO_NEW indicates time64 support. It allows to refer to constant independently of the time_t ABI and kernel version used. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). --- sysdeps/unix/sysv/linux/getsockopt.c | 67 +++++++++++++++-- .../sysv/linux/hppa/socket-constants-time64.h | 30 ++++++++ .../sysv/linux/mips/socket-constants-time64.h | 30 ++++++++ .../linux/powerpc/socket-constants-time64.h | 30 ++++++++ sysdeps/unix/sysv/linux/setsockopt.c | 71 ++++++++++++++++--- .../unix/sysv/linux/socket-constants-time64.h | 30 ++++++++ .../linux/sparc/socket-constants-time64.h | 30 ++++++++ 7 files changed, 273 insertions(+), 15 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h create mode 100644 sysdeps/unix/sysv/linux/mips/socket-constants-time64.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h create mode 100644 sysdeps/unix/sysv/linux/socket-constants-time64.h create mode 100644 sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h diff --git a/sysdeps/unix/sysv/linux/getsockopt.c b/sysdeps/unix/sysv/linux/getsockopt.c index 76ee8a94d6..c8e502d976 100644 --- a/sysdeps/unix/sysv/linux/getsockopt.c +++ b/sysdeps/unix/sysv/linux/getsockopt.c @@ -15,16 +15,15 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - +#include +#include #include -#include -#include +#include -int -__getsockopt (int fd, int level, int optname, void *optval, socklen_t *len) +static int +getsockopt_syscall (int fd, int level, int optname, void *optval, + socklen_t *len) { #ifdef __ASSUME_GETSOCKOPT_SYSCALL return INLINE_SYSCALL (getsockopt, 5, fd, level, optname, optval, len); @@ -32,4 +31,58 @@ __getsockopt (int fd, int level, int optname, void *optval, socklen_t *len) return SOCKETCALL (getsockopt, fd, level, optname, optval, len); #endif } + +#ifndef __ASSUME_TIME64_SYSCALLS +static int +getsockopt32 (int fd, int level, int optname, void *optval, + socklen_t *len) +{ + int r = -1; + + if (level != SOL_SOCKET) + return r; + + switch (optname) + { + case COMPAT_SO_RCVTIMEO_NEW: + case COMPAT_SO_SNDTIMEO_NEW: + { + if (*len < sizeof (struct __timeval64)) + { + __set_errno (EINVAL); + break; + } + + if (optname == COMPAT_SO_RCVTIMEO_NEW) + optname = COMPAT_SO_RCVTIMEO_OLD; + if (optname == COMPAT_SO_SNDTIMEO_NEW) + optname = COMPAT_SO_SNDTIMEO_OLD; + + struct __timeval32 tv32; + r = getsockopt_syscall (fd, level, optname, &tv32, + (socklen_t[]) { sizeof tv32 }); + if (r < 0) + break; + struct __timeval64 *tv64 = (struct __timeval64 *) optval; + *tv64 = valid_timeval32_to_timeval64 (tv32); + *len = sizeof (*tv64); + } + } + + return r; +} +#endif + +int +__getsockopt (int fd, int level, int optname, void *optval, socklen_t *len) +{ + int r = getsockopt_syscall (fd, level, optname, optval, len); + +#ifndef __ASSUME_TIME64_SYSCALLS + if (r == -1 && errno == ENOPROTOOPT) + r = getsockopt32 (fd, level, optname, optval, len); +#endif + + return r; +} weak_alias (__getsockopt, getsockopt) diff --git a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h new file mode 100644 index 0000000000..ea721e0fc2 --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h @@ -0,0 +1,30 @@ +/* Compat socket constants used in 64 bit compat code. + Copyright (C) 2021 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 + . */ + +#ifndef _SOCKET_CONSTANTS_TIME64_H +#define _SOCKET_CONSTANTS_TIME64_H + +/* The compat code requires the SO_* constants used for both 32 and 64 bit + time_t, however they were only added on v5.1 kernel. */ + +#define COMPAT_SO_RCVTIMEO_OLD 4102 +#define COMPAT_SO_SNDTIMEO_OLD 4101 +#define COMPAT_SO_RCVTIMEO_NEW 16448 +#define COMPAT_SO_SNDTIMEO_NEW 16449 + +#endif diff --git a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h new file mode 100644 index 0000000000..ab8bd62853 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h @@ -0,0 +1,30 @@ +/* Compat socket constants used in 64 bit compat code. + Copyright (C) 2021 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 + . */ + +#ifndef _SOCKET_CONSTANTS_TIME64_H +#define _SOCKET_CONSTANTS_TIME64_H + +/* The compat code requires the SO_* constants used for both 32 and 64 bit + time_t, however they were only added on v5.1 kernel. */ + +#define COMPAT_SO_RCVTIMEO_OLD 4102 +#define COMPAT_SO_SNDTIMEO_OLD 4101 +#define COMPAT_SO_RCVTIMEO_NEW 66 +#define COMPAT_SO_SNDTIMEO_NEW 67 + +#endif diff --git a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h new file mode 100644 index 0000000000..1e48dcca8d --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h @@ -0,0 +1,30 @@ +/* Compat socket constants used in 64 bit compat code. + Copyright (C) 2021 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 + . */ + +#ifndef _SOCKET_CONSTANTS_TIME64_H +#define _SOCKET_CONSTANTS_TIME64_H + +/* The compat code requires the SO_* constants used for both 32 and 64 bit + time_t, however they were only added on v5.1 kernel. */ + +#define COMPAT_SO_RCVTIMEO_OLD 18 +#define COMPAT_SO_SNDTIMEO_OLD 19 +#define COMPAT_SO_RCVTIMEO_NEW 66 +#define COMPAT_SO_SNDTIMEO_NEW 67 + +#endif diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c index 12fd7bdcde..6505202265 100644 --- a/sysdeps/unix/sysv/linux/setsockopt.c +++ b/sysdeps/unix/sysv/linux/setsockopt.c @@ -15,21 +15,76 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - +#include +#include #include -#include -#include +#include -int -setsockopt (int fd, int level, int optname, const void *optval, socklen_t len) +static int +setsockopt_syscall (int fd, int level, int optname, const void *optval, + socklen_t len) { #ifdef __ASSUME_SETSOCKOPT_SYSCALL - return INLINE_SYSCALL (setsockopt, 5, fd, level, optname, optval, len); + return INLINE_SYSCALL_CALL (setsockopt, fd, level, optname, optval, len); #else return SOCKETCALL (setsockopt, fd, level, optname, optval, len); #endif } + +#ifndef __ASSUME_TIME64_SYSCALLS +static int +setsockopt32 (int fd, int level, int optname, const void *optval, + socklen_t len) +{ + int r = -1; + + if (level != SOL_SOCKET) + return r; + + switch (optname) + { + case COMPAT_SO_RCVTIMEO_NEW: + case COMPAT_SO_SNDTIMEO_NEW: + { + if (len < sizeof (struct __timeval64)) + { + __set_errno (EINVAL); + break; + } + + struct __timeval64 *tv64 = (struct __timeval64 *) optval; + if (! in_time_t_range (tv64->tv_sec)) + { + __set_errno (EOVERFLOW); + break; + } + + if (optname == COMPAT_SO_RCVTIMEO_NEW) + optname = COMPAT_SO_RCVTIMEO_OLD; + if (optname == COMPAT_SO_SNDTIMEO_NEW) + optname = COMPAT_SO_SNDTIMEO_OLD; + + struct __timeval32 tv32 = valid_timeval64_to_timeval32 (*tv64); + + r = setsockopt_syscall (fd, level, optname, &tv32, sizeof (tv32)); + } + } + + return r; +} +#endif + +int +setsockopt (int fd, int level, int optname, const void *optval, socklen_t len) +{ + int r = setsockopt_syscall (fd, level, optname, optval, len); + +#ifndef __ASSUME_TIME64_SYSCALLS + if (r == -1 && errno == ENOPROTOOPT) + r = setsockopt32 (fd, level, optname, optval, len); +#endif + + return r; +} weak_alias (setsockopt, __setsockopt) diff --git a/sysdeps/unix/sysv/linux/socket-constants-time64.h b/sysdeps/unix/sysv/linux/socket-constants-time64.h new file mode 100644 index 0000000000..e5a3777f28 --- /dev/null +++ b/sysdeps/unix/sysv/linux/socket-constants-time64.h @@ -0,0 +1,30 @@ +/* Compat socket constants used in 64 bit compat code. + Copyright (C) 2021 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 + . */ + +#ifndef _SOCKET_CONSTANTS_TIME64_H +#define _SOCKET_CONSTANTS_TIME64_H + +/* The compat code requires the SO_* constants used for both 32 and 64 bit + time_t, however they were only added on v5.1 kernel. */ + +#define COMPAT_SO_RCVTIMEO_OLD 20 +#define COMPAT_SO_SNDTIMEO_OLD 21 +#define COMPAT_SO_RCVTIMEO_NEW 66 +#define COMPAT_SO_SNDTIMEO_NEW 67 + +#endif diff --git a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h new file mode 100644 index 0000000000..b137abdeea --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h @@ -0,0 +1,30 @@ +/* Compat socket constants used in 64 bit compat code. + Copyright (C) 2021 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 + . */ + +#ifndef _SOCKET_CONSTANTS_TIME64_H +#define _SOCKET_CONSTANTS_TIME64_H + +/* The compat code requires the SO_* constants used for both 32 and 64 bit + time_t, however they were only added on v5.1 kernel. */ + +#define COMPAT_SO_RCVTIMEO_OLD 8192 +#define COMPAT_SO_SNDTIMEO_OLD 16384 +#define COMPAT_SO_RCVTIMEO_NEW 68 +#define COMPAT_SO_SNDTIMEO_NEW 69 + +#endif From patchwork Fri Mar 5 20:14:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42306 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 B7CAB399C03E; Fri, 5 Mar 2021 20:15:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7CAB399C03E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975357; bh=id6k0YeJHYd1ZwnCv/u8BprymE5dXLv0PAZYUEUns4Q=; 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=tdsYTxpZS6wep97xH7VNgPoaqvBNN+CtR6hisnc1oK9/Zp93x5E6ftH5dRC4cfxVy 7xnGwyBYCQdkCNwL5wc0cLvg55bAeutegNqR/gHmdUU4EuVrB4Z42uKvTzhe+CkikK MKuzBA/vQNaOJOy7efn45Zako3uAS1SDNi87lfmM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) by sourceware.org (Postfix) with ESMTPS id C5A9E399C025 for ; Fri, 5 Mar 2021 20:15:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C5A9E399C025 Received: by mail-qv1-xf2b.google.com with SMTP id 15so1603848qvp.13 for ; Fri, 05 Mar 2021 12:15:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=id6k0YeJHYd1ZwnCv/u8BprymE5dXLv0PAZYUEUns4Q=; b=TuObSOV37oiDcKnyJbKjYfYKxZ/GDsqCq2/9EKmuBVk4ZU4sKpgb86L3iaZIsCU8uf Xp+mmXM9xjBOIVSzetGf23KtBXTBKD6Ktq0e4fNsmGkwPQGqDAAcvlGrr40xtXauUROL 8keWHTHmaoG/pEhJIPIt/MfSYK4RQzk7RJr6nyaJOFEAA5x+nGfXCgot/1fPRvUYxq2M GWoCufvurlWJiHRKokyncyoBWDTxjFL/0JvGIj7Ex0Qh6NP1bKXD0cMiP6h//cod2vOH GxMExZV2rkWfpuMQWCb5eBp7XG3xdWZ7OKOQZzKiLCialaAd5AugOPFKh5F4WJqGyeN5 SxZA== X-Gm-Message-State: AOAM530lwkRjzHdQFxnnu8sPb9l4TuuPmkLD+D0xT+OgGn8hJbVHvvcN LLA5sTej+cBfkhnY9oneOu2o7m8ga+Eqmg== X-Google-Smtp-Source: ABdhPJy27SdtLq4YnxdaUMbVBbl9K8WT4FdtnJgvgqFtrVBoE9bp9UU6A7kkU4+dxdzN9zpHxDllUg== X-Received: by 2002:a0c:b59f:: with SMTP id g31mr10592199qve.28.1614975353129; Fri, 05 Mar 2021 12:15:53 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:52 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 25/52] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS} Date: Fri, 5 Mar 2021 17:14:51 -0300 Message-Id: <20210305201518.798584-26-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The recvmsg handling is more complicated because it requires check the returned kernel control message and make some convertions. For !__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP or SO_TIMESTAMPNS and appends it to the control buffer if has extra space or returns MSG_CTRUNC otherwise. The 32-bit time field is kept as-is. Calls with __TIMESIZE=32 will see the converted 64-bit time control messages as spurious control message of unknown type. Calls with __TIMESIZE=64 running on pre-time64 kernels will see the original message as a spurious control ones of unknown typ while running on kernel with native 64-bit time support will only see the time64 version of the control message. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). --- include/sys/socket.h | 5 + sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/Versions | 1 + .../unix/sysv/linux/convert_scm_timestamps.c | 96 +++++++++++++++++++ sysdeps/unix/sysv/linux/getsockopt.c | 12 +++ .../sysv/linux/hppa/socket-constants-time64.h | 5 + .../sysv/linux/mips/socket-constants-time64.h | 5 + .../linux/powerpc/socket-constants-time64.h | 5 + sysdeps/unix/sysv/linux/recvmsg.c | 23 +++-- sysdeps/unix/sysv/linux/setsockopt.c | 12 +++ .../unix/sysv/linux/socket-constants-time64.h | 5 + .../linux/sparc/socket-constants-time64.h | 5 + 12 files changed, 169 insertions(+), 7 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/convert_scm_timestamps.c diff --git a/include/sys/socket.h b/include/sys/socket.h index 0e39dd2a3a..15d4a62b26 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -164,5 +164,10 @@ libc_hidden_proto (__libc_sa_len) libc_hidden_proto (__cmsg_nxthdr) +#ifndef __ASSUME_TIME64_SYSCALLS +extern void __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize) ; +libc_hidden_proto (__convert_scm_timestamps) +#endif + #endif #endif diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 7b3bb30da2..6743936b5a 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -64,7 +64,7 @@ sysdep_routines += adjtimex clone umount umount2 readahead sysctl \ time64-support pselect32 \ xstat fxstat lxstat xstat64 fxstat64 lxstat64 \ fxstatat fxstatat64 \ - xmknod xmknodat + xmknod xmknodat convert_scm_timestamps CFLAGS-gethostid.c = -fexceptions CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index c35f783e2a..257ccbd3b4 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -177,6 +177,7 @@ libc { __pread64_nocancel; __close_nocancel; __sigtimedwait; + __convert_scm_timestamps; # functions used by nscd __netlink_assert_response; } diff --git a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c new file mode 100644 index 0000000000..3c123c28ce --- /dev/null +++ b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c @@ -0,0 +1,96 @@ +/* Socket timestamp conversion routines. + Copyright (C) 2021 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 + +#ifndef __ASSUME_TIME64_SYSCALLS +# include +# include +# include +# include + +/* It converts the first SO_TIMESTAMP or SO_TIMESTAMPNS with 32-bit time and + appends it to the control buffer. The 32-bit time field is kept as-is. + + Calls with __TIMESIZE=32 will see the converted 64-bit time control + messages as spurious control message of unknown type. + + Calls with __TIMESIZE=64 running on pre-time64 kernels will see the + original message as a spurious control ones of unknown typ while running + on kernel with native 64-bit time support will only see the time64 version + of the control message. */ +void +__convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize) +{ + if (msg->msg_control == NULL || msg->msg_controllen == 0) + return; + + /* The returned control message format for SO_TIMESTAMP_NEW is a + 'struct __kernel_sock_timeval' while for SO_TIMESTAMPNS_NEW is a + 'struct __kernel_timespec'. In either case it is two uint64_t + members. */ + uint64_t tvts[2]; + + struct cmsghdr *cmsg, *last = NULL; + int type = 0; + + for (cmsg = CMSG_FIRSTHDR (msg); + cmsg != NULL; + cmsg = CMSG_NXTHDR (msg, cmsg)) + { + if (cmsg->cmsg_level != SOL_SOCKET) + continue; + + switch (cmsg->cmsg_type) + { + case COMPAT_SO_TIMESTAMP_OLD: + if (type != 0) + break; + type = COMPAT_SO_TIMESTAMP_NEW; + goto common; + + case COMPAT_SO_TIMESTAMPNS_OLD: + type = COMPAT_SO_TIMESTAMPNS_NEW; + + /* fallthrough */ + common: + memcpy (tvts, CMSG_DATA (cmsg), sizeof (tvts)); + break; + } + + last = cmsg; + } + + if (last == NULL || type == 0) + return; + + if (CMSG_SPACE (sizeof tvts) > msgsize - msg->msg_controllen) + { + msg->msg_flags |= MSG_CTRUNC; + return; + } + + msg->msg_controllen += CMSG_SPACE (sizeof tvts); + cmsg = CMSG_NXTHDR(msg, last); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = type; + cmsg->cmsg_len = CMSG_LEN (sizeof tvts); + memcpy (CMSG_DATA (cmsg), tvts, sizeof tvts); +} +libc_hidden_def (__convert_scm_timestamps) +#endif diff --git a/sysdeps/unix/sysv/linux/getsockopt.c b/sysdeps/unix/sysv/linux/getsockopt.c index c8e502d976..14b782d0da 100644 --- a/sysdeps/unix/sysv/linux/getsockopt.c +++ b/sysdeps/unix/sysv/linux/getsockopt.c @@ -67,6 +67,18 @@ getsockopt32 (int fd, int level, int optname, void *optval, *tv64 = valid_timeval32_to_timeval64 (tv32); *len = sizeof (*tv64); } + break; + + case COMPAT_SO_TIMESTAMP_NEW: + case COMPAT_SO_TIMESTAMPNS_NEW: + { + if (optname == COMPAT_SO_TIMESTAMP_NEW) + optname = COMPAT_SO_TIMESTAMP_OLD; + if (optname == COMPAT_SO_TIMESTAMPNS_NEW) + optname = COMPAT_SO_TIMESTAMPNS_OLD; + r = getsockopt_syscall (fd, level, optname, optval, len); + } + break; } return r; diff --git a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h index ea721e0fc2..f3b98012d5 100644 --- a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h +++ b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h @@ -27,4 +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 16448 #define COMPAT_SO_SNDTIMEO_NEW 16449 +#define COMPAT_SO_TIMESTAMP_OLD 0x4012 +#define COMPAT_SO_TIMESTAMPNS_OLD 0x4013 +#define COMPAT_SO_TIMESTAMP_NEW 0x4038 +#define COMPAT_SO_TIMESTAMPNS_NEW 0x4039 + #endif diff --git a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h index ab8bd62853..31fa69fa9f 100644 --- a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h +++ b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h @@ -27,4 +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 66 #define COMPAT_SO_SNDTIMEO_NEW 67 +#define COMPAT_SO_TIMESTAMP_OLD 29 +#define COMPAT_SO_TIMESTAMPNS_OLD 35 +#define COMPAT_SO_TIMESTAMP_NEW 63 +#define COMPAT_SO_TIMESTAMPNS_NEW 64 + #endif diff --git a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h index 1e48dcca8d..889251895b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h +++ b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h @@ -27,4 +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 66 #define COMPAT_SO_SNDTIMEO_NEW 67 +#define COMPAT_SO_TIMESTAMP_OLD 29 +#define COMPAT_SO_TIMESTAMPNS_OLD 35 +#define COMPAT_SO_TIMESTAMP_NEW 63 +#define COMPAT_SO_TIMESTAMPNS_NEW 64 + #endif diff --git a/sysdeps/unix/sysv/linux/recvmsg.c b/sysdeps/unix/sysv/linux/recvmsg.c index b209b4ad99..a2a600228b 100644 --- a/sysdeps/unix/sysv/linux/recvmsg.c +++ b/sysdeps/unix/sysv/linux/recvmsg.c @@ -19,16 +19,27 @@ #include #include #include -#include ssize_t __libc_recvmsg (int fd, struct msghdr *msg, int flags) { -# ifdef __ASSUME_RECVMSG_SYSCALL - return SYSCALL_CANCEL (recvmsg, fd, msg, flags); -# else - return SOCKETCALL_CANCEL (recvmsg, fd, msg, flags); -# endif + ssize_t r; +#ifndef __ASSUME_TIME64_SYSCALLS + socklen_t orig_controllen = msg->msg_controllen; +#endif + +#ifdef __ASSUME_RECVMSG_SYSCALL + r = SYSCALL_CANCEL (recvmsg, fd, msg, flags); +#else + r = SOCKETCALL_CANCEL (recvmsg, fd, msg, flags); +#endif + +#ifndef __ASSUME_TIME64_SYSCALLS + if (r >= 0) + __convert_scm_timestamps (msg, orig_controllen); +#endif + + return r; } weak_alias (__libc_recvmsg, recvmsg) weak_alias (__libc_recvmsg, __recvmsg) diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c index 6505202265..a4780a9d33 100644 --- a/sysdeps/unix/sysv/linux/setsockopt.c +++ b/sysdeps/unix/sysv/linux/setsockopt.c @@ -69,6 +69,18 @@ setsockopt32 (int fd, int level, int optname, const void *optval, r = setsockopt_syscall (fd, level, optname, &tv32, sizeof (tv32)); } + break; + + case COMPAT_SO_TIMESTAMP_NEW: + case COMPAT_SO_TIMESTAMPNS_NEW: + { + if (optname == COMPAT_SO_TIMESTAMP_NEW) + optname = COMPAT_SO_TIMESTAMP_OLD; + if (optname == COMPAT_SO_TIMESTAMPNS_NEW) + optname = COMPAT_SO_TIMESTAMPNS_OLD; + r = setsockopt_syscall (fd, level, optname, NULL, 0); + } + break; } return r; diff --git a/sysdeps/unix/sysv/linux/socket-constants-time64.h b/sysdeps/unix/sysv/linux/socket-constants-time64.h index e5a3777f28..7f7ca05504 100644 --- a/sysdeps/unix/sysv/linux/socket-constants-time64.h +++ b/sysdeps/unix/sysv/linux/socket-constants-time64.h @@ -27,4 +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 66 #define COMPAT_SO_SNDTIMEO_NEW 67 +#define COMPAT_SO_TIMESTAMP_OLD 29 +#define COMPAT_SO_TIMESTAMPNS_OLD 35 +#define COMPAT_SO_TIMESTAMP_NEW 63 +#define COMPAT_SO_TIMESTAMPNS_NEW 64 + #endif diff --git a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h index b137abdeea..56358923e1 100644 --- a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h +++ b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h @@ -27,4 +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 68 #define COMPAT_SO_SNDTIMEO_NEW 69 +#define COMPAT_SO_TIMESTAMP_OLD 0x001d +#define COMPAT_SO_TIMESTAMPNS_OLD 0x0021 +#define COMPAT_SO_TIMESTAMP_NEW 0x0046 +#define COMPAT_SO_TIMESTAMPNS_NEW 0x0042 + #endif From patchwork Fri Mar 5 20:14:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42307 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 44B6C399F004; Fri, 5 Mar 2021 20:15:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 44B6C399F004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975358; bh=K8NJKpi+ZxUhroSwephL/Qq3OM8305GHyBJXPiv9WEU=; 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=fiqPyN8pE1O1Z8+U0JF7kn6aKo3rq+wSQUSmb5FqtiLpFnG2WrvhmcFKGhui2pRnR hSOJjAlGxmfNVNk1Fp0tBH09zCGfG9TT94wXsVfekj2oOIFmC5yFvjz8+UCwn6XYOa jbb5+GWfaN0voY0or2zfC1ZQ9zcae3pv5YxBJUXU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by sourceware.org (Postfix) with ESMTPS id BBC76399C03A for ; Fri, 5 Mar 2021 20:15:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BBC76399C03A Received: by mail-qt1-x835.google.com with SMTP id t13so1388516qta.11 for ; Fri, 05 Mar 2021 12:15:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K8NJKpi+ZxUhroSwephL/Qq3OM8305GHyBJXPiv9WEU=; b=qgP35gR2B/qLDUu+zCND7RZ1p0N97CsCX44pJl5a8LYoQXZlB2htIHSu8UsYbGtkHh DiATiKnXvExsnIGyeLTw2kJ95g7pDYZmeGtqM4lq/g7lH2RZccixscbNv9Xg91ZlYUV2 ObC8ZWUPn/lUU0uGw5Ad2pfAhkFYpyPI0ZxyPuk2FVE1LoRyVLGsL3hgofdZc9Y7S3XS cZyhPz8kA+w3ztO539YbSFhWn0rxEUQhDxS0/gZJpFBcEA3LfzRJxhKPVaWdNaStWsLY k97JtDHzR9zoynxWxxIfimdIyvfwB9SOpAFCLjuTW5N3mMbPkS/E20P2OcgqXMrZT9Fd EPiw== X-Gm-Message-State: AOAM531U0Vo3MIqkl2tT2JcV76GhnApA51cmD3l/Hf312pZQQKLhlI46 EtMtDaUvN1CYOflhEmIt/PkqSrbVELb4uA== X-Google-Smtp-Source: ABdhPJxFZl0W3l738PNmrNtVN2HQvaZeX8Z7WbnfUK5UvUTxLilA3ZIFs03MriEo2WNR2Yl9+hne7Q== X-Received: by 2002:ac8:76c5:: with SMTP id q5mr10621104qtr.197.1614975354219; Fri, 05 Mar 2021 12:15:54 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:54 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 26/52] linux: Add recvvmsg fallback for 64-bit time_t SO_TIMESTAMP{NS} Date: Fri, 5 Mar 2021 17:14:52 -0300 Message-Id: <20210305201518.798584-27-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Handle the SO_TIMESTAMP{NS} similar to recvmsg: for !__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP or SO_TIMESTAMPNS and appends it to the control buffer if has extra space or returns MSG_CTRUNC otherwise. The 32-bit time field is kept as-is. Also for !__ASSUME_TIME64_SYSCALLS it limits the maximum number of 'struct mmsghdr *' to IOV_MAX (and also increases the stack size requirement to IOV_MAX times sizeof (socklen_t)). The Linux imposes a similar limit to sendmmsg, so bound the array size on recvmmsg is not unreasonable. And this will be used only on older when building with 32-bit time support. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). --- sysdeps/unix/sysv/linux/recvmmsg.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c b/sysdeps/unix/sysv/linux/recvmmsg.c index 672ba20332..5cd107ffa9 100644 --- a/sysdeps/unix/sysv/linux/recvmmsg.c +++ b/sysdeps/unix/sysv/linux/recvmmsg.c @@ -44,13 +44,26 @@ __recvmmsg64 (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, ts32 = valid_timespec64_to_timespec (*timeout); pts32 = &ts32; } + + socklen_t csize[IOV_MAX]; + if (vlen > IOV_MAX) + vlen = IOV_MAX; + for (int i = 0; i < vlen; i++) + csize[i] = vmessages[i].msg_hdr.msg_controllen; + # ifdef __ASSUME_RECVMMSG_SYSCALL r = SYSCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, pts32); # else r = SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, pts32); # endif - if (r >= 0 && timeout != NULL) - *timeout = valid_timespec_to_timespec64 (ts32); + if (r >= 0) + { + if (timeout != NULL) + *timeout = valid_timespec_to_timespec64 (ts32); + + for (int i=0; i < r; i++) + __convert_scm_timestamps (&vmessages[i].msg_hdr, csize[i]); + } #endif /* __ASSUME_TIME64_SYSCALLS */ return r; } From patchwork Fri Mar 5 20:14:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42308 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 4667C399C03A; Fri, 5 Mar 2021 20:15:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4667C399C03A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975359; bh=t5yHb+CjKETunkyZFq5w3O5PbRsUTtthBXCqJmoHQdg=; 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=F9rC/yjDI98GbRQq4Dr9s3nuqvwKV3LSPvnxZttq6u/5ExPRu2oikrQIz6zTApE4Z P0HXiV5lhisAefCHEImx9W4h9rkeMoIWE7MvLZiJMUBkl9yw0223SJmMy9KVLI6Ono B5D9o9BlZe9venv0WxqZHkdnxTYmWx4MRGJrObmI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by sourceware.org (Postfix) with ESMTPS id C9BC3399C03B for ; Fri, 5 Mar 2021 20:15:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C9BC3399C03B Received: by mail-qt1-x833.google.com with SMTP id v64so2772210qtd.5 for ; Fri, 05 Mar 2021 12:15:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t5yHb+CjKETunkyZFq5w3O5PbRsUTtthBXCqJmoHQdg=; b=P3RTXLL4dJYy9Oao2Q218MRo0y7vWLBoByztYLjkj4fGdXNFGpsH727Uhcex/4JylD vK/zAdvhspzRoDJ3e3I4v7P0jmGCUKc/YXhrMRuWEidGPk/5pHeklgQReozP/wuFA6Ao BDGj0BkKTryby5Kw8rP3sYY8Ig8KMNwb1+glJaqdz9i1daonBWVzCGm+dN0ULStZeBwB xWVCiwY+SzTyd8HpufugM+9BYkZBwKWhAjFxyWd8aXZiv9Ul+BPcmgwin2+rb+8N9+H/ Kep1du2SODXq3dYsfm+Xjks6AB2Is7pc/kBSq89FH9ZFB2dgvt9WIw5T/555akSnKMHM 79qQ== X-Gm-Message-State: AOAM5324oIbBaZmzaFH+Pp5Ltha8mghYWIGJgZjHtsmLQArh1yyOuEpV x8qdZONA9ts2yN+zgWrbLgxgAx0PfA4iBg== X-Google-Smtp-Source: ABdhPJzxT8fITkmPByMTqp7JPZA5l8dICoRSEwR4Bb++3dVBAu6R/3qhfPI2ct6ybOAuOUKZKhtwxQ== X-Received: by 2002:ac8:5d42:: with SMTP id g2mr10732731qtx.46.1614975355285; Fri, 05 Mar 2021 12:15:55 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:55 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 27/52] y2038: Add __USE_TIME_BITS64 support for time_t Date: Fri, 5 Mar 2021 17:14:53 -0300 Message-Id: <20210305201518.798584-28-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The __USE_TIME_BITS64 is not defined internally yet. --- time/bits/types/time_t.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/time/bits/types/time_t.h b/time/bits/types/time_t.h index ab8287c6fe..84d67f6ac3 100644 --- a/time/bits/types/time_t.h +++ b/time/bits/types/time_t.h @@ -4,6 +4,10 @@ #include /* Returned by `time'. */ +#ifdef __USE_TIME_BITS64 +typedef __time64_t time_t; +#else typedef __time_t time_t; +#endif #endif From patchwork Fri Mar 5 20:14:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42309 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 E43D5399F009; Fri, 5 Mar 2021 20:15:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E43D5399F009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975360; bh=656g24AHe+uEFLAap00joi+XiMoOwKV1SL6iVVDcPR0=; 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=Znw+Lagfj4PGu9J8WYVxNGWkJxlquRGvFN3RuUOTTbW8LiOrgC2E8ztw4LAVPYNTc 4JkGWeNmb6C3WG7Y4iaw6ZjfhubN8IiGPG1IZBUvNblcKsAdW1Q4j2WaaC5l6zoDGB 3g7ks/q6QtKcmNLqJM9s0nbL+y5P1WwpU8jnpUuk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by sourceware.org (Postfix) with ESMTPS id DC642399C03D for ; Fri, 5 Mar 2021 20:15:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DC642399C03D Received: by mail-qt1-x829.google.com with SMTP id v64so2772251qtd.5 for ; Fri, 05 Mar 2021 12:15:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=656g24AHe+uEFLAap00joi+XiMoOwKV1SL6iVVDcPR0=; b=XvE1prAQXNg2QmUmsk0GniaIwgCbpiT+13GwQY7yFWAhg9znE90C9cyrS2zq6sKyjQ amtgvEVrG10VefmmufNlRyv7PAcnZUyvyoIf8KWrPgJJTBVOEKGciISAEMuQyGllnNzh eA1qyWvSzM779Bs+Z/J2CcJ8GKXr8XaCahtwN+DCpFzxduXFuPjQCuULA2WpAEapXaYY U9gZUUZKFDaSinRovJgPceFLbfiwyBQzumBdVm9T/keNC4cvz+iGEB4bfW1Dn/+K9SaW O0hmV5vj27NfqjzPMMcotiyg808plKGULb8o/UXEUEwEnzoaRXInA7tQviUTHww0KFXA 9wkg== X-Gm-Message-State: AOAM532C1cS447lE/Sl11Ft+VNozbRVN9kOiBWYij9pNj7kilm55rQBm iepnWVsh/NK4dO91PrNQ3RfB5U5MSShieA== X-Google-Smtp-Source: ABdhPJyiot8n4K+L3+ab9+JlzXWNU/tpr9MYePuSD4xobdx4xtjkNv5XLKPNRotR5YMmztN/4+gh4Q== X-Received: by 2002:ac8:6e85:: with SMTP id c5mr3749754qtv.299.1614975356416; Fri, 05 Mar 2021 12:15:56 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:56 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 28/52] y2038: Add __USE_TIME_BITS64 support for struct timeval Date: Fri, 5 Mar 2021 17:14:54 -0300 Message-Id: <20210305201518.798584-29-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The __USE_TIME_BITS64 is not defined internally yet. --- time/bits/types/struct_timeval.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/time/bits/types/struct_timeval.h b/time/bits/types/struct_timeval.h index 70394ce886..3466137c35 100644 --- a/time/bits/types/struct_timeval.h +++ b/time/bits/types/struct_timeval.h @@ -7,7 +7,12 @@ microsecond but also has a range of years. */ struct timeval { +#ifdef __USE_TIME_BITS64 + __time64_t tv_sec; /* Seconds. */ + __suseconds64_t tv_usec; /* Microseconds. */ +#else __time_t tv_sec; /* Seconds. */ __suseconds_t tv_usec; /* Microseconds. */ +#endif }; #endif From patchwork Fri Mar 5 20:14:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42310 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 6FED4399F016; Fri, 5 Mar 2021 20:16:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FED4399F016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975360; bh=Tn++8IMq1jfClsgXizj0ItYOHILNuaqXc2VKy9liiQE=; 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=rcmTkmqPtR+Ud5zTyVoZBG3HmFUsxDtXDhfDs5wK4ARrjpw9xCOIuXg1O4Up4echh Tz69mDmB+jQbZ7aPia8QoDm4NWKfF6rZJHg3fUL7dVWz/DUPbyPQiG8EAkjoo0oVMH u310/lguT7/27lAbZn73fmVmFZsI5ZIIaL7WPzz0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by sourceware.org (Postfix) with ESMTPS id F2DFD399F003 for ; Fri, 5 Mar 2021 20:15:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F2DFD399F003 Received: by mail-qk1-x72b.google.com with SMTP id z190so3255494qka.9 for ; Fri, 05 Mar 2021 12:15:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tn++8IMq1jfClsgXizj0ItYOHILNuaqXc2VKy9liiQE=; b=cy5SGuZrypOD2WV6r8pcLBi1OF/zegYFFfNTAdbzAHWyqE+BIvBL4JCAVkS8G4xYNf XEctaWmm7FjtXNsg0Vz9e7/R4F0gLBY1o+1ndPiSexvOMetl7PXO6H2Uj+BrCQ0PHVUO LOFKBrAQzkMx5dZpwL4ZRjZzPjG95kXVOY4xK3muVzF/q9QIXqQS4xr/ST2NWKV5Ugg9 P1uygkaj9mczyvjRlU0hqiQyjviVZmTwErEQHYoeNqBoJOFOK8lHUYNWTCGkNbXH6ywj BYCcfDFOrcaxGKOPNBDvgSZcK8g8prts9ZzoWTDrlPd8/6ncQyOMSHf3cc2JpCABHsv2 k90w== X-Gm-Message-State: AOAM533y2Purr9unMxUlgW+H3Bnf2IbW6bodWB5rlMxkGaqnIUhGXLGK T9JR1I1x33GSxR+3xkjD+vn1byB+DAX3UQ== X-Google-Smtp-Source: ABdhPJwTkSnBUCApgVj57tpOuXsaNCvi32eKgfpwWeIChKY1SJE/xWqgQGEpjukgUftQhLKqbgatyA== X-Received: by 2002:a05:620a:91b:: with SMTP id v27mr11047680qkv.201.1614975357483; Fri, 05 Mar 2021 12:15:57 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:57 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 29/52] y2038: Add __USE_TIME_BITS64 support for struct timespec Date: Fri, 5 Mar 2021 17:14:55 -0300 Message-Id: <20210305201518.798584-30-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The __USE_TIME_BITS64 is not defined internally yet. --- time/bits/types/struct_timespec.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h index d11c69cfd3..4fe47a0d25 100644 --- a/time/bits/types/struct_timespec.h +++ b/time/bits/types/struct_timespec.h @@ -1,18 +1,22 @@ -/* NB: Include guard matches what uses. */ -#ifndef _STRUCT_TIMESPEC -#define _STRUCT_TIMESPEC 1 +#ifndef __struct_timespec_defined +#define __struct_timespec_defined 1 #include #include +#include /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { +#ifdef __USE_TIME_BITS64 + __time64_t tv_sec; /* Seconds. */ +#else __time_t tv_sec; /* Seconds. */ +#endif #if __WORDSIZE == 64 \ || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \ - || __TIMESIZE == 32 + || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64) __syscall_slong_t tv_nsec; /* Nanoseconds. */ #else # if __BYTE_ORDER == __BIG_ENDIAN From patchwork Fri Mar 5 20:14:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42311 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 01E22399F01B; Fri, 5 Mar 2021 20:16:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01E22399F01B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975361; bh=XBUHtvnsiUC2hIq8mdQ21rSkqibsO3dxlt2z/Uu1dgI=; 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=g4wofCK7iyj7N4JVmzmzs0v00aQQQ1I6vJLZPXlz4XV/LYaGgv7gQv37DiDxY1E5y +e6nkfbl5UGsoP4CZ5VjA78TFxJroOySvMHXQ4uOsimzQd9yHQkLb11hA6QJa8TSJ2 yzbTgn9Tgj3jYidX/S49a9IH+D9B0wqAdLzL03x4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by sourceware.org (Postfix) with ESMTPS id 0CE62399F00C for ; Fri, 5 Mar 2021 20:15:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0CE62399F00C Received: by mail-qt1-x82a.google.com with SMTP id w6so2773191qti.6 for ; Fri, 05 Mar 2021 12:15:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XBUHtvnsiUC2hIq8mdQ21rSkqibsO3dxlt2z/Uu1dgI=; b=W99RDJQSfBrZnBuUyZQxgOp4hC+iRbtf43yqLm312F6BlUanVKAEsCvN5j7Xiz0jd3 12UqImvJGibJibhVVXFsm900GX4EedbBPPTnc5Fp2KoLnoqjBP6qnaP81c0F7Bdbxeaw +kAEZG7hyA9EnwSqSrPEk2dNYQveLFr/5h2O22RSSDfECoNSiGf+idy3ZwtgRsC/9f2Y n9yPJt0DOQd2Gu1e+CLLHa53FX3ojumzvmMV6n3xmjOohB9+KeqFFiFkN+OkjdWsgIAu C5S8bsJo3wLDXFNnOQCJxrtPwdQhI8a3Dqbdh0LCkTg84Emn7no3QCVelyampflzJ7MQ ypXw== X-Gm-Message-State: AOAM531OWKaczeGpb00domtyHixSSP8yrfXmTQ2C7n+4W5HvXumVU/d+ xKhJGury6p6ejDYUZ6wOjr5s1o9KJjfviA== X-Google-Smtp-Source: ABdhPJxBE5HtuAaZr5Z8tPEaBtKtWHlbDyq5+Krp9F2aWtYc2mMDXIFNe8fheyUVSGbD0kX+VD30YA== X-Received: by 2002:ac8:5b8f:: with SMTP id a15mr10378929qta.106.1614975358545; Fri, 05 Mar 2021 12:15:58 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:58 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 30/52] y2038: Add __USE_TIME_BITS64 support for struct utimbuf Date: Fri, 5 Mar 2021 17:14:56 -0300 Message-Id: <20210305201518.798584-31-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The __USE_TIME_BITS64 is not defined internally yet. --- io/utime.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/io/utime.h b/io/utime.h index df2299e406..c7612d0838 100644 --- a/io/utime.h +++ b/io/utime.h @@ -35,8 +35,13 @@ __BEGIN_DECLS /* Structure describing file times. */ struct utimbuf { +#ifdef __USE_TIME_BITS64 + __time64_t actime; /* Access time. */ + __time64_t modtime; /* Modification time. */ +#else __time_t actime; /* Access time. */ __time_t modtime; /* Modification time. */ +#endif }; /* Set the access and modification times of FILE to those given in From patchwork Fri Mar 5 20:14:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42312 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 84BF3399C03D; Fri, 5 Mar 2021 20:16:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84BF3399C03D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975362; bh=lbL/cPXCKCF79/1JvcA8qLDF8xxni16PCBmFU7SSQoI=; 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=Wa1rP959bsUnJoAOj9yey+S8t8c98nikSdE2VnyG50GNnkAVGZsWezv4NLlVO3s8V SRlensuVJVtEo4OtjzL0QWzlfhJKkWRBKR8y10N7zrLdjTUrS2FhTj1AeNXQONaXIQ QfGjudZezf7OnYrY5emhNq4BX5MQrw3uVatF2Guc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by sourceware.org (Postfix) with ESMTPS id 30CAD399F00F for ; Fri, 5 Mar 2021 20:16:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 30CAD399F00F Received: by mail-qk1-x734.google.com with SMTP id z128so3239980qkc.12 for ; Fri, 05 Mar 2021 12:16:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lbL/cPXCKCF79/1JvcA8qLDF8xxni16PCBmFU7SSQoI=; b=Pxvo+dVYOgtzgz8axpG1WPN7oYI7GskHUXUG2FVTpluMu4bXLUA7C11O/Y3czar/he kN6j5/OnCMQu8zMuH10teETfNw+cCwq5kiCE3JsEKgnoOIwIIMDeZOnZnAlQLZzRva6N 5kZAqn/GdW84HnnxBsRuNdukUfvw2GNIv9m2DRQX8/MXuhnJja7FDPj4caTXGkLncbNw P/KbQBSwq9JoFCU1ReGL4nc5KVpzcti49bu5W5CjE/7whPZYJGQsHW5za4fWJPOyfYoG /bnw8x+SKolbiWprn7XiT4S+KlUzdaQfGPPKjnmtcF/XtXAuOEnhbMAmaDYZRN/wBoot /ePw== X-Gm-Message-State: AOAM5323OW/4/CEHtghuGPZLCBLp/3IlkXBbPk3qmxXQ6qd2Op9bab7f X/3AcL/xWpzPriQTr/ZawHYLN4nnNUg7Zg== X-Google-Smtp-Source: ABdhPJxrjvx+PW6cz0I+oOoTLirfHxU4U4w3BFGIjyjDxmZLlym34FWUBpj7vOBFVkHwqFbjkK2m/w== X-Received: by 2002:a37:584:: with SMTP id 126mr10287425qkf.274.1614975359627; Fri, 05 Mar 2021 12:15:59 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:59 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 31/52] y2038: linux: Add __USE_TIME_BITS64 support for struct timex Date: Fri, 5 Mar 2021 17:14:57 -0300 Message-Id: <20210305201518.798584-32-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The __USE_TIME_BITS64 is not defined internally yet. --- sysdeps/unix/sysv/linux/bits/timex.h | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sysdeps/unix/sysv/linux/bits/timex.h b/sysdeps/unix/sysv/linux/bits/timex.h index 9b2e30f3e0..ee37694e8f 100644 --- a/sysdeps/unix/sysv/linux/bits/timex.h +++ b/sysdeps/unix/sysv/linux/bits/timex.h @@ -25,6 +25,36 @@ struct timex { +# ifdef __USE_TIME_BITS64 + unsigned int modes; /* mode selector */ + int :32; /* pad */ + long long offset; /* time offset (usec) */ + long long freq; /* frequency offset (scaled ppm) */ + long long maxerror; /* maximum error (usec) */ + long long esterror; /* estimated error (usec) */ + int status; /* clock command/status */ + int :32; /* pad */ + long long constant; /* pll time constant */ + long long precision; /* clock precision (usec) (read only) */ + long long tolerance; /* clock frequency tolerance (ppm) (ro) */ + struct timeval time; /* (read only, except for ADJ_SETOFFSET) */ + long long tick; /* (modified) usecs between clock ticks */ + long long ppsfreq; /* pps frequency (scaled ppm) (ro) */ + long long jitter; /* pps jitter (us) (ro) */ + int shift; /* interval duration (s) (shift) (ro) */ + int :32; /* pad */ + long long stabil; /* pps stability (scaled ppm) (ro) */ + long long jitcnt; /* jitter limit exceeded (ro) */ + long long calcnt; /* calibration intervals (ro) */ + long long errcnt; /* calibration errors (ro) */ + long long stbcnt; /* stability limit exceeded (ro) */ + + int tai; /* TAI offset (ro) */ + + int :32; int :32; int :32; int :32; + int :32; int :32; int :32; int :32; + int :32; int :32; int :32; +# else unsigned int modes; /* mode selector */ __syscall_slong_t offset; /* time offset (usec) */ __syscall_slong_t freq; /* frequency offset (scaled ppm) */ @@ -51,6 +81,7 @@ struct timex int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; +# endif }; /* Mode codes (timex.mode) */ From patchwork Fri Mar 5 20:14:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42316 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 CA385399F020; Fri, 5 Mar 2021 20:16:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA385399F020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975368; bh=3WUYWyl/gr9gLA/Ops+og5dDfyPjPlvASNniL6c3ToM=; 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=FRVzVTqR/KKqgetjXGozT3uth6I5BVhcAmPZcR3VH84G2GwLX3wEanW9a2nSAMlCA TIHBICbMVKJNFq/px3423MFllZnSWLPXhqQN5K6OxNNI+wtVarbnIuOSoM7KqpfbhF Ga6SMT04SHzLVrkkfw+7jDaqC6JdEIIsRi+XU4RM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by sourceware.org (Postfix) with ESMTPS id 846BB388A427 for ; Fri, 5 Mar 2021 20:16:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 846BB388A427 Received: by mail-qv1-xf32.google.com with SMTP id 15so1604062qvp.13 for ; Fri, 05 Mar 2021 12:16:02 -0800 (PST) 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=3WUYWyl/gr9gLA/Ops+og5dDfyPjPlvASNniL6c3ToM=; b=CCSJhueJqUpxn63NqPg9zxlVExv20OFRXfIThvOKWpJFMDWfE/h7ooTTzaWjmzeJ/+ oZruaD0asgbOzWuDTKmZ80MAGsmTBZcCQvGQZsq7zbyukodeqK6ndkV/oCoKVtJ62TCX aslBYb8XQVj4xE4efCUdBBjUw50FgO5dkb9TZ0/Q4iop7qM4/zjHHfoLgaJSFA+R665S epkVYgrom9q15515JoutDFrnE6EhyLPGITMmRYcYVEAm16uFZ6HbnT7FJ6SQrp8sb/A/ s9OwazfOrhnV7RFyTeY2ix8Cex0kGNMqU6duVusuz3hHp0s5fi/WUikBqSuelsoGjTan zGdQ== X-Gm-Message-State: AOAM532JN+ZAGE0RnwLVjSibGH2LAafMPJuvzzqlqzQHl4l7hGHbiUyY +GXJq57dE2Kj8uZwO1sBEYR33Vj31EH0Mg== X-Google-Smtp-Source: ABdhPJzReDGZ6A2R1+NPLyzCP+zP703X5d/5uyJz7Z1Lmgx3PSwZJ8r+T9mSttUj2sHZBCUfbxeNpA== X-Received: by 2002:a05:6214:209:: with SMTP id i9mr10834707qvt.4.1614975361010; Fri, 05 Mar 2021 12:16:01 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:00 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 32/52] y2038: Use a common definition for stat Date: Fri, 5 Mar 2021 17:14:58 -0300 Message-Id: <20210305201518.798584-33-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" From: Lukasz Majewski Instead of replicate the same definitions from struct_stat_time64.h on the multiple struct_stat.h, use a common header which is included when required (struct_stat_time64_helper.h). The 64-bit time support is added only for LFS support. The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit stat implementations. --- sysdeps/unix/sysv/linux/Makefile | 3 +- sysdeps/unix/sysv/linux/bits/struct_stat.h | 51 ++++++----- .../linux/bits/struct_stat_time64_helper.h | 63 +++++++++++++ .../unix/sysv/linux/m68k/bits/struct_stat.h | 50 ++++++----- .../sysv/linux/microblaze/bits/struct_stat.h | 48 ++++++---- .../unix/sysv/linux/mips/bits/struct_stat.h | 89 ++++++++++-------- .../sysv/linux/powerpc/bits/struct_stat.h | 52 ++++++----- sysdeps/unix/sysv/linux/struct_stat_time64.h | 59 +----------- .../unix/sysv/linux/x86/bits/struct_stat.h | 90 ++++++++++--------- 9 files changed, 285 insertions(+), 220 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 6743936b5a..3263b9c0e5 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -100,7 +100,8 @@ sysdep_headers += sys/mount.h sys/acct.h \ bits/types/struct_msqid_ds.h \ bits/types/struct_shmid_ds.h \ bits/ipc-perm.h \ - bits/struct_stat.h + bits/struct_stat.h \ + bits/struct_stat_time64_helper.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat.h b/sysdeps/unix/sysv/linux/bits/struct_stat.h index b852ee256e..ba41f86142 100644 --- a/sysdeps/unix/sysv/linux/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/bits/struct_stat.h @@ -28,32 +28,35 @@ struct stat { +#ifdef __USE_TIME_BITS64 +# include +#else __dev_t st_dev; /* Device. */ unsigned short int __pad1; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ -#else +# else __ino_t __st_ino; /* 32bit file serial number. */ -#endif +# endif __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ __dev_t st_rdev; /* Device number, if device. */ unsigned short int __pad2; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ -#else +# else __off64_t st_size; /* Size of file, in bytes. */ -#endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -#else +# else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#endif -#ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -63,28 +66,32 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif -#ifndef __USE_FILE_OFFSET64 +# endif +# ifndef __USE_FILE_OFFSET64 unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -#else +# else __ino64_t st_ino; /* File serial number. */ -#endif +# endif +#endif /* __USE_TIME_BITS64 */ }; #ifdef __USE_LARGEFILE64 struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ unsigned int __pad1; @@ -99,7 +106,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -109,15 +116,16 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# else +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif __ino64_t st_ino; /* File serial number. */ +# endif /* __USE_TIME_BITS64 */ }; #endif @@ -127,5 +135,4 @@ struct stat64 /* Nanosecond resolution time values are supported. */ #define _STATBUF_ST_NSEC - #endif /* _BITS_STRUCT_STAT_H */ diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h new file mode 100644 index 0000000000..77385e9073 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h @@ -0,0 +1,63 @@ +/* Definition for helper to define struct stat with 64 bit time. + Copyright (C) 2021 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 + . */ + + /* Content of internal __stat64_t64 struct. */ + __dev_t st_dev; /* Device. */ + __ino64_t st_ino; /* file serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group. */ + __dev_t st_rdev; /* Device number, if device. */ + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +#ifdef __USE_XOPEN2K8 +# ifndef __struct_timespec +# define __struct_timespec struct timespec +# endif + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + __struct_timespec st_atim; + __struct_timespec st_mtim; + __struct_timespec st_ctim; +# define st_atime st_atim.tv_sec +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# undef __struct_timespec +#else +/* The definition should be equal to the 'struct __timespec64' internal + layout. */ +# if __BYTE_ORDER == __BIG_ENDIAN +# define __fieldts64(name) \ + __time64_t name; __int32_t :32; __int32_t name ## nsec +# else +# define __fieldts64(name) \ + __time64_t name; __int32_t name ## nsec; __int32_t :32 +# endif + + __fieldts64 (st_atime); + __fieldts64 (st_mtime); + __fieldts64 (st_ctime); + +# undef __fieldts64 +#endif diff --git a/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h b/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h index 4ae7506eb5..0512ecc3bc 100644 --- a/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h @@ -25,32 +25,35 @@ struct stat { +#ifdef __USE_TIME_BITS64 +# include +#else __dev_t st_dev; /* Device. */ unsigned short int __pad1; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ -#else +# else __ino_t __st_ino; /* 32bit file serial number. */ -#endif +# endif __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ __dev_t st_rdev; /* Device number, if device. */ unsigned short int __pad2; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ -#else +# else __off64_t st_size; /* Size of file, in bytes. */ -#endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -#else +# else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#endif -#ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -60,28 +63,32 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif -#ifndef __USE_FILE_OFFSET64 +# endif +# ifndef __USE_FILE_OFFSET64 unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -#else +# else __ino64_t st_ino; /* File serial number. */ -#endif +# endif +#endif /* __USE_TIME_BITS64 */ }; #ifdef __USE_LARGEFILE64 struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ unsigned short int __pad1; @@ -96,7 +103,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -106,15 +113,16 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# else +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif __ino64_t st_ino; /* File serial number. */ +# endif /* __USE_TIME_BITS64 */ }; #endif diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h index be1bdc3557..0284d4b2b2 100644 --- a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h @@ -26,6 +26,9 @@ #ifndef __USE_FILE_OFFSET64 struct stat { +#ifdef __USE_TIME_BITS64 +# include +#else __dev_t st_dev; /* Device. */ __ino_t st_ino; /* File serial number. */ __mode_t st_mode; /* File mode. */ @@ -38,7 +41,7 @@ struct stat __blksize_t st_blksize; /* Optimal block size for I/O. */ int __pad3; __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format * equivalent to 'struct timespec'. This is the type used * whenever possible but the Unix namespace rules do not allow the @@ -48,19 +51,20 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif unsigned int __glibc_reserved4; unsigned int __glibc_reserved5; +#endif /* __USE_TIME_BITS64 */ }; #else /* __USE_FILE_OFFSET64 */ /* MS: If __USE_FILE_OFFSET64 is setup then struct stat should match stat64 @@ -70,6 +74,9 @@ struct stat * create one ifdef to separate stats structures. */ struct stat { +#ifdef __USE_TIME_BITS64 +# include +#else unsigned long long st_dev; /* Device. */ __ino64_t st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ @@ -82,7 +89,7 @@ struct stat __blksize_t st_blksize; /* Optimal block size for I/O. */ int __pad3; __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +# ifdef __USE_MISC /* Nanosecond resolution timestamps are stored in a format * equivalent to 'struct timespec'. This is the type used * whenever possible but the Unix namespace rules do not allow the @@ -92,25 +99,29 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif unsigned int __glibc_reserved4; unsigned int __glibc_reserved5; +# endif /* __USE_TIME_BITS64 */ }; #endif /* __USE_FILE_OFFSET64 */ #ifdef __USE_LARGEFILE64 struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else unsigned long long st_dev; /* Device. */ __ino64_t st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ @@ -123,7 +134,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ int __pad3; __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format * equivalent to 'struct timespec'. This is the type used * whenever possible but the Unix namespace rules do not allow the @@ -133,19 +144,20 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif unsigned int __glibc_reserved4; unsigned int __glibc_reserved5; +# endif /* __USE_TIME_BITS64 */ }; #endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h b/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h index 7ae4c10827..ab9f474cbc 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h @@ -29,28 +29,31 @@ /* Structure describing file characteristics. */ struct stat { +# ifdef __USE_TIME_BITS64 +# include +# else unsigned long int st_dev; long int st_pad1[3]; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ -#else +# else __ino64_t st_ino; /* File serial number. */ -#endif +# endif __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ unsigned long int st_rdev; /* Device number, if device. */ -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 long int st_pad2[2]; __off_t st_size; /* Size of file, in bytes. */ /* SVR4 added this extra long to allow for expansion of off_t. */ long int st_pad3; -#else +# else long int st_pad2[3]; __off64_t st_size; /* Size of file, in bytes. */ -#endif -#ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -60,30 +63,34 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ -#else +# else long int st_pad4; __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ -#endif +# endif long int st_pad5[14]; +# endif /* __USE_TIME_BITS64 */ }; -#ifdef __USE_LARGEFILE64 +# ifdef __USE_LARGEFILE64 struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else unsigned long int st_dev; long int st_pad1[3]; __ino64_t st_ino; /* File serial number. */ @@ -94,7 +101,7 @@ struct stat64 unsigned long int st_rdev; /* Device number, if device. */ long int st_pad2[3]; __off64_t st_size; /* Size of file, in bytes. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -104,44 +111,47 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# else +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ long int st_pad3; __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ long int st_pad4[14]; +# endif /* __USE_TIME_BITS64 */ }; -#endif -#else +# endif /* __USE_LARGEFILE64 */ + +#else /* _MIPS_SIM != _ABIO32 */ + struct stat { __dev_t st_dev; int st_pad1[3]; /* Reserved for st_dev expansion */ -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __ino_t st_ino; -#else +# else __ino64_t st_ino; -#endif +# endif __mode_t st_mode; __nlink_t st_nlink; __uid_t st_uid; __gid_t st_gid; __dev_t st_rdev; -#if !defined __USE_FILE_OFFSET64 +# if !defined __USE_FILE_OFFSET64 unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */ __off_t st_size; int st_pad3; -#else +# else unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ __off64_t st_size; -#endif -#ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -151,24 +161,24 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif __blksize_t st_blksize; unsigned int st_pad4; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; -#else +# else __blkcnt64_t st_blocks; -#endif +# endif int st_pad5[14]; }; @@ -185,7 +195,7 @@ struct stat64 __dev_t st_rdev; unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ __off64_t st_size; -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -195,20 +205,21 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# else +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif __blksize_t st_blksize; unsigned int st_pad3; __blkcnt64_t st_blocks; int st_pad4[14]; }; #endif + #endif /* Tell code we have these members. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h index 12caab2790..f55eb658a2 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h @@ -26,35 +26,37 @@ #include #if __WORDSIZE == 32 - struct stat { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ -# ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 unsigned short int __pad1; __ino_t st_ino; /* File serial number. */ -# else +# else __ino64_t st_ino; /* File serial number. */ -# endif +# endif __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ __dev_t st_rdev; /* Device number, if device. */ unsigned short int __pad2; -# ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ -# else +# else __off64_t st_size; /* Size of file, in bytes. */ -# endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -# ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -# else +# else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# endif -# ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -64,25 +66,28 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; +# endif /* __USE_TIME_BITS64 */ }; - # ifdef __USE_LARGEFILE64 struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ __ino64_t st_ino; /* File serial number. */ __mode_t st_mode; /* File mode. */ @@ -94,7 +99,7 @@ struct stat64 __off64_t st_size; /* Size of file, in bytes. */ __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -104,19 +109,20 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; +# endif /* __USE_TIME_BITS64 */ }; # endif /* __USE_LARGEFILE64 */ diff --git a/sysdeps/unix/sysv/linux/struct_stat_time64.h b/sysdeps/unix/sysv/linux/struct_stat_time64.h index f0a29d7fe5..260d1812be 100644 --- a/sysdeps/unix/sysv/linux/struct_stat_time64.h +++ b/sysdeps/unix/sysv/linux/struct_stat_time64.h @@ -22,64 +22,13 @@ #if __TIMESIZE == 64 # define __stat64_t64 stat64 #else -# ifdef __USE_LARGEFILE64 -# include - -/* The definition should be equal to the 'struct __timespec64' internal - layout. */ -# if BYTE_ORDER == BIG_ENDIAN -# define __fieldts64(name) \ - __time64_t name; __int32_t :32; __int32_t name ## nsec -# else -# define __fieldts64(name) \ - __time64_t name; __int32_t name ## nsec; __int32_t :32 -# endif - -/* Workaround for the definition from struct_stat.h */ -# undef st_atime -# undef st_mtime -# undef st_ctime +# include struct __stat64_t64 { - __dev_t st_dev; /* Device. */ - __ino64_t st_ino; /* file serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __off64_t st_size; /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct __timespec64 st_atim; /* Time of last access. */ - struct __timespec64 st_mtim; /* Time of last modification. */ - struct __timespec64 st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else - __fieldts64 (st_atime); - __fieldts64 (st_mtime); - __fieldts64 (st_ctime); -# endif /* __USE_XOPEN2K8 */ +# define __struct_timespec struct __timespec64 +# include }; - -# define _STATBUF_ST_BLKSIZE -# define _STATBUF_ST_RDEV -# define _STATBUF_ST_NSEC - -# undef __fieldts64 - -# endif /* __USE_LARGEFILE64 */ - -# endif /* __TIMESIZE == 64 */ +#endif /* __TIMESIZE == 64 */ #endif /* _BITS_STRUCT_STAT_TIME64_H */ diff --git a/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h b/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h index 6ddd01db46..01ee7ff6b3 100644 --- a/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h @@ -25,43 +25,46 @@ struct stat { +#ifdef __USE_TIME_BITS64 +# include +#else __dev_t st_dev; /* Device. */ -#ifndef __x86_64__ +# ifndef __x86_64__ unsigned short int __pad1; -#endif -#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 +# endif +# if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ -#else +# else __ino_t __st_ino; /* 32bit file serial number. */ -#endif -#ifndef __x86_64__ +# endif +# ifndef __x86_64__ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ -#else +# else __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ -#endif +# endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ -#ifdef __x86_64__ +# ifdef __x86_64__ int __pad0; -#endif +# endif __dev_t st_rdev; /* Device number, if device. */ -#ifndef __x86_64__ +# ifndef __x86_64__ unsigned short int __pad2; -#endif -#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 +# endif +# if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ -#else +# else __off64_t st_size; /* Size of file, in bytes. */ -#endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 +# if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -#else +# else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#endif -#ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -71,58 +74,62 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ -#endif -#ifdef __x86_64__ +# endif +# ifdef __x86_64__ __syscall_slong_t __glibc_reserved[3]; -#else -# ifndef __USE_FILE_OFFSET64 +# else +# ifndef __USE_FILE_OFFSET64 unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# else +# else __ino64_t st_ino; /* File serial number. */ +# endif # endif -#endif +#endif /* __USE_TIME_BITS64 */ }; #ifdef __USE_LARGEFILE64 /* Note stat64 has the same shape as stat for x86-64. */ struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ -# ifdef __x86_64__ +# ifdef __x86_64__ __ino64_t st_ino; /* File serial number. */ __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ -# else +# else unsigned int __pad1; __ino_t __st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ -# endif +# endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ -# ifdef __x86_64__ +# ifdef __x86_64__ int __pad0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ -# else +# else __dev_t st_rdev; /* Device number, if device. */ unsigned int __pad2; __off64_t st_size; /* Size of file, in bytes. */ -# endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -132,19 +139,20 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# else +# else __time_t st_atime; /* Time of last access. */ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ -# endif -# ifdef __x86_64__ +# endif +# ifdef __x86_64__ __syscall_slong_t __glibc_reserved[3]; -# else +# else __ino64_t st_ino; /* File serial number. */ -# endif +# endif +# endif /* __USE_TIME_BITS64 */ }; #endif From patchwork Fri Mar 5 20:14:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42314 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 B438A399F021; Fri, 5 Mar 2021 20:16:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B438A399F021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975367; bh=hiE98gNK0xp3dYMT+30hgnT3S6fdGTmGP6xxXGteABI=; 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=Wlx8FJHDF31r5s5dhGbS64Lbjmt3Pgr90jvNzg5VoVq6WPO9fxPWKeAyaUTAL64cD 9BeK02b6k2ozTUR3CBsQq2nkf0gWf1HIu8cDWC3Q19Ujxt0f42d+zhPxjCrrmT+Tdq 0anq8hDYAyDl7PZ+/baBNWHDT5gHU6/O1BEhZt0Y= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id 4833B382D438 for ; Fri, 5 Mar 2021 20:16:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4833B382D438 Received: by mail-qt1-x831.google.com with SMTP id t13so1388888qta.11 for ; Fri, 05 Mar 2021 12:16:03 -0800 (PST) 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=hiE98gNK0xp3dYMT+30hgnT3S6fdGTmGP6xxXGteABI=; b=T5tw/xrowtOXXDn1Pnd4PtqCoi69uF916kc5HVml2qQ866NZDYSiMy1RekpgRbVdF+ LnpHtMLC2boZXZYHJOVufIH+CdUPA1MPgnBGxJ6YkQ3D8IO9Ro6FjXsoQYo4R60Ln0kn aXdoAxMpmRKgFQudj3CXYAGXbqJ3N5j1aeXLlBqQgmOEajotlhpWyM3q0fSr/DijeFbb Bi3aVthB0jvNOZDcwflc2NgfYYEIObqA6gN963hxxEs6wBod53guHys+z9AEFe7OstLI Ge3v9TF0eUv9dtK9rheGJIgICbdac6wZ4GWhnj2mRJ1aM4k1YTVnOImFnts5WfS4/UCf yI/A== X-Gm-Message-State: AOAM530nuK3/z6KkFhaHYeVOyRT5IHBfnrrknATYcwCnNQ/GZx5q7MTh bxEv8UwzpRNBuOyZGgPG+q9g3zEAHKkKMg== X-Google-Smtp-Source: ABdhPJxDv1/SDcPpTea8hmr2GzK0LdRZT4Vh63/IADJTcqqYdHcsof2YTlWUQ+YudeNmwMoEWsb/ww== X-Received: by 2002:a05:622a:10f:: with SMTP id u15mr10688986qtw.198.1614975362517; Fri, 05 Mar 2021 12:16:02 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:02 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 33/52] y2038: Use a common definition for msqid_ds Date: Fri, 5 Mar 2021 17:14:59 -0300 Message-Id: <20210305201518.798584-34-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" From: Lukasz Majewski Instead of replicate the same definitions from struct_msqid64_ds.h on the multiple struct_msqid_ds.h, use a common header which is included when required (struct_msqid64_ds_helper.h). The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit stat implementations. --- sysdeps/unix/sysv/linux/Makefile | 3 +- .../linux/bits/struct_stat_time64_helper.h | 2 +- .../sysv/linux/bits/types/struct_msqid64_ds.h | 10 +------ .../bits/types/struct_msqid64_ds_helper.h | 28 +++++++++++++++++++ .../sysv/linux/bits/types/struct_msqid_ds.h | 12 ++++++-- .../linux/hppa/bits/types/struct_msqid_ds.h | 12 ++++++-- .../linux/mips/bits/types/struct_msqid_ds.h | 18 ++++++++---- .../powerpc/bits/types/struct_msqid_ds.h | 12 ++++++-- .../linux/sparc/bits/types/struct_msqid_ds.h | 12 ++++++-- 9 files changed, 80 insertions(+), 29 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 3263b9c0e5..78e7be9ad5 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -101,7 +101,8 @@ sysdep_headers += sys/mount.h sys/acct.h \ bits/types/struct_shmid_ds.h \ bits/ipc-perm.h \ bits/struct_stat.h \ - bits/struct_stat_time64_helper.h + bits/struct_stat_time64_helper.h \ + bits/types/struct_msqid64_ds_helper.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h index 77385e9073..b37056f5c4 100644 --- a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h +++ b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h @@ -1,4 +1,4 @@ -/* Definition for helper to define struct stat with 64 bit time. +/* Common defitions for struct stat with 64 bit time. Copyright (C) 2021 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h index 43e8cd7cfc..992734914a 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h @@ -25,14 +25,6 @@ #else struct __msqid64_ds { - struct ipc_perm msg_perm; /* structure describing operation permission */ - __time64_t msg_stime; /* time of last msgsnd command */ - __time64_t msg_rtime; /* time of last msgsnd command */ - __time64_t msg_ctime; /* time of last change */ - __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ - msgqnum_t msg_qnum; /* number of messages currently on queue */ - msglen_t msg_qbytes; /* max number of bytes allowed on queue */ - __pid_t msg_lspid; /* pid of last msgsnd() */ - __pid_t msg_lrpid; /* pid of last msgrcv() */ +# include }; #endif diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h new file mode 100644 index 0000000000..02dfddaa2b --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h @@ -0,0 +1,28 @@ +/* Common defintions for struct msqid_ds with 64 bit time. + Copyright (C) 2021 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 + . */ + + /* Content of internal __msqid64_ds. */ + struct ipc_perm msg_perm; /* structure describing operation permission */ + __time64_t msg_stime; /* time of last msgsnd command */ + __time64_t msg_rtime; /* time of last msgsnd command */ + __time64_t msg_ctime; /* time of last change */ + __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ + msgqnum_t msg_qnum; /* number of messages currently on queue */ + msglen_t msg_qbytes; /* max number of bytes allowed on queue */ + __pid_t msg_lspid; /* pid of last msgsnd() */ + __pid_t msg_lrpid; /* pid of last msgrcv() */ diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h index 1ed041ae30..ae10a48452 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h @@ -20,23 +20,28 @@ # error "Never use directly; include instead." #endif +#include + /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm msg_perm; /* structure describing operation permission */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_stime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_ctime; /* time of last change */ unsigned long int __msg_ctime_high; -#else +# else __time_t msg_stime; /* time of last msgsnd command */ __time_t msg_rtime; /* time of last msgsnd command */ __time_t msg_ctime; /* time of last change */ -#endif +# endif __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ @@ -44,4 +49,5 @@ struct msqid_ds __pid_t msg_lrpid; /* pid of last msgrcv() */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; +#endif }; diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h index d943edeb78..5b82dd7f5e 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h @@ -20,23 +20,28 @@ # error "Never use directly; include instead." #endif +#include + /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm msg_perm; /* structure describing operation permission */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __msg_stime_high; __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_ctime_high; __time_t msg_ctime; /* time of last change */ -#else +# else __time_t msg_stime; /* time of last msgsnd command */ __time_t msg_rtime; /* time of last msgsnd command */ __time_t msg_ctime; /* time of last change */ -#endif +# endif __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ @@ -44,4 +49,5 @@ struct msqid_ds __pid_t msg_lrpid; /* pid of last msgrcv() */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; +#endif }; diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h index bdca5e5fe2..00c1804245 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h +++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h @@ -20,32 +20,37 @@ # error "Never use directly; include instead." #endif +#include + /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm msg_perm; /* structure describing operation permission */ -#if __TIMESIZE == 32 -# ifdef __MIPSEL__ +# if __TIMESIZE == 32 +# ifdef __MIPSEL__ __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_stime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_ctime; /* time of last change */ unsigned long int __msg_ctime_high; -# else +# else unsigned long int __msg_stime_high; __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_ctime_high; __time_t msg_ctime; /* time of last change */ -# endif -#else +# endif +# else __time_t msg_stime; /* time of last msgsnd command */ __time_t msg_rtime; /* time of last msgsnd command */ __time_t msg_ctime; /* time of last change */ -#endif +# endif __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ @@ -53,4 +58,5 @@ struct msqid_ds __pid_t msg_lrpid; /* pid of last msgrcv() */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; +#endif }; diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h index 72842ed747..8c296d2342 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h @@ -20,23 +20,28 @@ # error "Never use directly; include instead." #endif +#include + /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm msg_perm; /* structure describing operation permission */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __msg_stime_high; __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_ctime_high; __time_t msg_ctime; /* time of last change */ -#else +# else __time_t msg_stime; /* time of last msgsnd command */ __time_t msg_rtime; /* time of last msgsnd command */ __time_t msg_ctime; /* time of last change */ -#endif +# endif __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ @@ -44,4 +49,5 @@ struct msqid_ds __pid_t msg_lrpid; /* pid of last msgrcv() */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; +#endif }; diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h index 22e1839de1..3c1b68ccc0 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h @@ -20,23 +20,28 @@ # error "Never use directly; include instead." #endif +#include + /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm msg_perm; /* structure describing operation permission */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __msg_stime_high; __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_ctime_high; __time_t msg_ctime; /* time of last change */ -#else +# else __time_t msg_stime; /* time of last msgsnd command */ __time_t msg_rtime; /* time of last msgsnd command */ __time_t msg_ctime; /* time of last change */ -#endif +# endif __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ @@ -44,4 +49,5 @@ struct msqid_ds __pid_t msg_lrpid; /* pid of last msgrcv() */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; +#endif }; From patchwork Fri Mar 5 20:15:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42315 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 458EA399F00D; Fri, 5 Mar 2021 20:16:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 458EA399F00D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975368; bh=zWxYeR2WuUgZ319AHIccznNZW6s7fi8xdNJRMbIgwb0=; 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=wUYcSDvX2hOyrEVOX2k7lHRVatRbjOFwFkFDiAVxn9W0nP/9iTg8bCwlHVyvQIYcJ rR/RFp7XfUYXXNhi0AOWhUNZTigbrf6bO+EAo6TsfJm+Jm19BHwcdeKmPcesUr205V MxwXqeosshLFmyK3f7+uhc58GBWEVwoJiXrPOA6A= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id 7C6AB399F00F for ; Fri, 5 Mar 2021 20:16:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7C6AB399F00F Received: by mail-qt1-x831.google.com with SMTP id r24so2751393qtt.8 for ; Fri, 05 Mar 2021 12:16:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zWxYeR2WuUgZ319AHIccznNZW6s7fi8xdNJRMbIgwb0=; b=YYtl+BESVzdQdbw/BdB2nShXO/pzk5B+9hWPRV2DNXOHp40v2Q103766p3nq5+idRt qGHl5F7dN/6bvGnCr0QMSLCk8ShWErvCKqSi2jDVkVoGPzvrumug2DRkjWMLzednrfR1 ATus9C1/wunAOIrVu7VdSnpjUWWFKCuOpGKSQJjo8IHICWgPNz/lTtKjLK9aNUknnIl+ +JVge9DX1TnVOy3aUT7rHSUHYVNPQ0653UqsDI2xMaMmLVIu4eKm1Xe2Wtku+N3t2x9N BIPl6/1531H1u0o7V+VHzrfSf4k6RIjTnbAYYh973G33s9jiuz/tyQYcPr0/cvU18bL1 EYIg== X-Gm-Message-State: AOAM532/lQMq8xFcPwUgMEMnhoYyYfQU91k9hbkL+buN6Llp+7qFKCVd m4qBjnVoNucxZLGDyPhRKDNUNNnfp8Qqmg== X-Google-Smtp-Source: ABdhPJyZRC/32sJQI4/FR/CgrLqJmWx02yK78PLzjzf+QxmgC2uevhBB4uqUQFtEDJmDyzyVjuEGmg== X-Received: by 2002:aed:33e3:: with SMTP id v90mr10640267qtd.41.1614975363686; Fri, 05 Mar 2021 12:16:03 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:03 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 34/52] y2038: Use a common definition for semid_ds Date: Fri, 5 Mar 2021 17:15:00 -0300 Message-Id: <20210305201518.798584-35-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Instead of replicate the same definitions from struct_semid64_ds.h on the multiple struct_semid_ds.h, use a common header which is included when required (struct_semid64_ds_helper.h). The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit semctl implementation. --- sysdeps/unix/sysv/linux/Makefile | 3 ++- .../sysv/linux/bits/types/struct_semid64_ds.h | 5 +--- .../bits/types/struct_semid64_ds_helper.h | 23 +++++++++++++++++++ .../sysv/linux/bits/types/struct_semid_ds.h | 10 +++++--- .../linux/hppa/bits/types/struct_semid_ds.h | 4 ++++ .../linux/mips/bits/types/struct_semid_ds.h | 4 ++++ .../powerpc/bits/types/struct_semid_ds.h | 10 +++++--- .../linux/sparc/bits/types/struct_semid_ds.h | 10 +++++--- .../linux/x86/bits/types/struct_semid_ds.h | 4 ++++ 9 files changed, 59 insertions(+), 14 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 78e7be9ad5..02f528883e 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -102,7 +102,8 @@ sysdep_headers += sys/mount.h sys/acct.h \ bits/ipc-perm.h \ bits/struct_stat.h \ bits/struct_stat_time64_helper.h \ - bits/types/struct_msqid64_ds_helper.h + bits/types/struct_msqid64_ds_helper.h \ + bits/types/struct_semid64_ds_helper.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h index 7263e50bbf..adaee3eb9e 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h @@ -25,9 +25,6 @@ #else struct __semid64_ds { - struct ipc_perm sem_perm; /* operation permission struct */ - __time64_t sem_otime; /* last semop() time */ - __time64_t sem_ctime; /* last time changed by semctl() */ - __syscall_ulong_t sem_nsems; /* number of semaphores in set */ +# include }; #endif diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h new file mode 100644 index 0000000000..ea60b671f1 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h @@ -0,0 +1,23 @@ +/* Common definitions for struct semid_ds with 64 bit time. + Copyright (C) 2020-2021 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 + . */ + + /* Content of internal __semid64_ds. */ + struct ipc_perm sem_perm; /* operation permission struct */ + __time64_t sem_otime; /* last semop() time */ + __time64_t sem_ctime; /* last time changed by semctl() */ + __syscall_ulong_t sem_nsems; /* number of semaphores in set */ diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h index 2f32fa500e..a7b2c9022e 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h @@ -23,17 +23,21 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __time_t sem_otime; /* last semop() time */ __syscall_ulong_t __sem_otime_high; __time_t sem_ctime; /* last time changed by semctl() */ __syscall_ulong_t __sem_ctime_high; -#else +# else __time_t sem_otime; __time_t sem_ctime; -#endif +# endif __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; +#endif }; diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h index 16a9735e7b..5067fb1572 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h @@ -23,6 +23,9 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ __syscall_ulong_t __sem_otime_high; __time_t sem_otime; /* last semop() time */ @@ -31,4 +34,5 @@ struct semid_ds __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; +#endif }; diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h index 73587ea634..ee9a1e5e61 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h @@ -23,10 +23,14 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ __time_t sem_otime; /* last semop() time */ __time_t sem_ctime; /* last time changed by semctl() */ __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __sem_otime_high; __syscall_ulong_t __sem_ctime_high; +#endif }; diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h index 8fdbc5d776..0c080fed61 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h @@ -23,17 +23,21 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __syscall_ulong_t __sem_otime_high; __time_t sem_otime; /* last semop() time */ __syscall_ulong_t __sem_ctime_high; __time_t sem_ctime; /* last time changed by semctl() */ -#else +# else __time_t sem_otime; /* last semop() time */ __time_t sem_ctime; /* last time changed by semctl() */ -#endif +# endif __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; +#endif }; diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h index 6b9b3639b2..76810427f6 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h @@ -23,17 +23,21 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __syscall_ulong_t __sem_otime_high; __time_t sem_otime; /* last semop() time */ __syscall_ulong_t __sem_ctime_high; __time_t sem_ctime; /* last time changed by semctl() */ -#else +# else __time_t sem_otime; /* last semop() time */ __time_t sem_ctime; /* last time changed by semctl() */ -#endif +# endif __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; +#endif }; diff --git a/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h index 90f03b2407..affd38b6bd 100644 --- a/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h @@ -23,6 +23,9 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ __time_t sem_otime; /* last semop() time */ __syscall_ulong_t __sem_otime_high; @@ -31,4 +34,5 @@ struct semid_ds __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; +#endif }; From patchwork Fri Mar 5 20:15:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42317 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 E9278399F02A; Fri, 5 Mar 2021 20:16:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9278399F02A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975371; bh=hGOldFFC48/iZBYCi1bZsn/msI1xg0+2qWhorWkmpf0=; 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=YxXbl6CdMcphqHp9QIYJoW0AAaMRpNSlpkOlTI7Hf5I97F8AWf3JWyfNj415GUze6 NWLyX6UqxDIhPRpuPc2DWsKv9/IqMXhrFFLCulFNllaR/6hH/oJiFk3SvGyxcYcMSR 1znhlrjTwgHZ9BCY4PUs1/38dTEIdq3URZEhot2o= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by sourceware.org (Postfix) with ESMTPS id 84C3A399F01F for ; Fri, 5 Mar 2021 20:16:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 84C3A399F01F Received: by mail-qv1-xf31.google.com with SMTP id 2so1648450qvd.0 for ; Fri, 05 Mar 2021 12:16:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hGOldFFC48/iZBYCi1bZsn/msI1xg0+2qWhorWkmpf0=; b=JqLrHzIBMgXYvcgcMnoRHw2fZshmJHWMtD//UszzMUMwZMOI+iVGvgrmR0QxXuvt4z SsjnjCuRfMGXmqoWokmxQRMD3PDz7/NpKM82LD0AtF70FATJx86GeTq0ycV++szq4/ZX IsA+xOaEEJvw+Zjf9sJS39CSLELDxm8ewgnEKBI62v9tzWRg6ePc+T0IvZzjay22rnH6 wf3ekxPoj8NUrxa6s6WX6D96F9W5W2CWYFUFOL0/rU98m7OZVfJl0tXk8b4PIQJnb6F6 hvdRpFlpZ0KKXMxVbBuD/R310ZWjNA/3jpFQVuGrXjgl1y59p39OYkhIcXzCiNxV1jh6 nEYw== X-Gm-Message-State: AOAM532UGp9RQeizy8/dKhondrA4trCGq3phmwtmgMEe1mvcR0Kq1D9g BNBbYhqZX11ZX5gSlOyY6+qKijLfIhjihQ== X-Google-Smtp-Source: ABdhPJw0rO3u5EA0CEvMoeoIOLLnJlEMfIKCvPAZMN6PiVmGUxHLfOSSzSa1QiBircWceQZYxSNAWw== X-Received: by 2002:ad4:4581:: with SMTP id x1mr10583080qvu.9.1614975364830; Fri, 05 Mar 2021 12:16:04 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:04 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 35/52] y2038: Use a common definition for shmid_ds Date: Fri, 5 Mar 2021 17:15:01 -0300 Message-Id: <20210305201518.798584-36-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Instead of replicate the same definitions from struct_shmid64_ds.h on the multiple struct_shmid_ds.h, use a common header which is included when required (struct_shmid64_ds_helper.h). The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit semctl implementation. --- sysdeps/unix/sysv/linux/Makefile | 3 ++- .../sysv/linux/bits/types/struct_shmid64_ds.h | 9 +------ .../bits/types/struct_shmid64_ds_helper.h | 26 +++++++++++++++++++ .../sysv/linux/bits/types/struct_shmid_ds.h | 10 ++++--- .../linux/hppa/bits/types/struct_shmid_ds.h | 10 ++++--- .../linux/mips/bits/types/struct_shmid_ds.h | 14 ++++++---- .../powerpc/bits/types/struct_shmid_ds.h | 10 ++++--- .../linux/sparc/bits/types/struct_shmid_ds.h | 10 ++++--- 8 files changed, 66 insertions(+), 26 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 02f528883e..fc2a17307c 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -103,7 +103,8 @@ sysdep_headers += sys/mount.h sys/acct.h \ bits/struct_stat.h \ bits/struct_stat_time64_helper.h \ bits/types/struct_msqid64_ds_helper.h \ - bits/types/struct_semid64_ds_helper.h + bits/types/struct_semid64_ds_helper.h \ + bits/types/struct_shmid64_ds_helper.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h index 71100db1b5..a4af8cc5f4 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h @@ -25,13 +25,6 @@ #else struct __shmid64_ds { - struct ipc_perm shm_perm; /* operation permission struct */ - size_t shm_segsz; /* size of segment in bytes */ - __time64_t shm_atime; /* time of last shmat() */ - __time64_t shm_dtime; /* time of last shmdt() */ - __time64_t shm_ctime; /* time of last change by shmctl() */ - __pid_t shm_cpid; /* pid of creator */ - __pid_t shm_lpid; /* pid of last shmop */ - shmatt_t shm_nattch; /* number of current attaches */ +# include }; #endif diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h new file mode 100644 index 0000000000..8ab0937c4d --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h @@ -0,0 +1,26 @@ +/* Common definitions for struct semid_ds with 64 bit time. + Copyright (C) 2020-2021 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 + . */ + + struct ipc_perm shm_perm; /* operation permission struct */ + size_t shm_segsz; /* size of segment in bytes */ + __time64_t shm_atime; /* time of last shmat() */ + __time64_t shm_dtime; /* time of last shmdt() */ + __time64_t shm_ctime; /* time of last change by shmctl() */ + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h index 2bd587d2b0..5f8ac6257b 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h @@ -23,23 +23,27 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm shm_perm; /* operation permission struct */ size_t shm_segsz; /* size of segment in bytes */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __time_t shm_atime; /* time of last shmat() */ unsigned long int __shm_atime_high; __time_t shm_dtime; /* time of last shmdt() */ unsigned long int __shm_dtime_high; __time_t shm_ctime; /* time of last change by shmctl() */ unsigned long int __shm_ctime_high; -#else +# else __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#endif +# endif __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ __syscall_ulong_t __glibc_reserved5; __syscall_ulong_t __glibc_reserved6; +#endif }; diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h index 47ff80ebb0..7831fd7340 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h @@ -23,8 +23,11 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm shm_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __shm_atime_high; __time_t shm_atime; /* time of last shmat() */ unsigned long int __shm_dtime_high; @@ -32,15 +35,16 @@ struct shmid_ds unsigned long int __shm_ctime_high; __time_t shm_ctime; /* time of last change by shmctl() */ unsigned long int __glibc_reserved4; -#else +# else __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#endif +# endif size_t shm_segsz; /* size of segment in bytes */ __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ __syscall_ulong_t __glibc_reserved5; __syscall_ulong_t __glibc_reserved6; +#endif }; diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h index 7f8f3b9c51..0691a610ae 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h +++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h @@ -23,27 +23,31 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm shm_perm; /* operation permission struct */ size_t shm_segsz; /* size of segment in bytes */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#else +# else __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#endif +# endif __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned short int __shm_atime_high; unsigned short int __shm_dtime_high; unsigned short int __shm_ctime_high; unsigned short int __glibc_reserved4; -#else +# else __syscall_ulong_t __glibc_reserved5; __syscall_ulong_t __glibc_reserved6; +# endif #endif }; diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h index d71bdf1ecf..316d43ec99 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h @@ -23,8 +23,11 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm shm_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __shm_atime_high; __time_t shm_atime; /* time of last shmat() */ unsigned long int __shm_dtime_high; @@ -32,15 +35,16 @@ struct shmid_ds unsigned long int __shm_ctime_high; __time_t shm_ctime; /* time of last change by shmctl() */ unsigned long int __glibc_reserved4; -#else +# else __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#endif +# endif size_t shm_segsz; /* size of segment in bytes */ __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ __syscall_ulong_t __glibc_reserved5; __syscall_ulong_t __glibc_reserved6; +#endif }; diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h index 767099803f..86f0cedac3 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h @@ -23,23 +23,27 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm shm_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __shm_atime_high; __time_t shm_atime; /* time of last shmat() */ unsigned long int __shm_dtime_high; __time_t shm_dtime; /* time of last shmdt() */ unsigned long int __shm_ctime_high; __time_t shm_ctime; /* time of last change by shmctl() */ -#else +# else __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#endif +# endif size_t shm_segsz; /* size of segment in bytes */ __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ __syscall_ulong_t __glibc_reserved5; __syscall_ulong_t __glibc_reserved6; +#endif }; From patchwork Fri Mar 5 20:15:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42318 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 76469399F030; Fri, 5 Mar 2021 20:16:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76469399F030 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975371; bh=4UWpsPSRXxlmMTCwQvh6yVYFATG8kPn0GoKIyWW/zWs=; 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=c3JSuS9/9f0ordqSIjIZFMCi1if7Y3oiscF8gVJPGHu3SCFO1p0Q9d0PYU0UcoQ6s Ann1mQgtglRnbWraakqARGF0gtebyY73UVE3+Nc+NXahPYnHeso3IOJ78lJR8tE3yd AlSTJi5g/EHBfJtGeEh3fjQzcPdmBzUI2MbIdT3E= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by sourceware.org (Postfix) with ESMTPS id 98904399F00D for ; Fri, 5 Mar 2021 20:16:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 98904399F00D Received: by mail-qk1-x735.google.com with SMTP id l132so3272523qke.7 for ; Fri, 05 Mar 2021 12:16:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4UWpsPSRXxlmMTCwQvh6yVYFATG8kPn0GoKIyWW/zWs=; b=q0FFiDZcrRQoNj+pp5B5H7KE6RJcKpHss1GgriMJjtaELsXG44F5KiG12tF2YrKUJ3 1OM7EgSuYDVtZkTdkERXp7nnvesa+Y49GL9wFJM9lfcf7Opju/eKbbaoD02im5CAIDIq 4VOjfqDdcHW+iulsZ9LCb/p829Kt7fKmB+vV4Swftxi7c1JSw82rtxrV1UtrBX/Klo5d 6rppXcAD2C1ldFXGbwQZTU+qZ3jBt/Q6v/rR4pXDZCSoVflxQqmaPxY28BVfmWuIDEVx YBQifeBB7jJY5JQ3GpsBGVBXzjfEiGFQo52X9s1l25Qvz8k2lmtrKpq41nqLmB1Zrl/Q ahtg== X-Gm-Message-State: AOAM5338T0YC3RcalWU9jBnCb5LoY0d7ggB70MCzCObJFImt8SWxGOgs XEYKzP7ufAsJRmgQTdZll2bZSgLIPOCQHQ== X-Google-Smtp-Source: ABdhPJwZv09c/O17lvGqod+MrseC3x56FH2uBrwcsPZLt+R/FoUL2MttffkdlsI8m7FhuhRqJjdz+A== X-Received: by 2002:a05:620a:525:: with SMTP id h5mr9541268qkh.100.1614975366005; Fri, 05 Mar 2021 12:16:06 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:05 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 36/52] y2038: Add __USE_TIME_BITS64 support for socket-constants.h Date: Fri, 5 Mar 2021 17:15:02 -0300 Message-Id: <20210305201518.798584-37-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It is only used for !__USE_MISC, the default way uses the kernel headers. The patch also adds the SO_TIMESTAMP, SO_TIMESTAMPNS, and SO_TIMESTAMPING which uses new values for 64 bit time_t kernel interfaces. The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit stat implementations. --- .../unix/sysv/linux/bits/socket-constants.h | 47 +++++++++++++++---- .../sysv/linux/hppa/bits/socket-constants.h | 36 +++++++++++++- .../sysv/linux/mips/bits/socket-constants.h | 36 +++++++++++++- .../linux/powerpc/bits/socket-constants.h | 36 +++++++++++++- .../sysv/linux/sparc/bits/socket-constants.h | 36 +++++++++++++- 5 files changed, 175 insertions(+), 16 deletions(-) diff --git a/sysdeps/unix/sysv/linux/bits/socket-constants.h b/sysdeps/unix/sysv/linux/bits/socket-constants.h index 84f7a333a2..c52e72bb73 100644 --- a/sysdeps/unix/sysv/linux/bits/socket-constants.h +++ b/sysdeps/unix/sysv/linux/bits/socket-constants.h @@ -32,19 +32,50 @@ #define SO_OOBINLINE 10 #define SO_RCVBUF 8 #define SO_RCVLOWAT 18 -#if (__TIMESIZE == 64 && __WORDSIZE == 32 \ - && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) -# define SO_RCVTIMEO 66 -#else -# define SO_RCVTIMEO 20 -#endif #define SO_REUSEADDR 2 #define SO_SNDBUF 7 #define SO_SNDLOWAT 19 +#define SO_TYPE 3 + #if (__TIMESIZE == 64 && __WORDSIZE == 32 \ && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) +# define SO_RCVTIMEO 66 # define SO_SNDTIMEO 67 +# define SO_TIMESTAMP 63 +# define SO_TIMESTAMPNS 64 +# define SO_TIMESTAMPING 65 #else -# define SO_SNDTIMEO 21 +# if __TIMESIZE == 64 +# define SO_RCVTIMEO 20 +# define SO_SNDTIMEO 21 +# define SO_TIMESTAMP 29 +# define SO_TIMESTAMPNS 35 +# define SO_TIMESTAMPING 37 +# else +# define SO_RCVTIMEO_OLD 20 +# define SO_SNDTIMEO_OLD 21 +# define SO_RCVTIMEO_NEW 66 +# define SO_SNDTIMEO_NEW 67 + +# define SO_TIMESTAMP_OLD 29 +# define SO_TIMESTAMPNS_OLD 35 +# define SO_TIMESTAMPING_OLD 37 +# define SO_TIMESTAMP_NEW 63 +# define SO_TIMESTAMPNS_NEW 64 +# define SO_TIMESTAMPING_NEW 65 + +# ifdef __USE_TIME_BITS64 +# define SO_RCVTIMEO SO_RCVTIMEO_NEW +# define SO_SNDTIMEO SO_SNDTIMEO_NEW +# define SO_TIMESTAMP SO_TIMESTAMP_NEW +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW +# define SO_TIMESTAMPING SO_TIMESTAMPING_NEW +# else +# define SO_RCVTIMEO SO_RCVTIMEO_OLD +# define SO_SNDTIMEO SO_SNDTIMEO_OLD +# define SO_TIMESTAMP SO_TIMESTAMP_OLD +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD +# define SO_TIMESTAMPING SO_TIMESTAMPING_OLD +# endif +# endif #endif -#define SO_TYPE 3 diff --git a/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h b/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h index b4fb65b9f1..68b42d4606 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h @@ -30,9 +30,41 @@ #define SO_OOBINLINE 256 #define SO_RCVBUF 4098 #define SO_RCVLOWAT 4100 -#define SO_RCVTIMEO 4102 #define SO_REUSEADDR 4 #define SO_SNDBUF 4097 #define SO_SNDLOWAT 4099 -#define SO_SNDTIMEO 4101 #define SO_TYPE 4104 + +#if __TIMESIZE == 64 +# define SO_RCVTIMEO 4102 +# define SO_SNDTIMEO 4101 +# define SO_TIMESTAMP 16402 +# define SO_TIMESTAMPNS 16403 +# define SO_TIMESTAMPING 16416 +#else +# define SO_RCVTIMEO_OLD 4102 +# define SO_SNDTIMEO_OLD 4101 +# define SO_RCVTIMEO_NEW 16448 +# define SO_SNDTIMEO_NEW 16449 + +# define SO_TIMESTAMP_OLD 0x4012 +# define SO_TIMESTAMPNS_OLD 0x4013 +# define SO_TIMESTAMPING_OLD 0x4020 +# define SO_TIMESTAMP_NEW 0x4038 +# define SO_TIMESTAMPNS_NEW 0x4039 +# define SO_TIMESTAMPING_NEW 0x403A + +# ifdef __USE_TIME_BITS64 +# define SO_RCVTIMEO SO_RCVTIMEO_NEW +# define SO_SNDTIMEO SO_SNDTIMEO_NEW +# define SO_TIMESTAMP SO_TIMESTAMP_NEW +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW +# define SO_TIMESTAMPING SO_TIMESTAMPING_NEW +# else +# define SO_RCVTIMEO SO_RCVTIMEO_OLD +# define SO_SNDTIMEO SO_SNDTIMEO_OLD +# define SO_TIMESTAMP SO_TIMESTAMP_OLD +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD +# define SO_TIMESTAMPING SO_TIMESTAMPING_OLD +# endif +#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h b/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h index a5264536e9..b18a854e99 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h +++ b/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h @@ -30,9 +30,41 @@ #define SO_OOBINLINE 256 #define SO_RCVBUF 4098 #define SO_RCVLOWAT 4100 -#define SO_RCVTIMEO 4102 #define SO_REUSEADDR 4 #define SO_SNDBUF 4097 #define SO_SNDLOWAT 4099 -#define SO_SNDTIMEO 4101 #define SO_TYPE 4104 + +#if __TIMESIZE == 64 +# define SO_RCVTIMEO 4102 +# define SO_SNDTIMEO 4101 +# define SO_TIMESTAMP 29 +# define SO_TIMESTAMPNS 35 +# define SO_TIMESTAMPING 37 +#else +# define SO_RCVTIMEO_OLD 4102 +# define SO_SNDTIMEO_OLD 4101 +# define SO_RCVTIMEO_NEW 66 +# define SO_SNDTIMEO_NEW 67 + +# define SO_TIMESTAMP_OLD 29 +# define SO_TIMESTAMPNS_OLD 35 +# define SO_TIMESTAMPING_OLD 37 +# define SO_TIMESTAMP_NEW 63 +# define SO_TIMESTAMPNS_NEW 64 +# define SO_TIMESTAMPING_NEW 65 + +# ifdef __USE_TIME_BITS64 +# define SO_RCVTIMEO SO_RCVTIMEO_NEW +# define SO_SNDTIMEO SO_SNDTIMEO_NEW +# define SO_TIMESTAMP SO_TIMESTAMP_NEW +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW +# define SO_TIMESTAMPING SO_TIMESTAMPING_NEW +# else +# define SO_RCVTIMEO SO_RCVTIMEO_OLD +# define SO_SNDTIMEO SO_SNDTIMEO_OLD +# define SO_TIMESTAMP SO_TIMESTAMP_OLD +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD +# define SO_TIMESTAMPING SO_TIMESTAMPING_OLD +# endif +#endif diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h b/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h index f35488b375..c03141bb8c 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h @@ -30,9 +30,41 @@ #define SO_OOBINLINE 10 #define SO_RCVBUF 8 #define SO_RCVLOWAT 16 -#define SO_RCVTIMEO 18 #define SO_REUSEADDR 2 #define SO_SNDBUF 7 #define SO_SNDLOWAT 17 -#define SO_SNDTIMEO 19 #define SO_TYPE 3 + +#if __TIMESIZE == 64 +# define SO_RCVTIMEO 18 +# define SO_SNDTIMEO 19 +# define SO_TIMESTAMP 29 +# define SO_TIMESTAMPNS 35 +# define SO_TIMESTAMPING 37 +#else +# define SO_RCVTIMEO_OLD 18 +# define SO_SNDTIMEO_OLD 19 +# define SO_RCVTIMEO_NEW 66 +# define SO_SNDTIMEO_NEW 67 + +# define SO_TIMESTAMP_OLD 29 +# define SO_TIMESTAMPNS_OLD 35 +# define SO_TIMESTAMPING_OLD 37 +# define SO_TIMESTAMP_NEW 63 +# define SO_TIMESTAMPNS_NEW 64 +# define SO_TIMESTAMPING_NEW 65 + +# ifdef __USE_TIME_BITS64 +# define SO_RCVTIMEO SO_RCVTIMEO_NEW +# define SO_SNDTIMEO SO_SNDTIMEO_NEW +# define SO_TIMESTAMP SO_TIMESTAMP_NEW +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW +# define SO_TIMESTAMPING SO_TIMESTAMPING_NEW +# else +# define SO_RCVTIMEO SO_RCVTIMEO_OLD +# define SO_SNDTIMEO SO_SNDTIMEO_OLD +# define SO_TIMESTAMP SO_TIMESTAMP_OLD +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD +# define SO_TIMESTAMPING SO_TIMESTAMPING_OLD +# endif +#endif diff --git a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h index a58d0b5f96..5c4ed76c8c 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h @@ -30,9 +30,41 @@ #define SO_OOBINLINE 256 #define SO_RCVBUF 4098 #define SO_RCVLOWAT 2048 -#define SO_RCVTIMEO 8192 #define SO_REUSEADDR 4 #define SO_SNDBUF 4097 #define SO_SNDLOWAT 4096 -#define SO_SNDTIMEO 16384 #define SO_TYPE 4104 + +#if __TIMESIZE == 64 +# define SO_RCVTIMEO 8192 +# define SO_SNDTIMEO 16384 +# define SO_TIMESTAMP 29 +# define SO_TIMESTAMPNS 33 +# define SO_TIMESTAMPING 35 +#else +# define SO_RCVTIMEO_OLD 8192 +# define SO_SNDTIMEO_OLD 16384 +# define SO_RCVTIMEO_NEW 68 +# define SO_SNDTIMEO_NEW 69 + +# define SO_TIMESTAMP_OLD 0x001d +# define SO_TIMESTAMPNS_OLD 0x0021 +# define SO_TIMESTAMPING_OLD 0x0023 +# define SO_TIMESTAMP_NEW 0x0046 +# define SO_TIMESTAMPNS_NEW 0x0042 +# define SO_TIMESTAMPING_NEW 0x0043 + +# ifdef __USE_TIME_BITS64 +# define SO_RCVTIMEO SO_RCVTIMEO_NEW +# define SO_SNDTIMEO SO_SNDTIMEO_NEW +# define SO_TIMESTAMP SO_TIMESTAMP_NEW +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW +# define SO_TIMESTAMPING SO_TIMESTAMPING_NEW +# else +# define SO_RCVTIMEO SO_RCVTIMEO_OLD +# define SO_SNDTIMEO SO_SNDTIMEO_OLD +# define SO_TIMESTAMP SO_TIMESTAMP_OLD +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD +# define SO_TIMESTAMPING SO_TIMESTAMPING_OLD +# endif +#endif From patchwork Fri Mar 5 20:15:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42319 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 07464399F036; Fri, 5 Mar 2021 20:16:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 07464399F036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975372; bh=WN1avbwHY21GuA6laO/G9nxZ4fnJU2YpTF5I1B19tu0=; 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=rdIAae8aOjNBojWjAaklpfN4j9TleOzxzLF6bYpw032MxuNJimIAG3fOLV8y4+CaA qDhABzbOpfzt5dHMyHPTKocVjcT9sCFvJ9O/bUjn7nvjJzetD658cc5U2XHnCe1PTq vzBq3+qgdQswidh7/9UluMIGMQDTXKKfARsm190E= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by sourceware.org (Postfix) with ESMTPS id BD852399F00F for ; Fri, 5 Mar 2021 20:16:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BD852399F00F Received: by mail-qt1-x835.google.com with SMTP id w6so2773588qti.6 for ; Fri, 05 Mar 2021 12:16:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WN1avbwHY21GuA6laO/G9nxZ4fnJU2YpTF5I1B19tu0=; b=ILGXcJeaWRlEUhx5D+/w5nAf3MZIEH9IhynMkDZZQ7Hqkjqq208vJnbz9XfP38bmQP ePvjpaaA1wl1PyReeku7eeQqd4Hk95/U/xDyInejBtUxMi8HAYsI/uhrKzaZ23oJQ5fI D0CmTcGtheDwQCebptGiCB7cWdhOpe9JWkOY+Mbh8Z/2uqNm20YKWHvY1JF6uDTVRkww ttHWux9XY5imMTmPrvmVI6yYwdNZPuIsknxACWHrVhowGw2aEfUufy1oG3qNhUf7XI94 nEmIoQ42KTvzXsDqH21T680S67e2UAAerCrYMH+XqPQ5sL/e6VYLBzJfsysFGYWWed/d zy1g== X-Gm-Message-State: AOAM532H8VpcsZqSMQO4bX6KUJSNjz4LYvrgFeYx6ndJ8zOtfcfI0Pnw 2nV21N1DJNj9zmGb6I8pfbm7MH+Zb2uO4A== X-Google-Smtp-Source: ABdhPJzuO17gitjTDBSQcb+q7VxMjjxwRE9Iy5Iq8U5pouUeKlxO+IPjnbavhOPqdOhge3st+kzIpg== X-Received: by 2002:ac8:6e85:: with SMTP id c5mr3750560qtv.299.1614975367125; Fri, 05 Mar 2021 12:16:07 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:06 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 37/52] time: Add 64 bit time support for getdate Date: Fri, 5 Mar 2021 17:15:03 -0300 Message-Id: <20210305201518.798584-38-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The getdate is basically a wrapper localtime and mktime. The 64 bit time support is done calling the 64 bit internal functions, there is no need to add a new symbol version. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski --- include/time.h | 12 ++++++++++-- time/getdate.c | 22 ++++++++++------------ time/tst-getdate.c | 14 ++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/time.h b/include/time.h index caf2af5e74..36754695c9 100644 --- a/include/time.h +++ b/include/time.h @@ -280,8 +280,8 @@ hidden_proto (__nanosleep64) #endif -extern int __getdate_r (const char *__string, struct tm *__resbufp) - attribute_hidden; +extern int __getdate_r (const char *__string, struct tm *__resbufp); +libc_hidden_proto (__getdate_r); /* Determine CLK_TCK value. */ @@ -502,6 +502,14 @@ time_now (void) __clock_gettime (TIME_CLOCK_GETTIME_CLOCKID, &ts); return ts.tv_sec; } + +static inline __time64_t +time64_now (void) +{ + struct __timespec64 ts; + __clock_gettime64 (TIME_CLOCK_GETTIME_CLOCKID, &ts); + return ts.tv_sec; +} #endif #endif diff --git a/time/getdate.c b/time/getdate.c index 6e2f75566b..cdcc898517 100644 --- a/time/getdate.c +++ b/time/getdate.c @@ -112,16 +112,16 @@ __getdate_r (const char *string, struct tm *tp) size_t len; char *datemsk; char *result = NULL; - time_t timer; + __time64_t timer; struct tm tm; - struct stat64 st; - int mday_ok = 0; + struct __stat64_t64 st; + bool mday_ok = false; datemsk = getenv ("DATEMSK"); if (datemsk == NULL || *datemsk == '\0') return 1; - if (__stat64 (datemsk, &st) < 0) + if (__stat64_time64 (datemsk, &st) < 0) return 3; if (!S_ISREG (st.st_mode)) @@ -219,8 +219,8 @@ __getdate_r (const char *string, struct tm *tp) return 7; /* Get current time. */ - timer = time_now (); - __localtime_r (&timer, &tm); + timer = time64_now (); + __localtime64_r (&timer, &tm); /* If only the weekday is given, today is assumed if the given day is equal to the current day and next week if it is less. */ @@ -230,7 +230,7 @@ __getdate_r (const char *string, struct tm *tp) tp->tm_year = tm.tm_year; tp->tm_mon = tm.tm_mon; tp->tm_mday = tm.tm_mday + (tp->tm_wday - tm.tm_wday + 7) % 7; - mday_ok = 1; + mday_ok = true; } /* If only the month is given, the current month is assumed if the @@ -242,7 +242,7 @@ __getdate_r (const char *string, struct tm *tp) if (tp->tm_year == INT_MIN) tp->tm_year = tm.tm_year + (((tp->tm_mon - tm.tm_mon) < 0) ? 1 : 0); tp->tm_mday = first_wday (tp->tm_year, tp->tm_mon, tp->tm_wday); - mday_ok = 1; + mday_ok = true; } /* If no hour, minute and second are given the current hour, minute @@ -285,15 +285,13 @@ __getdate_r (const char *string, struct tm *tp) call normalizes the struct tm. */ if ((!mday_ok && !check_mday (TM_YEAR_BASE + tp->tm_year, tp->tm_mon, tp->tm_mday)) - || mktime (tp) == (time_t) -1) + || __mktime64 (tp) == (time_t) -1) return 8; return 0; } -#ifdef weak_alias weak_alias (__getdate_r, getdate_r) -#endif - +libc_hidden_def (__getdate_r) struct tm * getdate (const char *string) diff --git a/time/tst-getdate.c b/time/tst-getdate.c index c37ba3083a..3bb0e96707 100644 --- a/time/tst-getdate.c +++ b/time/tst-getdate.c @@ -115,20 +115,14 @@ do_test (void) { setenv ("TZ", tests[i].tz, 1); - int expected_err; - if (sizeof (time_t) == 4 && tests[i].time64) - expected_err = 8; - else - expected_err = 0; - tm = getdate (tests[i].str); - TEST_COMPARE (getdate_err, expected_err); - if (getdate_err != expected_err) + TEST_COMPARE (getdate_err, 0); + if (getdate_err != 0) { support_record_failure (); printf ("%s\n", report_date_error ()); } - else if (getdate_err == 0) + else { TEST_COMPARE (tests[i].tm.tm_mon, tm->tm_mon); TEST_COMPARE (tests[i].tm.tm_year, tm->tm_year); @@ -139,7 +133,7 @@ do_test (void) } struct tm tms; - TEST_COMPARE (getdate_r (tests[i].str, &tms), expected_err); + TEST_COMPARE (getdate_r (tests[i].str, &tms), 0); if (getdate_err == 0) { TEST_COMPARE (tests[i].tm.tm_mon, tms.tm_mon); From patchwork Fri Mar 5 20:15:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42331 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 85ACA39A5C25; Fri, 5 Mar 2021 20:16:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85ACA39A5C25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975387; bh=G3ZTPj562gq5ippfqe24NtjnNthqqY2FSRkcHsxRodU=; 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=pJugm8BOVr//vtyhqkhScwIolj5HNS7Jr7Q5kWNXXcepgHFbeaMqRYkqHp7AudRs9 X34nAI5J0IsHhLPSx1kjzf23k3xQS0ggPKPJ8ILATUCBfaEI5jrAxnejmZRxnrn9Ol VilyNIPOSU/x9B7HjQjcE34p1pZ3ToxDZaQ6bm8U= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by sourceware.org (Postfix) with ESMTPS id C0A91399F033 for ; Fri, 5 Mar 2021 20:16:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C0A91399F033 Received: by mail-qt1-x82c.google.com with SMTP id w6so2773741qti.6 for ; Fri, 05 Mar 2021 12:16:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G3ZTPj562gq5ippfqe24NtjnNthqqY2FSRkcHsxRodU=; b=p79tWuzgbWQlEvgwVboYuirVmYJKV2cnpPoha6OP7GOBRtHhC9+sZSsgXH7Q0cBl3E jwW/Njb+6/jT5dYLcAE+ZhJxALoim3dO5ozlOnF7kGBA6fUIr6vG05CTSc9//NUKwOIV AXrLD3kSx0iyu8ff0ITDlIozbZpwY8h9nj18kfZ152Wil8ogxUX/L/+gukehI7OV5Jzs 6jPNupdwcf5c1LT3wb6Nmevk9JAR4eRewpw4QrBh8mt8hBDElWjBPKFKhg3a/plCSGxR 3xOxFmfhBNxtcLG8341/UUonTF65n0rgsYWRKxlzNdIoqNalOR3OaZW7eHd1ptohpci4 f/aA== X-Gm-Message-State: AOAM532p8KHqXVOWqEbRMhoGKl3/sCJ5Xe7x36ssDjYgzh8IAfaWbUdQ S/XuNKUQqwdGTvAtyf2AasLn3i//cqTp/A== X-Google-Smtp-Source: ABdhPJw54p5FvRHxt1sa++Z/cXqTR7JUuTB3+6RAxuQKbQYRoQDcjANxjPndPeoBmJVuqmVaIyWJsw== X-Received: by 2002:ac8:c46:: with SMTP id l6mr10856244qti.6.1614975368974; Fri, 05 Mar 2021 12:16:08 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:08 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 38/52] y2038: Add support for 64 bit time on legacy ABIs Date: Fri, 5 Mar 2021 17:15:04 -0300 Message-Id: <20210305201518.798584-39-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" A new build flag, _TIME_BITS, enables the usage of the newer 64 bit time symbols for legacy ABI (where 32 bit time_t is default). The 64 bit time support is only enabled if LFS (_FILE_OFFSET_BITS=64) is also used. Different than LFS support, the y2038 symbols are added only for the required ABIs (armhf, csky, hppa, i386, m68k, microblaze, mips32, mips64-n32, nios2, powerpc32, sparc32, s390-32, and sh). The ABIs with 64 bit time support are unchanged, both for symbol and types redirection. On Linux the full 64 bit time support requires a minimum of kernel version v5.1. Otherwise, the 32 bit fallbacks are used and might results in error with overflow return code (EOVERFLOW). The i686-gnu does not yet support 64 bit time. This patch exports following rediretions to support 64 bit time: * libc: - adjtimex - adjtime - clock_adjtime - clock_getres - clock_gettime - clock_nanosleep - clock_settime - ctime - ctime_r - difftime - futimens - futimes - futimesat - getitimer - getrusage - gettimeofday - gmtime - gmtime_r - localtime - localtime_r - lutimes - mktime - msgctl - nanosleep - ntp_gettime - ntp_gettimex - ppoll - pselect - recvmmsg - sched_rr_get_interval - select - semctl - semtimedop - setitimer - settimeofday - shmctl - sigtimedwait - thrd_sleep - time - timegm - timelocal (alias to mktime) - timerfd_gettime - timerfd_settime - timespec_get - utime - utimensat - utimes - wait3 - wait4 * libpthread: - mtx_timedlock - pthread_clockjoin_np - pthread_cond_clockwait - pthread_cond_timedwait - pthread_mutex_clocklock - pthread_mutex_timedlock - pthread_rwlock_clockrdlock - pthread_rwlock_clockwrlock - pthread_rwlock_timedrdlock - pthread_rwlock_timedwrlock - pthread_timedjoin_np - sem_clockwait - sem_timedwait * librt: - aio_suspend - mq_timedreceive - mq_timedsend - timer_gettime - timer_settime * libanl: - gai_suspend Reviewed-by: Lukasz Majewski --- Makefile | 2 +- NEWS | 5 + include/features-time64.h | 1 + include/features.h | 2 + io/sys/poll.h | 11 ++ io/sys/stat.h | 113 ++++++++++++++-- io/utime.h | 11 ++ manual/creature.texi | 44 ++++++ misc/sys/select.h | 27 ++++ posix/sched.h | 11 +- posix/sys/wait.h | 20 +++ resolv/netdb.h | 11 ++ resource/sys/resource.h | 10 ++ rt/aio.h | 15 +- rt/mqueue.h | 22 +++ signal/signal.h | 13 ++ socket/sys/socket.h | 11 ++ sysdeps/generic/features-time64.h | 19 +++ sysdeps/generic/time64-compat.h | 3 + sysdeps/nptl/pthread.h | 119 ++++++++++++++++ sysdeps/pthread/semaphore.h | 25 ++++ sysdeps/pthread/threads.h | 33 +++++ sysdeps/unix/sysv/linux/Versions | 113 ++++++++++++++++ sysdeps/unix/sysv/linux/arm/be/libanl.abilist | 1 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 52 +++++++ .../unix/sysv/linux/arm/be/libpthread.abilist | 14 ++ sysdeps/unix/sysv/linux/arm/be/librt.abilist | 5 + sysdeps/unix/sysv/linux/arm/le/libanl.abilist | 1 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 52 +++++++ .../unix/sysv/linux/arm/le/libpthread.abilist | 14 ++ sysdeps/unix/sysv/linux/arm/le/librt.abilist | 5 + sysdeps/unix/sysv/linux/arm/time64-compat.h | 2 + sysdeps/unix/sysv/linux/bits/msq.h | 1 + sysdeps/unix/sysv/linux/bits/sem.h | 1 + sysdeps/unix/sysv/linux/bits/shm.h | 1 + sysdeps/unix/sysv/linux/bits/time.h | 10 ++ sysdeps/unix/sysv/linux/csky/libanl.abilist | 1 + sysdeps/unix/sysv/linux/csky/libc.abilist | 52 +++++++ .../unix/sysv/linux/csky/libpthread.abilist | 14 ++ sysdeps/unix/sysv/linux/csky/librt.abilist | 5 + sysdeps/unix/sysv/linux/csky/time64-compat.h | 2 + sysdeps/unix/sysv/linux/features-time64.h | 37 +++++ sysdeps/unix/sysv/linux/hppa/libanl.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 52 +++++++ .../unix/sysv/linux/hppa/libpthread.abilist | 14 ++ sysdeps/unix/sysv/linux/hppa/librt.abilist | 5 + sysdeps/unix/sysv/linux/hppa/time64-compat.h | 2 + sysdeps/unix/sysv/linux/i386/Makefile | 2 + sysdeps/unix/sysv/linux/i386/libanl.abilist | 1 + sysdeps/unix/sysv/linux/i386/libc.abilist | 52 +++++++ .../unix/sysv/linux/i386/libpthread.abilist | 14 ++ sysdeps/unix/sysv/linux/i386/librt.abilist | 5 + sysdeps/unix/sysv/linux/i386/time64-compat.h | 2 + sysdeps/unix/sysv/linux/include/sys/msg.h | 2 - sysdeps/unix/sysv/linux/include/sys/shm.h | 2 - sysdeps/unix/sysv/linux/include/sys/timex.h | 2 + .../sysv/linux/m68k/coldfire/libanl.abilist | 1 + .../sysv/linux/m68k/coldfire/libc.abilist | 52 +++++++ .../linux/m68k/coldfire/libpthread.abilist | 14 ++ .../sysv/linux/m68k/coldfire/librt.abilist | 5 + .../sysv/linux/m68k/m680x0/libanl.abilist | 1 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 52 +++++++ .../sysv/linux/m68k/m680x0/libpthread.abilist | 14 ++ .../unix/sysv/linux/m68k/m680x0/librt.abilist | 5 + sysdeps/unix/sysv/linux/m68k/time64-compat.h | 2 + .../sysv/linux/microblaze/be/libanl.abilist | 1 + .../sysv/linux/microblaze/be/libc.abilist | 52 +++++++ .../linux/microblaze/be/libpthread.abilist | 14 ++ .../sysv/linux/microblaze/be/librt.abilist | 5 + .../sysv/linux/microblaze/le/libanl.abilist | 1 + .../sysv/linux/microblaze/le/libc.abilist | 52 +++++++ .../linux/microblaze/le/libpthread.abilist | 14 ++ .../sysv/linux/microblaze/le/librt.abilist | 5 + .../sysv/linux/microblaze/time64-compat.h | 2 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 52 +++++++ .../sysv/linux/mips/mips32/libanl.abilist | 1 + .../sysv/linux/mips/mips32/libpthread.abilist | 14 ++ .../unix/sysv/linux/mips/mips32/librt.abilist | 5 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 52 +++++++ .../sysv/linux/mips/mips32/time64-compat.h | 2 + .../sysv/linux/mips/mips64/n32/libanl.abilist | 1 + .../sysv/linux/mips/mips64/n32/libc.abilist | 52 +++++++ .../linux/mips/mips64/n32/libpthread.abilist | 14 ++ .../sysv/linux/mips/mips64/n32/librt.abilist | 5 + .../linux/mips/mips64/n32/time64-compat.h | 2 + sysdeps/unix/sysv/linux/nios2/libanl.abilist | 1 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 52 +++++++ .../unix/sysv/linux/nios2/libpthread.abilist | 14 ++ sysdeps/unix/sysv/linux/nios2/librt.abilist | 5 + sysdeps/unix/sysv/linux/nios2/time64-compat.h | 2 + .../linux/powerpc/powerpc32/fpu/libc.abilist | 52 +++++++ .../linux/powerpc/powerpc32/libanl.abilist | 1 + .../powerpc/powerpc32/libpthread.abilist | 14 ++ .../linux/powerpc/powerpc32/librt.abilist | 5 + .../powerpc/powerpc32/nofpu/libc.abilist | 52 +++++++ .../linux/powerpc/powerpc32/time64-compat.h | 2 + .../sysv/linux/s390/s390-32/libanl.abilist | 1 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 52 +++++++ .../linux/s390/s390-32/libpthread.abilist | 14 ++ .../sysv/linux/s390/s390-32/librt.abilist | 5 + .../sysv/linux/s390/s390-32/time64-compat.h | 2 + sysdeps/unix/sysv/linux/semctl.c | 1 - sysdeps/unix/sysv/linux/sh/be/libanl.abilist | 1 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 52 +++++++ .../unix/sysv/linux/sh/be/libpthread.abilist | 14 ++ sysdeps/unix/sysv/linux/sh/be/librt.abilist | 5 + sysdeps/unix/sysv/linux/sh/le/libanl.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 52 +++++++ .../unix/sysv/linux/sh/le/libpthread.abilist | 14 ++ sysdeps/unix/sysv/linux/sh/le/librt.abilist | 5 + sysdeps/unix/sysv/linux/sh/time64-compat.h | 2 + .../sysv/linux/sparc/sparc32/libanl.abilist | 1 + .../sysv/linux/sparc/sparc32/libc.abilist | 52 +++++++ .../linux/sparc/sparc32/libpthread.abilist | 14 ++ .../sysv/linux/sparc/sparc32/librt.abilist | 5 + .../sysv/linux/sparc/sparc32/time64-compat.h | 2 + sysdeps/unix/sysv/linux/sys/timerfd.h | 22 +++ sysdeps/unix/sysv/linux/sys/timex.h | 28 +++- sysvipc/sys/msg.h | 10 ++ sysvipc/sys/sem.h | 21 +++ sysvipc/sys/shm.h | 10 ++ time/sys/time.h | 71 ++++++++++ time/time.h | 128 +++++++++++++++++- 123 files changed, 2315 insertions(+), 29 deletions(-) create mode 100644 include/features-time64.h create mode 100644 sysdeps/generic/features-time64.h create mode 100644 sysdeps/generic/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/arm/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/csky/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/features-time64.h create mode 100644 sysdeps/unix/sysv/linux/hppa/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/i386/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/m68k/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/microblaze/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/nios2/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/sh/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h diff --git a/Makefile b/Makefile index 71c7d8b5ec..2fd88294f5 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ endif # $(AUTOCONF) = no subdir_objs subdir_stubs subdir_testclean \ $(addprefix install-, no-libc.a bin lib data headers others) -headers := limits.h values.h features.h gnu-versions.h \ +headers := limits.h values.h features.h features-time64.h gnu-versions.h \ bits/xopen_lim.h gnu/libc-version.h stdc-predef.h \ bits/libc-header-start.h diff --git a/NEWS b/NEWS index 73a1a0df97..7766db65a5 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,11 @@ Major new features: a dump of information related to IFUNC resolver operation and glibc-hwcaps subdirectory selection. +* Add support for 64 bit time_t for ABIs with defaults to 32 bit time_t. + This is enabled with the _TIME_BITS preprocessor set to 64 and only + supported when LFS (_FILE_OFFSET_BITS=64) is also enabled. It is only + enabled for Linux and the full support requires a minimum version of 5.1. + Deprecated and removed features, and other changes affecting compatibility: [Add deprecations, removals and changes affecting compatibility here] diff --git a/include/features-time64.h b/include/features-time64.h new file mode 100644 index 0000000000..06115b7c86 --- /dev/null +++ b/include/features-time64.h @@ -0,0 +1 @@ +#include_next diff --git a/include/features.h b/include/features.h index eb97470afa..9d39e11345 100644 --- a/include/features.h +++ b/include/features.h @@ -387,6 +387,8 @@ # define __USE_FILE_OFFSET64 1 #endif +#include + #if defined _DEFAULT_SOURCE # define __USE_MISC 1 #endif diff --git a/io/sys/poll.h b/io/sys/poll.h index 2431dd1e14..4a0ce7eaad 100644 --- a/io/sys/poll.h +++ b/io/sys/poll.h @@ -63,6 +63,17 @@ extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout); extern int ppoll (struct pollfd *__fds, nfds_t __nfds, const struct timespec *__timeout, const __sigset_t *__ss); + +# ifdef __USE_TIME_BITS64 +# ifdef __REDIRECT +extern int __REDIRECT (ppoll, (struct pollfd *__fds, nfds_t __nfds, + const struct timespec *__timeout, + const __sigset_t *__ss), + __ppoll64); +# else +# define ppoll __ppoll64 +# endif +# endif #endif __END_DECLS diff --git a/io/sys/stat.h b/io/sys/stat.h index 549375c087..f7874ec5ba 100644 --- a/io/sys/stat.h +++ b/io/sys/stat.h @@ -209,21 +209,51 @@ extern int stat (const char *__restrict __file, that file descriptor FD is open on and put them in BUF. */ extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2)); #else -# ifdef __REDIRECT_NTH +# ifdef __USE_TIME_BITS64 +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (stat, (const char *__restrict __file, + struct stat *__restrict __buf), + __stat64_time64) + __nonnull ((1, 2)); +extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), + __fstat64_time64) + __nonnull ((2)); +# else +# define stat __stat64_time64 +# define fstat __fstat64_time64 +# endif +# else +# ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (stat, (const char *__restrict __file, struct stat *__restrict __buf), stat64) __nonnull ((1, 2)); extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64) __nonnull ((2)); -# else -# define stat stat64 -# define fstat fstat64 +# else +# define stat stat64 +# define fstat fstat64 +# endif # endif #endif #ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 extern int stat64 (const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2)); +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (stat64, (const char *__restrict __file, + struct stat64 *__restrict __buf), + __stat64_time64) + __nonnull ((1, 2)); +extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf), + __fstat64_time64) + __nonnull ((2)); +# else +# define stat64 __stat64_time64 +# define fstat64 __fstat64_time +# endif +# endif #endif #ifdef __USE_ATFILE @@ -235,20 +265,44 @@ extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __THROW __nonnull ((2, 3)); # else -# ifdef __REDIRECT_NTH +# ifdef __USE_TIME_BITS64 +# ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag), - fstatat64) __nonnull ((2, 3)); + __fstatat64_time64) __nonnull ((2, 3)); +# else +# define fstatat __fstatat64_time64 +# endif # else -# define fstatat fstatat64 +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, + struct stat *__restrict __buf, + int __flag), + fstatat64) __nonnull ((2, 3)); +# else +# define fstatat fstatat64 +# endif # endif # endif # ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 extern int fstatat64 (int __fd, const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) __THROW __nonnull ((2, 3)); +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (fstatat64, (int __fd, + const char *__restrict __file, + struct stat64 *__restrict __buf, + int __flag), + __fstatat64_time64) + __nonnull ((2, 3)); +# else +# define fstatat64 __fstatat64_time64 +# endif +# endif # endif #endif @@ -259,19 +313,37 @@ extern int fstatat64 (int __fd, const char *__restrict __file, extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull ((1, 2)); # else -# ifdef __REDIRECT_NTH +# ifdef __USE_TIME_BITS64 +# ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (lstat, (const char *__restrict __file, - struct stat *__restrict __buf), lstat64) + struct stat *__restrict __buf), __lstat64_time64) __nonnull ((1, 2)); +# else +# define lstat __lstat64_time64 +# endif # else -# define lstat lstat64 +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (lstat, + (const char *__restrict __file, + struct stat *__restrict __buf), lstat64) + __nonnull ((1, 2)); +# else +# define lstat lstat64 +# endif # endif # endif # ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 extern int lstat64 (const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); +# else +extern int __REDIRECT_NTH (lstat64, (const char *__restrict __file, + struct stat64 *__restrict __buf), + __lstat64_time64) + __nonnull ((1, 2)); +# endif # endif #endif @@ -355,17 +427,38 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode) #endif #ifdef __USE_ATFILE +# ifndef __USE_TIME_BITS64 /* Set file access and modification times relative to directory file descriptor. */ extern int utimensat (int __fd, const char *__path, const struct timespec __times[2], int __flags) __THROW __nonnull ((2)); +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path, + const struct timespec __times[2], + int flags), + __utimensat64) __nonnull ((2)); +# else +# define utimensat __utimensat64 +# endif +# endif #endif #ifdef __USE_XOPEN2K8 +# ifndef __USE_TIME_BITS64 /* Set file access and modification times of the file associated with FD. */ extern int futimens (int __fd, const struct timespec __times[2]) __THROW; + +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (futimens, (int fd, const struct timespec __times[2]), + __futimens64); +# else +# define futimens __futimens64 +# endif +# endif #endif #ifdef __USE_GNU diff --git a/io/utime.h b/io/utime.h index c7612d0838..1a645a3fff 100644 --- a/io/utime.h +++ b/io/utime.h @@ -46,10 +46,21 @@ struct utimbuf /* Set the access and modification times of FILE to those given in *FILE_TIMES. If FILE_TIMES is NULL, set them to the current time. */ +#ifndef __USE_TIME_BITS64 extern int utime (const char *__file, const struct utimbuf *__file_times) __THROW __nonnull ((1)); +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (utime, (const char *__file, + const struct utimbuf *__file_times), + __utime64); +# else +# define utime __utime64 +# endif +#endif + __END_DECLS #endif /* utime.h */ diff --git a/manual/creature.texi b/manual/creature.texi index 5090735e4f..606b73d184 100644 --- a/manual/creature.texi +++ b/manual/creature.texi @@ -165,6 +165,50 @@ This macro was introduced as part of the Large File Support extension (LFS). @end defvr +@defvr Macro _TIME_BITS +This macro determines the bit size of @code{time_t} (and therefore the +bit size of all @code{time_t} derived types and the prototypes of all +related functions). If @code{_TIME_BITS} is undefined, the bit size of +@code{time_t} is architecture dependent. + +Possible values of @code{_TIME_BITS}: +@enumerate +@item +@code{_TIME_BITS=64} and port from the outset uses 64-bit +@code{time_t} and word size equals to @w{64 bits} (e.g. x86_64) - no +action + +@item +@code{_TIME_BITS=32} and port from the outset uses 32-bit +@code{time_t} and word size equals to @w{64 bits} (e.g. ARM) - no +action + +@item +@code{_TIME_BITS=64} and port from the outset uses 64-bit +@code{time_t} and word size equals to @w{32 bits} (e.g. ARC, RV32) +- no action + +@item +@code{_TIME_BITS=64} and port from the outset uses 32-bit +@code{time_t} and word size equals to @w{32 bits} (e.g. ARM) +- the @code{time_t} is modified to be able to hold 64-bit time. + +@item +For any other use case the compile-time error is emitted. +@end enumerate + +The @code{_TIME_BITS} can be only used when @code{_FILE_OFFSET_BITS=64} +is also defined. + +For the point @b{4} above, calls to proper syscalls depend on the +Linux kernel version on which the system is running. For Linux kernel +version above @b{5.1} syscalls supporting 64-bit time are used. Otherwise, +a fallback code is used with legacy (i.e. 32-bit) syscalls. + +By using this macro certain ports gain support for 64-bit time and as +a result become immune to Y2038 problem. +@end defvr + @defvr Macro _ISOC99_SOURCE @standards{GNU, (none)} If this macro is defined, features from ISO C99 are included. Since diff --git a/misc/sys/select.h b/misc/sys/select.h index 188a7fe607..e9c0e8fc20 100644 --- a/misc/sys/select.h +++ b/misc/sys/select.h @@ -98,10 +98,23 @@ __BEGIN_DECLS This function is a cancellation point and therefore not marked with __THROW. */ +#ifndef __USE_TIME_BITS64 extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); +#else +# ifdef __REDIRECT +extern int __REDIRECT (select, + (int __nfds, fd_set *__restrict __readfds, + fd_set *__restrict __writefds, + fd_set *__restrict __exceptfds, + struct timeval *__restrict __timeout), + __select64); +# else +# define select __select64 +# endif +#endif #ifdef __USE_XOPEN2K /* Same as above only that the TIMEOUT value is given with higher @@ -110,11 +123,25 @@ extern int select (int __nfds, fd_set *__restrict __readfds, This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); +# else +# ifdef __REDIRECT +extern int __REDIRECT (pselect, + (int __nfds, fd_set *__restrict __readfds, + fd_set *__restrict __writefds, + fd_set *__restrict __exceptfds, + const struct timespec *__restrict __timeout, + const __sigset_t *__restrict __sigmask), + __pselect64); +# else +# define pselect __pselect64 +# endif +# endif #endif diff --git a/posix/sched.h b/posix/sched.h index d8ce08a3ea..7dd97a49b2 100644 --- a/posix/sched.h +++ b/posix/sched.h @@ -74,8 +74,17 @@ extern int sched_get_priority_max (int __algorithm) __THROW; extern int sched_get_priority_min (int __algorithm) __THROW; /* Get the SCHED_RR interval for the named process. */ +#ifndef __USE_TIME_BITS64 extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; - +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (sched_rr_get_interval, + (__pid_t __pid, struct timespec *__t), + __sched_rr_get_interval64); +# else +# define sched_rr_get_interval __sched_rr_get_interval64 +# endif +#endif #ifdef __USE_GNU /* Access macros for `cpu_set'. */ diff --git a/posix/sys/wait.h b/posix/sys/wait.h index 9e7bb7f154..5325bfa4d2 100644 --- a/posix/sys/wait.h +++ b/posix/sys/wait.h @@ -144,14 +144,34 @@ struct rusage; nil, store information about the child's resource usage there. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. */ +# ifndef __USE_TIME_BITS64 extern __pid_t wait3 (int *__stat_loc, int __options, struct rusage * __usage) __THROWNL; +# else +# ifdef __REDIRECT_NTHNL +extern __pid_t __REDIRECT_NTHNL (wait3, (int *__stat_loc, int __options, + struct rusage * __usage), + __wait3_time64); +# else +# define wait3 __wait3_time64 +# endif +# endif #endif #ifdef __USE_MISC +# ifndef __USE_TIME_BITS64 /* PID is like waitpid. Other args are like wait3. */ extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options, struct rusage *__usage) __THROWNL; +# else +# ifdef __REDIRECT_NTHNL +extern __pid_t __REDIRECT_NTHNL (wait4, (__pid_t __pid, int *__stat_loc, + int __options, struct rusage *__usage), + __wait4_time64); +# else +# define wait4 __wait4_time64 +# endif +# endif #endif /* Use misc. */ diff --git a/resolv/netdb.h b/resolv/netdb.h index 1f36f25d4a..9b242ce3d1 100644 --- a/resolv/netdb.h +++ b/resolv/netdb.h @@ -701,6 +701,17 @@ extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr], extern int gai_suspend (const struct gaicb *const __list[], int __ent, const struct timespec *__timeout); +# ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT) +extern int __REDIRECT (gai_suspend, (const struct gaicb *const __list[], + int __ent, + const struct timespec *__timeout), + __gai_suspend_time64); +# else +# define gai_suspend __gai_suspend_time64 +# endif +# endif + /* Get the error status of the request REQ. */ extern int gai_error (struct gaicb *__req) __THROW; diff --git a/resource/sys/resource.h b/resource/sys/resource.h index d30379d085..551d25e275 100644 --- a/resource/sys/resource.h +++ b/resource/sys/resource.h @@ -88,6 +88,16 @@ extern int setrlimit64 (__rlimit_resource_t __resource, and put it in *USAGE. Returns 0 for success, -1 for failure. */ extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW; +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT_NTH) +extern int __REDIRECT_NTH (getrusage, (__rusage_who_t __who, + struct rusage *__usage), + __getrusage64); +# else +# define getrusage __getrusage64 +# endif +#endif + /* Return the highest priority of any process specified by WHICH and WHO (see above); if WHO is zero, the current process, process group, or user (as specified by WHO) is used. A lower priority number means higher diff --git a/rt/aio.h b/rt/aio.h index 3a107b2783..72cf626690 100644 --- a/rt/aio.h +++ b/rt/aio.h @@ -193,12 +193,17 @@ extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp), extern int __REDIRECT_NTH (aio_cancel, (int __fildes, struct aiocb *__aiocbp), aio_cancel64); - +# ifdef __USE_TIME_BITS64 +extern int __REDIRECT_NTH (aio_suspend, + (const struct aiocb *const __list[], int __nent, + const struct timespec *__restrict __timeout), + __aio_suspend_time64) __nonnull ((1)); +# else extern int __REDIRECT_NTH (aio_suspend, (const struct aiocb *const __list[], int __nent, const struct timespec *__restrict __timeout), aio_suspend64) __nonnull ((1)); - +# endif extern int __REDIRECT_NTH (aio_fsync, (int __operation, struct aiocb *__aiocbp), aio_fsync64) __nonnull ((2)); @@ -210,7 +215,11 @@ extern int __REDIRECT_NTH (aio_fsync, # define aio_error aio_error64 # define aio_return aio_return64 # define aio_cancel aio_cancel64 -# define aio_suspend aio_suspend64 +# ifdef __USE_TIME_BITS64 +# define aio_suspend __aio_suspend_time64 +# else +# define aio_suspend aio_suspend64 +# endif # define aio_fsync aio_fsync64 # endif #endif diff --git a/rt/mqueue.h b/rt/mqueue.h index 8a62d99f50..e8a85637e4 100644 --- a/rt/mqueue.h +++ b/rt/mqueue.h @@ -71,6 +71,7 @@ extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio) __nonnull ((2)); #ifdef __USE_XOPEN2K +# ifndef __USE_TIME_BITS64 /* Receive the oldest from highest priority messages in message queue MQDES, stop waiting if ABS_TIMEOUT expires. */ extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr, @@ -85,6 +86,27 @@ extern int mq_timedsend (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio, const struct timespec *__abs_timeout) __nonnull ((2, 5)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (mq_timedreceive, (mqd_t __mqdes, + char *__restrict __msg_ptr, + size_t __msg_len, + unsigned int *__restrict __msg_prio, + const struct timespec *__restrict __abs_timeout), + __mq_timedreceive_time64) + __nonnull ((2, 5)); + +extern int __REDIRECT (mq_timedsend, (mqd_t __mqdes, + const char *__msg_ptr, size_t __msg_len, + unsigned int __msg_prio, + const struct timespec *__abs_timeout), + __mq_timedsend_time64) + __nonnull ((2, 5)); +# else +# define mq_timedreceive __mq_timedreceive_time64 +# define mq_timedsend __mq_timedsend_time64 +# endif +# endif #endif /* Define some inlines helping to catch common problems. */ diff --git a/signal/signal.h b/signal/signal.h index b17203c99c..5fd93382fc 100644 --- a/signal/signal.h +++ b/signal/signal.h @@ -269,10 +269,23 @@ extern int sigwaitinfo (const sigset_t *__restrict __set, This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int sigtimedwait (const sigset_t *__restrict __set, siginfo_t *__restrict __info, const struct timespec *__restrict __timeout) __nonnull ((1)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (sigtimedwait, + (const sigset_t *__restrict __set, + siginfo_t *__restrict __info, + const struct timespec *__restrict __timeout), + __sigtimedwait64) + __nonnull ((1)); +# else +# define sigtimedwait __sigtimedwait64 +# endif +# endif /* Send signal SIG to the process PID. Associate data in VAL with the signal. */ diff --git a/socket/sys/socket.h b/socket/sys/socket.h index 949851a6ce..5577e75b80 100644 --- a/socket/sys/socket.h +++ b/socket/sys/socket.h @@ -196,9 +196,20 @@ extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int recvmmsg (int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags, struct timespec *__tmo); +# else +# ifdef __REDIRECT +extern int __REDIRECT (recvmmsg, (int __fd, struct mmsghdr *__vmessages, + unsigned int __vlen, int __flags, + struct timespec *__tmo), + __recvmmsg64); +# else +# define recvmmsg __recvmmsg64 +# endif +# endif #endif diff --git a/sysdeps/generic/features-time64.h b/sysdeps/generic/features-time64.h new file mode 100644 index 0000000000..a5a677f837 --- /dev/null +++ b/sysdeps/generic/features-time64.h @@ -0,0 +1,19 @@ +/* Features part to handle 64-bit time_t support. Generic version. + Copyright (C) 2021 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 + . */ + +/* The generic configuration only support _TIME_BITS=32. */ diff --git a/sysdeps/generic/time64-compat.h b/sysdeps/generic/time64-compat.h new file mode 100644 index 0000000000..e44b6b68e3 --- /dev/null +++ b/sysdeps/generic/time64-compat.h @@ -0,0 +1,3 @@ +/* Header included by Versions to generate the 64 bit time_t compat symbols. + Legacy ABIs with default 32 bit time support define TIME64_NON_DEFAULT to + generate the 64 bit symbols. */ diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h index a04a3a2754..8f3a41279f 100644 --- a/sysdeps/nptl/pthread.h +++ b/sysdeps/nptl/pthread.h @@ -221,6 +221,7 @@ extern int pthread_join (pthread_t __th, void **__thread_return); the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW; +# ifndef __USE_TIME_BITS64 /* Make calling thread wait for termination of the thread TH, but only until TIMEOUT. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. @@ -240,6 +241,23 @@ extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return, clockid_t __clockid, const struct timespec *__abstime); +# else +# ifdef __REDIRECT +extern int __REDIRECT (pthread_timedjoin_np, + (pthread_t __th, void **__thread_return, + const struct timespec *__abstime), + __pthread_timedjoin_np64); + +extern int __REDIRECT (pthread_clockjoin_np, + (pthread_t __th, void **__thread_return, + clockid_t __clockid, + const struct timespec *__abstime), + __pthread_clockjoin_np64); +# else +# define pthread_timedjoin_np __pthread_timedjoin_np64 +# define pthread_clockjoin_np __pthread_clockjoin_np64 +# endif +# endif #endif /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. @@ -773,16 +791,39 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex) #ifdef __USE_XOPEN2K /* Wait until lock becomes available, or specified time passes. */ +# ifndef __USE_TIME_BITS64 extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_mutex_timedlock, + (pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict __abstime), + __pthread_mutex_timedlock64) __nonnull ((1, 2)); +# else +# define pthread_mutex_timedlock __pthread_mutex_timedlock64 +# endif +# endif #endif #ifdef __USE_GNU +# ifndef __USE_TIME_BITS64 extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex, clockid_t __clockid, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 3)); +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_mutex_clocklock, + (pthread_mutex_t *__restrict __mutex, + clockid_t __clockid, + const struct timespec *__restrict __abstime), + __pthread_mutex_clocklock64) __nonnull ((1, 3)); +# else +# define pthread_mutex_clocklock __pthread_mutex_clocklock64 +# endif +# endif #endif /* Unlock a mutex. */ @@ -919,16 +960,41 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) # ifdef __USE_XOPEN2K /* Try to acquire read lock for RWLOCK or return after specfied time. */ +# ifndef __USE_TIME_BITS64 extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_rwlock_timedrdlock, + (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict __abstime), + __pthread_rwlock_timedrdlock64) + __nonnull ((1, 2)); +# else +# define pthread_rwlock_timedrdlock __pthread_rwlock_timedrdlock64 +# endif +# endif # endif # ifdef __USE_GNU +# ifndef __USE_TIME_BITS64 extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock, clockid_t __clockid, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 3)); +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_rwlock_clockrdlock, + (pthread_rwlock_t *__restrict __rwlock, + clockid_t __clockid, + const struct timespec *__restrict __abstime), + __pthread_rwlock_clockrdlock64) + __nonnull ((1, 3)); +# else +# define pthread_rwlock_clockrdlock __pthread_rwlock_clockrdlock64 +# endif +# endif # endif /* Acquire write lock for RWLOCK. */ @@ -941,16 +1007,42 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) # ifdef __USE_XOPEN2K /* Try to acquire write lock for RWLOCK or return after specfied time. */ +# ifndef __USE_TIME_BITS64 extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_rwlock_timedwrlock, + (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict __abstime), + __pthread_rwlock_timedwrlock64) + __nonnull ((1, 2)); +# else +# define pthread_rwlock_timedwrlock __pthread_rwlock_timedwrlock64 +# endif +# endif # endif # ifdef __USE_GNU +# ifndef __USE_TIME_BITS64 extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock, clockid_t __clockid, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 3)); + +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_rwlock_clockwrlock, + (pthread_rwlock_t *__restrict __rwlock, + clockid_t __clockid, + const struct timespec *__restrict __abstime), + __pthread_rwlock_clockwrlock64) + __nonnull ((1, 3)); +# else +# define pthread_rwlock_clockwrlock __pthread_rwlock_clockwrlock64 +# endif +# endif # endif /* Unlock RWLOCK. */ @@ -1027,10 +1119,23 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __nonnull ((1, 2, 3)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (pthread_cond_timedwait, + (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict __abstime), + __pthread_cond_timedwait64) + __nonnull ((1, 2, 3)); +# else +# define pthread_cond_timedwait __pthread_cond_timedwait64 +# endif +# endif # ifdef __USE_GNU /* Wait for condition variable COND to be signaled or broadcast until @@ -1040,11 +1145,25 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, __clockid_t __clock_id, const struct timespec *__restrict __abstime) __nonnull ((1, 2, 4)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (pthread_cond_clockwait, + (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex, + __clockid_t __clock_id, + const struct timespec *__restrict __abstime), + __pthread_cond_clockwait64) + __nonnull ((1, 2, 4)); +# else +# define pthread_cond_clockwait __pthread_cond_clockwait64 +# endif +# endif # endif /* Functions for handling condition variable attributes. */ diff --git a/sysdeps/pthread/semaphore.h b/sysdeps/pthread/semaphore.h index 7fb0e5c103..35780e7c4e 100644 --- a/sysdeps/pthread/semaphore.h +++ b/sysdeps/pthread/semaphore.h @@ -59,16 +59,41 @@ extern int sem_wait (sem_t *__sem) __nonnull ((1)); This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int sem_timedwait (sem_t *__restrict __sem, const struct timespec *__restrict __abstime) __nonnull ((1, 2)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (sem_timedwait, + (sem_t *__restrict __sem, + const struct timespec *__restrict __abstime), + __sem_timedwait64) + __nonnull ((1, 2)); +# else +# define sem_timedwait __sem_timedwait64 +# endif +# endif #endif #ifdef __USE_GNU +# ifndef __USE_TIME_BITS64 extern int sem_clockwait (sem_t *__restrict __sem, clockid_t clock, const struct timespec *__restrict __abstime) __nonnull ((1, 3)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (sem_clockwait, + (sem_t *__restrict __sem, + clockid_t clock, + const struct timespec *__restrict __abstime), + __sem_clockwait64) + __nonnull ((1, 3)); +# else +# define sem_clockwait __sem_clockwait64 +# endif +# endif #endif /* Test whether SEM is posted. */ diff --git a/sysdeps/pthread/threads.h b/sysdeps/pthread/threads.h index 46929a025e..bf251c9db4 100644 --- a/sysdeps/pthread/threads.h +++ b/sysdeps/pthread/threads.h @@ -88,8 +88,18 @@ extern thrd_t thrd_current (void); __TIME_POINT. The current thread may resume if receives a signal. In that case, if __REMAINING is not NULL, the remaining time is stored in the object pointed by it. */ +#ifndef __USE_TIME_BITS64 extern int thrd_sleep (const struct timespec *__time_point, struct timespec *__remaining); +#else +# ifdef __REDIRECT +extern int __REDIRECT (thrd_sleep, (const struct timespec *__time_point, + struct timespec *__remaining), + __thrd_sleep64); +# else +# define thrd_sleep __thrd_sleep64 +# endif +#endif /* Terminate current thread execution, cleaning up any thread local storage and freeing resources. Returns the value specified in __RES. */ @@ -131,8 +141,19 @@ extern int mtx_lock (mtx_t *__mutex); /* Block the current thread until the mutex pointed by __MUTEX is unlocked or time pointed by __TIME_POINT is reached. In case the mutex is unlock, the current thread will not be blocked. */ +#ifndef __USE_TIME_BITS64 extern int mtx_timedlock (mtx_t *__restrict __mutex, const struct timespec *__restrict __time_point); +#else +# ifdef __REDIRECT +extern int __REDIRECT (mtx_timedlock, (mtx_t *__restrict __mutex, + const struct timespec *__restrict + __time_point), + __mtx_timedlock64); +# else +# define mtx_timedlock __mtx_timedlock64 +# endif +#endif /* Try to lock the mutex pointed by __MUTEX without blocking. If the mutex is free the current threads takes control of it, otherwise it returns @@ -171,9 +192,21 @@ extern int cnd_wait (cnd_t *__cond, mtx_t *__mutex); /* Block current thread on the condition variable until condition variable pointed by __COND is signaled or time pointed by __TIME_POINT is reached. */ +#ifndef __USE_TIME_BITS64 extern int cnd_timedwait (cnd_t *__restrict __cond, mtx_t *__restrict __mutex, const struct timespec *__restrict __time_point); +#else +# ifdef __REDIRECT +extern int __REDIRECT (cnd_timedwait, (cnd_t *__restrict __cond, + mtx_t *__restrict __mutex, + const struct timespec *__restrict + __time_point), + __cnd_timedwait64); +# else +# define cnd_timedwait __cnd_timedwait64 +# endif +#endif /* Destroy condition variable pointed by __cond and free all of its resources. */ diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 257ccbd3b4..45d31a46bc 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -1,3 +1,4 @@ +%include libc { GLIBC_2.0 { # functions used in inline functions or macros @@ -168,6 +169,75 @@ libc { getdents64; gettid; tgkill; } GLIBC_2.32 { + } + GLIBC_2.34 { +%ifdef TIME64_NON_DEFAULT + # 64 bit time_t support + # io + __ppoll64; + __utime64; + __stat64_time64; + __lstat64_time64; + __fstat64_time64; + __fstatat64_time64; + # misc + __futimes64; + __futimesat64; + __lutimes64; + __select64; + __utimes64; + # posix + __nanosleep64; + __pselec64; + __wait3_time64; + __wait4_time64; + # nptl + __thrd_sleep64; + # resouces + __getrusage64; + # signal + __sigtimedwait64; + # sysvipc + __msgctl64; + __semctl64; + __semtimedop64; + __shmctl64; + # time + ___adjtimex64; + __adjtime64; + __clock_adjtime64; + __clock_getres64; + __clock_gettime64; + __clock_nanosleep_time64; + __clock_settime64; + __ctime64; + __ctime64_r; + __difftime64; + __futimens64; + __localtime64; + __localtime64_r; + __getitimer64; + __gettimeofday64; + __gmtime64; + __gmtime64_r; + __mktime64; + __nanosleep64; + __setitimer64; + __settimeofday64; + __time64; + __timegm64; + __timespec_get64; + __utimensat64; + __utimes64; + # misc + __ntp_gettime64; + __ntp_gettimex64; + __pselect64; + __recvmmsg64; + __sched_rr_get_interval64; + __timerfd_gettime64; + __timerfd_settime64; +%endif } GLIBC_PRIVATE { # functions used in other libraries @@ -182,3 +252,46 @@ libc { __netlink_assert_response; } } + +libpthread { + GLIBC_2.34 { +%ifdef TIME64_NON_DEFAULT + # 64 bit time_t support + __cnd_timedwait64; + __mtx_timedlock64; + __pthread_clockjoin_np64; + __pthread_cond_timedwait64; + __pthread_cond_clockwait64; + __pthread_mutex_timedlock64; + __pthread_mutex_clocklock64; + __pthread_rwlock_clockrdlock64; + __pthread_rwlock_clockwrlock64; + __pthread_rwlock_timedrdlock64; + __pthread_rwlock_timedwrlock64; + __pthread_timedjoin_np64; + __sem_clockwait64; + __sem_timedwait64; +%endif + } +} + +librt { + GLIBC_2.34 { +%ifdef TIME64_NON_DEFAULT + # 64 bit time_t support + __aio_suspend_time64; + __mq_timedsend_time64; + __mq_timedreceive_time64; + __timer_gettime64; + __timer_settime64; +%endif + } +} + +libanl { +%ifdef TIME64_NON_DEFAULT + GLIBC_2.34 { + __gai_suspend_time64; + } +%endif +} diff --git a/sysdeps/unix/sysv/linux/arm/be/libanl.abilist b/sysdeps/unix/sysv/linux/arm/be/libanl.abilist index a8fafedb66..37f9b49e52 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libanl.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libanl.abilist @@ -1,3 +1,4 @@ +GLIBC_2.34 __gai_suspend_time64 F GLIBC_2.4 gai_cancel F GLIBC_2.4 gai_error F GLIBC_2.4 gai_suspend F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 8111b49085..d63e0dee75 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -155,7 +155,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist index b6c26c7a50..3fe358cc31 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libpthread.abilist @@ -33,6 +33,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 _IO_flockfile F GLIBC_2.4 _IO_ftrylockfile F GLIBC_2.4 _IO_funlockfile F diff --git a/sysdeps/unix/sysv/linux/arm/be/librt.abilist b/sysdeps/unix/sysv/linux/arm/be/librt.abilist index 3c0647b251..8cb1ed626c 100644 --- a/sysdeps/unix/sysv/linux/arm/be/librt.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/librt.abilist @@ -1,3 +1,8 @@ +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 aio_cancel F GLIBC_2.4 aio_cancel64 F GLIBC_2.4 aio_error F diff --git a/sysdeps/unix/sysv/linux/arm/le/libanl.abilist b/sysdeps/unix/sysv/linux/arm/le/libanl.abilist index a8fafedb66..37f9b49e52 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libanl.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libanl.abilist @@ -1,3 +1,4 @@ +GLIBC_2.34 __gai_suspend_time64 F GLIBC_2.4 gai_cancel F GLIBC_2.4 gai_error F GLIBC_2.4 gai_suspend F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 4dba1f2f46..1a0f0d1312 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -152,7 +152,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist index b6c26c7a50..3fe358cc31 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libpthread.abilist @@ -33,6 +33,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 _IO_flockfile F GLIBC_2.4 _IO_ftrylockfile F GLIBC_2.4 _IO_funlockfile F diff --git a/sysdeps/unix/sysv/linux/arm/le/librt.abilist b/sysdeps/unix/sysv/linux/arm/le/librt.abilist index 3c0647b251..8cb1ed626c 100644 --- a/sysdeps/unix/sysv/linux/arm/le/librt.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/librt.abilist @@ -1,3 +1,8 @@ +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 aio_cancel F GLIBC_2.4 aio_cancel64 F GLIBC_2.4 aio_error F diff --git a/sysdeps/unix/sysv/linux/arm/time64-compat.h b/sysdeps/unix/sysv/linux/arm/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/arm/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/bits/msq.h b/sysdeps/unix/sysv/linux/bits/msq.h index 3313b69d78..7c9c479551 100644 --- a/sysdeps/unix/sysv/linux/bits/msq.h +++ b/sysdeps/unix/sysv/linux/bits/msq.h @@ -26,6 +26,7 @@ typedef __syscall_ulong_t msgqnum_t; typedef __syscall_ulong_t msglen_t; #include +#include /* Define options for message queue functions. */ #define MSG_NOERROR 010000 /* no error if message is too big */ diff --git a/sysdeps/unix/sysv/linux/bits/sem.h b/sysdeps/unix/sysv/linux/bits/sem.h index ad13287e66..776524b876 100644 --- a/sysdeps/unix/sysv/linux/bits/sem.h +++ b/sysdeps/unix/sysv/linux/bits/sem.h @@ -22,6 +22,7 @@ #include #include #include +#include /* Flags for `semop'. */ #define SEM_UNDO 0x1000 /* undo the operation on exit */ diff --git a/sysdeps/unix/sysv/linux/bits/shm.h b/sysdeps/unix/sysv/linux/bits/shm.h index a50c79d7be..454fc3f366 100644 --- a/sysdeps/unix/sysv/linux/bits/shm.h +++ b/sysdeps/unix/sysv/linux/bits/shm.h @@ -43,6 +43,7 @@ __BEGIN_DECLS typedef __syscall_ulong_t shmatt_t; #include +#include #ifdef __USE_MISC diff --git a/sysdeps/unix/sysv/linux/bits/time.h b/sysdeps/unix/sysv/linux/bits/time.h index ee5a8b3ef4..d0c98a7864 100644 --- a/sysdeps/unix/sysv/linux/bits/time.h +++ b/sysdeps/unix/sysv/linux/bits/time.h @@ -77,6 +77,16 @@ __BEGIN_DECLS /* Tune a POSIX clock. */ extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW; +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT_NTH) +extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id, + struct timex *__utx), + __clock_adjtime64); +# else +# define clock_adjtime __clock_adjtime64 +# endif +#endif + __END_DECLS #endif /* use GNU */ diff --git a/sysdeps/unix/sysv/linux/csky/libanl.abilist b/sysdeps/unix/sysv/linux/csky/libanl.abilist index 416a6f8ddb..01f2e6cbf0 100644 --- a/sysdeps/unix/sysv/linux/csky/libanl.abilist +++ b/sysdeps/unix/sysv/linux/csky/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.29 gai_cancel F GLIBC_2.29 gai_error F GLIBC_2.29 gai_suspend F GLIBC_2.29 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index a5ff3d90ca..120a3fc1ce 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2115,7 +2115,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/csky/libpthread.abilist b/sysdeps/unix/sysv/linux/csky/libpthread.abilist index 6ce59276a7..51d5822091 100644 --- a/sysdeps/unix/sysv/linux/csky/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/csky/libpthread.abilist @@ -211,3 +211,17 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F diff --git a/sysdeps/unix/sysv/linux/csky/librt.abilist b/sysdeps/unix/sysv/linux/csky/librt.abilist index c6690ef7c1..b60deca65a 100644 --- a/sysdeps/unix/sysv/linux/csky/librt.abilist +++ b/sysdeps/unix/sysv/linux/csky/librt.abilist @@ -33,3 +33,8 @@ GLIBC_2.29 timer_delete F GLIBC_2.29 timer_getoverrun F GLIBC_2.29 timer_gettime F GLIBC_2.29 timer_settime F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F diff --git a/sysdeps/unix/sysv/linux/csky/time64-compat.h b/sysdeps/unix/sysv/linux/csky/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/csky/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/features-time64.h b/sysdeps/unix/sysv/linux/features-time64.h new file mode 100644 index 0000000000..c6a0a1874c --- /dev/null +++ b/sysdeps/unix/sysv/linux/features-time64.h @@ -0,0 +1,37 @@ +/* Features part to handle 64-bit time_t support. + Copyright (C) 2021 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 + . */ + +/* We need to know the word size in order to check the time size. */ +#include +#include + +#if defined _TIME_BITS +# if _TIME_BITS == 64 +# if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64 +# error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" +# elif __TIMESIZE == 32 +# define __USE_TIME_BITS64 1 +# endif +# elif _TIME_BITS == 32 +# if __TIMESIZE > 32 +# error "_TIME_BITS=32 is not compatible with __TIMESIZE > 32" +# endif +# else +# error Invalid _TIME_BITS value (can only be 32 or 64 bits) +# endif +#endif diff --git a/sysdeps/unix/sysv/linux/hppa/libanl.abilist b/sysdeps/unix/sysv/linux/hppa/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/hppa/libanl.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 89a0f11166..77c7d2faf3 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2074,7 +2074,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist index cabc5af858..0cdb30a3c1 100644 --- a/sysdeps/unix/sysv/linux/hppa/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libpthread.abilist @@ -218,6 +218,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_getprioceiling F GLIBC_2.4 pthread_mutex_setprioceiling F diff --git a/sysdeps/unix/sysv/linux/hppa/librt.abilist b/sysdeps/unix/sysv/linux/hppa/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/hppa/librt.abilist +++ b/sysdeps/unix/sysv/linux/hppa/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/hppa/time64-compat.h b/sysdeps/unix/sysv/linux/hppa/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile index da716e2c1b..8d5efb4f65 100644 --- a/sysdeps/unix/sysv/linux/i386/Makefile +++ b/sysdeps/unix/sysv/linux/i386/Makefile @@ -1,6 +1,8 @@ # The default ABI is 32. default-abi := 32 +extra-version := Versions-y2038 + ifeq ($(subdir),misc) sysdep_routines += ioperm iopl vm86 diff --git a/sysdeps/unix/sysv/linux/i386/libanl.abilist b/sysdeps/unix/sysv/linux/i386/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/i386/libanl.abilist +++ b/sysdeps/unix/sysv/linux/i386/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index a7c408d18c..7d1a9691e7 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2241,7 +2241,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/i386/libpthread.abilist b/sysdeps/unix/sysv/linux/i386/libpthread.abilist index 18177307c8..b3a825d60e 100644 --- a/sysdeps/unix/sysv/linux/i386/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/i386/libpthread.abilist @@ -226,6 +226,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_getprioceiling F GLIBC_2.4 pthread_mutex_setprioceiling F diff --git a/sysdeps/unix/sysv/linux/i386/librt.abilist b/sysdeps/unix/sysv/linux/i386/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/i386/librt.abilist +++ b/sysdeps/unix/sysv/linux/i386/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/i386/time64-compat.h b/sysdeps/unix/sysv/linux/i386/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/i386/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/include/sys/msg.h b/sysdeps/unix/sysv/linux/include/sys/msg.h index 522903f818..c460be0dc9 100644 --- a/sysdeps/unix/sysv/linux/include/sys/msg.h +++ b/sysdeps/unix/sysv/linux/include/sys/msg.h @@ -7,8 +7,6 @@ extern ssize_t __libc_msgrcv (int msqid, void *msgp, size_t msgsz, extern int __libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg); -# include - # if __TIMESIZE == 64 # define __msgctl64 __msgctl # else diff --git a/sysdeps/unix/sysv/linux/include/sys/shm.h b/sysdeps/unix/sysv/linux/include/sys/shm.h index 530a1cdfc9..85177a632d 100644 --- a/sysdeps/unix/sysv/linux/include/sys/shm.h +++ b/sysdeps/unix/sysv/linux/include/sys/shm.h @@ -3,8 +3,6 @@ #ifndef _ISOMAC -# include - # if __TIMESIZE == 64 # define __shmctl64 __shmctl # else diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h b/sysdeps/unix/sysv/linux/include/sys/timex.h index e136ed172e..c554248ed9 100644 --- a/sysdeps/unix/sysv/linux/include/sys/timex.h +++ b/sysdeps/unix/sysv/linux/include/sys/timex.h @@ -23,10 +23,12 @@ # ifndef _ISOMAC +extern int __adjtimex (struct timex *__ntx); libc_hidden_proto (__adjtimex) # include # include + /* Local definition of 64 bit time supporting timex struct */ # if __TIMESIZE == 64 # define __timex64 timex diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist index a8fafedb66..37f9b49e52 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist @@ -1,3 +1,4 @@ +GLIBC_2.34 __gai_suspend_time64 F GLIBC_2.4 gai_cancel F GLIBC_2.4 gai_error F GLIBC_2.4 gai_suspend F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index e1171a34aa..da00a3d3c3 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -156,7 +156,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist index b6c26c7a50..3fe358cc31 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist @@ -33,6 +33,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 _IO_flockfile F GLIBC_2.4 _IO_ftrylockfile F GLIBC_2.4 _IO_funlockfile F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist index 3c0647b251..8cb1ed626c 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist @@ -1,3 +1,8 @@ +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 aio_cancel F GLIBC_2.4 aio_cancel64 F GLIBC_2.4 aio_error F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index a521506506..3e0f00210f 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2186,7 +2186,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist index 18177307c8..b3a825d60e 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist @@ -226,6 +226,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_getprioceiling F GLIBC_2.4 pthread_mutex_setprioceiling F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/m68k/time64-compat.h b/sysdeps/unix/sysv/linux/m68k/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/m68k/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist index 67c7554803..c06e33a1cf 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.18 gai_cancel F GLIBC_2.18 gai_error F GLIBC_2.18 gai_suspend F GLIBC_2.18 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index aba642460c..9bed39a8e8 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2166,7 +2166,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist index 60397187b6..855c469c63 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist @@ -218,3 +218,17 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist index 889dfbc0ee..1b8fc10087 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist @@ -33,3 +33,8 @@ GLIBC_2.18 timer_delete F GLIBC_2.18 timer_getoverrun F GLIBC_2.18 timer_gettime F GLIBC_2.18 timer_settime F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist index 67c7554803..c06e33a1cf 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.18 gai_cancel F GLIBC_2.18 gai_error F GLIBC_2.18 gai_suspend F GLIBC_2.18 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index d3d653d144..872321bbab 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2163,7 +2163,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist index 60397187b6..855c469c63 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist @@ -218,3 +218,17 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist index 889dfbc0ee..1b8fc10087 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist @@ -33,3 +33,8 @@ GLIBC_2.18 timer_delete F GLIBC_2.18 timer_getoverrun F GLIBC_2.18 timer_gettime F GLIBC_2.18 timer_settime F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/time64-compat.h b/sysdeps/unix/sysv/linux/microblaze/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/microblaze/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index a4ce56c34f..77dcc8ab7d 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2157,7 +2157,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist index b35d7f19ca..887a32a376 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist @@ -227,6 +227,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_getprioceiling F GLIBC_2.4 pthread_mutex_setprioceiling F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist index 1539c1cef9..c4dd28e3b2 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 51fbf0b1e1..c41f85ce01 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2155,7 +2155,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h b/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 5642781479..4208f9df82 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2163,7 +2163,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist index b35d7f19ca..887a32a376 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libpthread.abilist @@ -227,6 +227,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_getprioceiling F GLIBC_2.4 pthread_mutex_setprioceiling F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist index 1539c1cef9..c4dd28e3b2 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/nios2/libanl.abilist b/sysdeps/unix/sysv/linux/nios2/libanl.abilist index 6ff9c2d94e..6b080bd075 100644 --- a/sysdeps/unix/sysv/linux/nios2/libanl.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.21 gai_cancel F GLIBC_2.21 gai_error F GLIBC_2.21 gai_suspend F GLIBC_2.21 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index 848cb2e599..ff0bb57cb6 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2204,7 +2204,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist index 924ad6e451..18407317e6 100644 --- a/sysdeps/unix/sysv/linux/nios2/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libpthread.abilist @@ -218,3 +218,17 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F diff --git a/sysdeps/unix/sysv/linux/nios2/librt.abilist b/sysdeps/unix/sysv/linux/nios2/librt.abilist index b4ae7a2dc2..2458614125 100644 --- a/sysdeps/unix/sysv/linux/nios2/librt.abilist +++ b/sysdeps/unix/sysv/linux/nios2/librt.abilist @@ -33,3 +33,8 @@ GLIBC_2.21 timer_delete F GLIBC_2.21 timer_getoverrun F GLIBC_2.21 timer_gettime F GLIBC_2.21 timer_settime F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F diff --git a/sysdeps/unix/sysv/linux/nios2/time64-compat.h b/sysdeps/unix/sysv/linux/nios2/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/nios2/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 93e83fa602..57f1fe012a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2213,7 +2213,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist index 13b41dafb6..711812931d 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist @@ -228,6 +228,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_getprioceiling F GLIBC_2.4 pthread_mutex_setprioceiling F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index ec0b6d69b1..6c9fa9c098 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2246,7 +2246,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 7bc5c8866b..d357619c55 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2211,7 +2211,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 lastlog_read F GLIBC_2.34 lastlog_write F GLIBC_2.4 _IO_fprintf F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist index 0a60f1cca2..28db1e4b6d 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist @@ -228,6 +228,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_getprioceiling F GLIBC_2.4 pthread_mutex_setprioceiling F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h b/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c index 1043b2b80d..bb2690d30f 100644 --- a/sysdeps/unix/sysv/linux/semctl.c +++ b/sysdeps/unix/sysv/linux/semctl.c @@ -21,7 +21,6 @@ #include #include #include -#include /* For __semid64_ds. */ #include /* For __kernel_mode_t. */ /* The struct used to issue the syscall. For architectures that assume diff --git a/sysdeps/unix/sysv/linux/sh/be/libanl.abilist b/sysdeps/unix/sysv/linux/sh/be/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libanl.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 06143b0283..725952a763 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2081,7 +2081,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist index cabc5af858..0cdb30a3c1 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libpthread.abilist @@ -218,6 +218,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_getprioceiling F GLIBC_2.4 pthread_mutex_setprioceiling F diff --git a/sysdeps/unix/sysv/linux/sh/be/librt.abilist b/sysdeps/unix/sysv/linux/sh/be/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/sh/be/librt.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/sh/le/libanl.abilist b/sysdeps/unix/sysv/linux/sh/le/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libanl.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index eab2af349b..7f07b96287 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2078,7 +2078,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist index cabc5af858..0cdb30a3c1 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libpthread.abilist @@ -218,6 +218,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_getprioceiling F GLIBC_2.4 pthread_mutex_setprioceiling F diff --git a/sysdeps/unix/sysv/linux/sh/le/librt.abilist b/sysdeps/unix/sysv/linux/sh/le/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/sh/le/librt.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/sh/time64-compat.h b/sysdeps/unix/sysv/linux/sh/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sh/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 4783a8fa97..3b7af990d4 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2202,7 +2202,59 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 getutent F GLIBC_2.34 getutent_r F GLIBC_2.34 getutid F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist index 390b6384d0..b5f763d9fd 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist @@ -228,6 +228,20 @@ GLIBC_2.30 pthread_rwlock_clockrdlock F GLIBC_2.30 pthread_rwlock_clockwrlock F GLIBC_2.30 sem_clockwait F GLIBC_2.31 pthread_clockjoin_np F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F +GLIBC_2.34 __pthread_mutex_clocklock64 F +GLIBC_2.34 __pthread_mutex_timedlock64 F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F GLIBC_2.4 pthread_mutex_consistent_np F GLIBC_2.4 pthread_mutex_getprioceiling F GLIBC_2.4 pthread_mutex_setprioceiling F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist index 38f0aad791..fb2769e87b 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist @@ -34,6 +34,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h b/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/sys/timerfd.h b/sysdeps/unix/sysv/linux/sys/timerfd.h index 4ad64c2259..790b9d5be6 100644 --- a/sysdeps/unix/sysv/linux/sys/timerfd.h +++ b/sysdeps/unix/sysv/linux/sys/timerfd.h @@ -47,9 +47,31 @@ extern int timerfd_settime (int __ufd, int __flags, const struct itimerspec *__utmr, struct itimerspec *__otmr) __THROW; +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT_NTH) +extern int __REDIRECT_NTH (timerfd_settime, + (int __ufd, int __flags, + const struct itimerspec *__restrict __value, + struct itimerspec *__restrict __ovalue), + __timerfd_settime64); +# else +# define timerfd_settime __timerfd_settime64 +# endif +#endif + /* Return the next expiration time of UFD. */ extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW; +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT_NTH) +extern int __REDIRECT_NTH (timerfd_gettime, (int __ufd, + struct itimerspec *__otmr), + __timerfd_gettime64); +# else +# define timerfd_gettime __timerfd_gettime64 +# endif +#endif + __END_DECLS #endif /* sys/timerfd.h */ diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h index 37931ff496..298f0ca6e7 100644 --- a/sysdeps/unix/sysv/linux/sys/timex.h +++ b/sysdeps/unix/sysv/linux/sys/timex.h @@ -54,17 +54,33 @@ struct ntptimeval __BEGIN_DECLS -extern int __adjtimex (struct timex *__ntx) __THROW; +#ifndef __USE_TIME_BITS64 extern int adjtimex (struct timex *__ntx) __THROW; -#ifdef __REDIRECT_NTH +# ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), - ntp_gettimex); + __ntp_gettime64); +# else +# define ntp_gettime ntp_gettimex +# endif +extern int ntp_adjtime (struct timex *__tntx) __THROW; #else -extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW; -# define ntp_gettime ntp_gettimex +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx), + ___adjtimex64); +extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), + __ntp_gettime64); +extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv), + __ntp_gettimex64); +extern int __REDIRECT_NTH (ntp_adjtime, (struct timex *__ntx), + ___adjtimex64); +# else +# define adjtimex ___adjtimex64 +# define ntp_adjtime ___adjtimex64 +# define ntp_gettime __ntp_gettime64 +# define ntp_gettimex __ntp_gettimex64 +# endif #endif -extern int ntp_adjtime (struct timex *__tntx) __THROW; __END_DECLS diff --git a/sysvipc/sys/msg.h b/sysvipc/sys/msg.h index 9ddedf5e15..f31a43757d 100644 --- a/sysvipc/sys/msg.h +++ b/sysvipc/sys/msg.h @@ -58,7 +58,17 @@ struct msgbuf __BEGIN_DECLS /* Message queue control operation. */ +#ifndef __USE_TIME_BITS64 extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW; +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (msgctl, + (int __msqid, int __cmd, struct msqid_ds *__buf), + __msgctl64); +# else +# define msgctl __msgctl64 +# endif +#endif /* Get messages queue. */ extern int msgget (key_t __key, int __msgflg) __THROW; diff --git a/sysvipc/sys/sem.h b/sysvipc/sys/sem.h index 03b65dff21..4eb4c51bbe 100644 --- a/sysvipc/sys/sem.h +++ b/sysvipc/sys/sem.h @@ -48,7 +48,17 @@ struct sembuf __BEGIN_DECLS /* Semaphore control operation. */ +#ifndef __USE_TIME_BITS64 extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW; +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (semctl, + (int __semid, int __semnum, int __cmd, ...), + __semctl64); +# else +# define semctl __semctl64 +# endif +#endif /* Get semaphore. */ extern int semget (key_t __key, int __nsems, int __semflg) __THROW; @@ -58,8 +68,19 @@ extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW; #ifdef __USE_GNU /* Operate on semaphore with timeout. */ +# ifndef __USE_TIME_BITS64 extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops, const struct timespec *__timeout) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (semtimedop, (int __semid, struct sembuf *__sops, + size_t __nsops, + const struct timespec *__timeout), + __semtimedop64); +# else +# define semtimedop __semtimedop64 +# endif +# endif #endif __END_DECLS diff --git a/sysvipc/sys/shm.h b/sysvipc/sys/shm.h index 7506ba67bf..b09e0497e6 100644 --- a/sysvipc/sys/shm.h +++ b/sysvipc/sys/shm.h @@ -46,7 +46,17 @@ __BEGIN_DECLS facility. The definition is found in XPG4.2. */ /* Shared memory control operation. */ +#ifndef __USE_TIME_BITS64 extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW; +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (shmctl, + (int __shmid, int __cmd, struct shmid_ds *__buf), + __shmctl64); +# else +# define shmctl __shmctl64 +# endif +#endif /* Get shared memory segment. */ extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW; diff --git a/time/sys/time.h b/time/sys/time.h index 42f91f186b..d21411c0b4 100644 --- a/time/sys/time.h +++ b/time/sys/time.h @@ -63,10 +63,21 @@ struct timezone use localtime etc. instead. This function itself is semi-obsolete; most callers should use time or clock_gettime instead. */ +#ifndef __USE_TIME_BITS64 extern int gettimeofday (struct timeval *__restrict __tv, void *__restrict __tz) __THROW __nonnull ((1)); +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (gettimeofday, (struct timeval *__restrict __tv, + void *__restrict __tz), + __gettimeofday64) __nonnull ((1)); +# else +# define gettimeofday __gettimeofday64 +# endif +#endif #ifdef __USE_MISC +# ifndef __USE_TIME_BITS64 /* Set the current time of day and timezone information. This call is restricted to the super-user. Setting the timezone in this way is obsolete, but we don't yet @@ -82,6 +93,20 @@ extern int settimeofday (const struct timeval *__tv, This call is restricted to the super-user. */ extern int adjtime (const struct timeval *__delta, struct timeval *__olddelta) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (settimeofday, (const struct timeval *__tv, + const struct timezone *__tz), + __settimeofday64); + +extern int __REDIRECT_NTH (adjtime, (const struct timeval *__delta, + struct timeval *__olddelta), + __adjtime64); +# else +# define settimeofday __settimeofday64 +# define adjtime __adjtime64 +# endif +# endif #endif @@ -118,6 +143,7 @@ typedef enum __itimer_which __itimer_which_t; typedef int __itimer_which_t; #endif +#ifndef __USE_TIME_BITS64 /* Set *VALUE to the current setting of timer WHICH. Return 0 on success, -1 on errors. */ extern int getitimer (__itimer_which_t __which, @@ -136,21 +162,66 @@ extern int setitimer (__itimer_which_t __which, extern int utimes (const char *__file, const struct timeval __tvp[2]) __THROW __nonnull ((1)); +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (getitimer, (__itimer_which_t __which, + struct itimerval *__value), + __getitimer64); + +extern int __REDIRECT_NTH (setitimer, (__itimer_which_t __which, + const struct itimerval *__restrict __new, + struct itimerval *__restrict __old), + __setitimer64); + +extern int __REDIRECT_NTH (utimes, (const char *__file, + const struct timeval __tvp[2]), + __utimes64) __nonnull ((1)); +# else +# define getitimer __getitimer64 +# define setitimer __setitimer64 +# define utimes __utimes64 +# endif +#endif + #ifdef __USE_MISC +# ifndef __USE_TIME_BITS64 /* Same as `utimes', but does not follow symbolic links. */ extern int lutimes (const char *__file, const struct timeval __tvp[2]) __THROW __nonnull ((1)); /* Same as `utimes', but takes an open file descriptor instead of a name. */ extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (lutimes, (const char *__file, + const struct timeval __tvp[2]), + __lutimes64) __nonnull ((1)); + +extern int __REDIRECT_NTH (futimes, (int __fd, const struct timeval __tvp[2]), + __futimes64); +# else +# define lutimes __lutimes64 +# define futimes __futimes64 +# endif +# endif #endif #ifdef __USE_GNU +# ifndef __USE_TIME_BITS64 /* Change the access time of FILE relative to FD to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int futimesat (int __fd, const char *__file, const struct timeval __tvp[2]) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (futimesat, (int __fd, const char *__file, + const struct timeval __tvp[2]), + __futimesat64); +# else +# define futimesat __futimesat64 +# endif +# endif #endif diff --git a/time/time.h b/time/time.h index 3bf206be0b..91b81cb1c6 100644 --- a/time/time.h +++ b/time/time.h @@ -71,6 +71,7 @@ __BEGIN_DECLS The result / CLOCKS_PER_SEC is program time in seconds. */ extern clock_t clock (void) __THROW; +#ifndef __USE_TIME_BITS64 /* Return the current time and put it in *TIMER if TIMER is not NULL. */ extern time_t time (time_t *__timer) __THROW; @@ -80,7 +81,18 @@ extern double difftime (time_t __time1, time_t __time0) /* Return the `time_t' representation of TP and normalize TP. */ extern time_t mktime (struct tm *__tp) __THROW; - +#else +# ifdef __REDIRECT_NTH +extern time_t __REDIRECT_NTH (time, (time_t *__timer), __time64); +extern double __REDIRECT_NTH (difftime, (time_t __time1, time_t __time0), + __difftime64) __attribute__ ((__const__)); +extern time_t __REDIRECT_NTH (mktime, (struct tm *__tp), __mktime64); +# else +# define time __time64 +# define difftime __difftime64 +# define mktime __mktime64 +# endif +#endif /* Format TP into S according to FORMAT. Write no more than MAXSIZE characters and return the number @@ -114,6 +126,7 @@ extern char *strptime_l (const char *__restrict __s, #endif +#ifndef __USE_TIME_BITS64 /* Return the `struct tm' representation of *TIMER in Universal Coordinated Time (aka Greenwich Mean Time). */ extern struct tm *gmtime (const time_t *__timer) __THROW; @@ -122,7 +135,20 @@ extern struct tm *gmtime (const time_t *__timer) __THROW; of *TIMER in the local timezone. */ extern struct tm *localtime (const time_t *__timer) __THROW; +#else +# ifdef __REDIRECT_NTH +extern struct tm*__REDIRECT_NTH (gmtime, (const time_t *__timer), __gmtime64); +extern struct tm *__REDIRECT_NTH (localtime, (const time_t *__timer), + __localtime64); +# else +# define gmtime __gmtime64 +# define localtime __localtime64 +# endif +#endif + + #if defined __USE_POSIX || __GLIBC_USE (ISOC2X) +# ifndef __USE_TIME_BITS64 /* Return the `struct tm' representation of *TIMER in UTC, using *TP to store the result. */ extern struct tm *gmtime_r (const time_t *__restrict __timer, @@ -132,6 +158,20 @@ extern struct tm *gmtime_r (const time_t *__restrict __timer, using *TP to store the result. */ extern struct tm *localtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) __THROW; +# else +# ifdef __REDIRECT_NTH +extern struct tm*__REDIRECT_NTH (gmtime_r, (const time_t *__restrict __timer, + struct tm *__restrict __tp), + __gmtime64_r); + +extern struct tm*__REDIRECT_NTH (localtime_r, (const time_t *__restrict __t, + struct tm *__restrict __tp), + __localtime64_r); +# else +# define gmtime_r __gmtime64_r +# define localtime_r __localtime_r +# endif +# endif #endif /* POSIX || C2X */ /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" @@ -139,7 +179,15 @@ extern struct tm *localtime_r (const time_t *__restrict __timer, extern char *asctime (const struct tm *__tp) __THROW; /* Equivalent to `asctime (localtime (timer))'. */ +#ifndef __USE_TIME_BITS64 extern char *ctime (const time_t *__timer) __THROW; +#else +# ifdef __REDIRECT_NTH +extern char *__REDIRECT_NTH (ctime, (const time_t *__timer), __ctime64); +# else +# define ctime __ctime64 +# endif +#endif #if defined __USE_POSIX || __GLIBC_USE (ISOC2X) /* Reentrant versions of the above functions. */ @@ -150,8 +198,18 @@ extern char *asctime_r (const struct tm *__restrict __tp, char *__restrict __buf) __THROW; /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ +#ifndef __USE_TIME_BITS64 extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __THROW; +#else +# ifdef __REDIRECT_NTH +extern char *__REDIRECT_NTH (ctime_r, (const time_t *__restrict __timer, + char *__restrict __buf), __ctime64_r); +# else +# define ctime_r __ctime64_r +# endif +#endif + #endif /* POSIX || C2X */ @@ -186,11 +244,19 @@ extern long int timezone; /* Miscellaneous functions many Unices inherited from the public domain localtime package. These are included only for compatibility. */ +#ifndef __USE_TIME_BITS64 /* Like `mktime', but for TP represents Universal Time, not local time. */ extern time_t timegm (struct tm *__tp) __THROW; - /* Another name for `mktime'. */ extern time_t timelocal (struct tm *__tp) __THROW; +#else +# ifdef __REDIRECT_NTH +extern time_t __REDIRECT_NTH (timegm, (struct tm *__tp), __timegm64); +extern time_t __REDIRECT_NTH (timelocal, (struct tm *__tp), __mktime64); +# else +# define timegm __timegm64 +# endif +#endif /* Return the number of days in YEAR. */ extern int dysize (int __year) __THROW __attribute__ ((__const__)); @@ -198,6 +264,7 @@ extern int dysize (int __year) __THROW __attribute__ ((__const__)); #ifdef __USE_POSIX199309 +# ifndef __USE_TIME_BITS64 /* Pause execution for a number of nanoseconds. This function is a cancellation point and therefore not marked with @@ -205,7 +272,6 @@ extern int dysize (int __year) __THROW __attribute__ ((__const__)); extern int nanosleep (const struct timespec *__requested_time, struct timespec *__remaining); - /* Get resolution of clock CLOCK_ID. */ extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW; @@ -215,15 +281,46 @@ extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW; /* Set clock CLOCK_ID to value TP. */ extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp) __THROW; +# else +# ifdef __REDIRECT +extern int __REDIRECT (nanosleep, (const struct timespec *__requested_time, + struct timespec *__remaining), + __nanosleep64); +extern int __REDIRECT_NTH (clock_getres, (clockid_t __clock_id, + struct timespec *__res), + __clock_getres64); +extern int __REDIRECT_NTH (clock_gettime, (clockid_t __clock_id, struct + timespec *__tp), __clock_gettime64); +extern int __REDIRECT_NTH (clock_settime, (clockid_t __clock_id, const struct + timespec *__tp), __clock_settime64); +# else +# define nanosleep __nanosleep64 +# define clock_getres __clock_getres64 +# define clock_gettime __clock_gettime64 +# define clock_settime __clock_settime64 +# endif +# endif + # ifdef __USE_XOPEN2K /* High-resolution sleep with the specified clock. This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int clock_nanosleep (clockid_t __clock_id, int __flags, const struct timespec *__req, struct timespec *__rem); +# else +# ifdef __REDIRECT +extern int __REDIRECT (clock_nanosleep, (clockid_t __clock_id, int __flags, + const struct timespec *__req, + struct timespec *__rem), + __clock_nanosleep_time64); +# else +# define clock_nanosleep __clock_nanosleep_time64 +# endif +# endif /* Return clock ID for CPU-time clock. */ extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW; @@ -239,6 +336,7 @@ extern int timer_create (clockid_t __clock_id, extern int timer_delete (timer_t __timerid) __THROW; /* Set timer TIMERID to VALUE, returning old value in OVALUE. */ +# ifndef __USE_TIME_BITS64 extern int timer_settime (timer_t __timerid, int __flags, const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __THROW; @@ -246,6 +344,21 @@ extern int timer_settime (timer_t __timerid, int __flags, /* Get current value of timer TIMERID and store it in VALUE. */ extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (timer_settime, (timer_t __timerid, int __flags, + const struct itimerspec *__restrict __value, + struct itimerspec *__restrict __ovalue), + __timer_settime64); + +extern int __REDIRECT_NTH (timer_gettime, (timer_t __timerid, + struct itimerspec *__value), + __timer_gettime64); +# else +# define timer_settime __timer_settime64 +# define timer_gettime __timer_gettime64 +# endif +# endif /* Get expiration overrun for timer TIMERID. */ extern int timer_getoverrun (timer_t __timerid) __THROW; @@ -253,9 +366,18 @@ extern int timer_getoverrun (timer_t __timerid) __THROW; #ifdef __USE_ISOC11 +# ifndef __USE_TIME_BITS64 /* Set TS to calendar time based in time base BASE. */ extern int timespec_get (struct timespec *__ts, int __base) __THROW __nonnull ((1)); +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (timespec_get, (struct timespec *__ts, int __base), + __timespec_get64) __nonnull ((1)); +# else +# define timespec_get __timespec_get64 +# endif +# endif #endif From patchwork Fri Mar 5 20:15:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42320 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 0F373399F038; Fri, 5 Mar 2021 20:16:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F373399F038 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975376; bh=JfENS8eXyHKDypbH0OnMfb3MHtV3AnBvnHeqfoRO8sM=; 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=o0tetznkG1s5qW+E6kAbJnrZ6fTtm5/SJGD+w2i8uxi9zTqXZkcIE3dFUNl6SxbMc Q6I3VgXxh4+ZXgINQkRx3XGLJD0YBBv/Af2zNwQYnhDzq8PigrcohC9+JEoqMz1u0f /xwbFXalFJBsrDIg+n+lsstcGkstEoXEtuStv7oM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by sourceware.org (Postfix) with ESMTPS id 7D70A399F031 for ; Fri, 5 Mar 2021 20:16:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7D70A399F031 Received: by mail-qk1-x735.google.com with SMTP id f124so3288696qkj.5 for ; Fri, 05 Mar 2021 12:16:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JfENS8eXyHKDypbH0OnMfb3MHtV3AnBvnHeqfoRO8sM=; b=ieEYwR/G53x2TzCtI7dygQDI3mXnZjdl+Sl3V3CRc1XzD57u7FaqFR8kpPhUmwA4KP VeG3rgNlfzqvyTSkPnnkhx4x0VyI6AVE/XryPSqiZUJtG80F8T5w5101PwvwwKsbU3Vd KKvSKDqmno6MQRgxyNUwc/gXbEOA4i1y/gMp92AlbC8lRPQUFvLk7viIS+mXreVpeTV0 YCPaAafGXunj/g/NZa5hFsRFRdsKRhy3PZMe+I+MlqETd0SsB0O3PkTyvosAitvlCNAy pjoSUVK9HVoARF9LLLsHI9Zc8brNQ0J19t2LJJH4nURuCZzymhbT/6xWXHIcbKAuHF/6 RZEg== X-Gm-Message-State: AOAM531oOBxMtGd9wEiLHZY+sULqDGrut+ykVjM+hbNfGtnpeYy5Efy5 G7Xgf/vshuO8+io4XRFB9JwdryobyeH/BQ== X-Google-Smtp-Source: ABdhPJxdmJsO9mzQ4buVyBsTFCLgib9BGxdi9cpiqDlBCKPdTYMS6YRMqxYuy0IbdAmKvi5eMwQs2Q== X-Received: by 2002:a37:4783:: with SMTP id u125mr10996796qka.186.1614975370344; Fri, 05 Mar 2021 12:16:10 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:10 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 39/52] posix: Add glob64 with 64 bit time_t support Date: Fri, 5 Mar 2021 17:15:05 -0300 Message-Id: <20210305201518.798584-40-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The glob might pass a different stat struct for gl_stat and gl_lstat when GLOB_ALTDIRFUNC is used. This requires add a new 64 time version that also uses 64 time stat functions. Checked on i686-linux-gnu and x86_64-linux-gnu. --- include/glob.h | 28 +++++++++++ posix/Makefile | 3 +- posix/glob.c | 46 +++++++++-------- posix/glob.h | 22 +++++++++ posix/glob64-lstat-compat.c | 3 +- posix/glob64-time64.c | 49 +++++++++++++++++++ posix/globfree64-time64.c | 30 ++++++++++++ sysdeps/gnu/glob64-lstat-compat.c | 3 +- sysdeps/unix/sysv/linux/Versions | 2 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 2 + sysdeps/unix/sysv/linux/csky/libc.abilist | 2 + sysdeps/unix/sysv/linux/glob-lstat-compat.c | 6 ++- sysdeps/unix/sysv/linux/glob.c | 6 +++ sysdeps/unix/sysv/linux/glob64-lstat-compat.c | 12 ++--- sysdeps/unix/sysv/linux/glob64-time64.c | 44 +++++++++++++++++ sysdeps/unix/sysv/linux/glob64.c | 8 +-- sysdeps/unix/sysv/linux/globfree64-time64.c | 35 +++++++++++++ sysdeps/unix/sysv/linux/hppa/libc.abilist | 2 + sysdeps/unix/sysv/linux/i386/libc.abilist | 2 + .../sysv/linux/m68k/coldfire/libc.abilist | 2 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 2 + .../sysv/linux/microblaze/be/libc.abilist | 2 + .../sysv/linux/microblaze/le/libc.abilist | 2 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 2 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 2 + .../sysv/linux/mips/mips64/n32/libc.abilist | 2 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 2 + sysdeps/unix/sysv/linux/oldglob.c | 11 ++--- .../linux/powerpc/powerpc32/fpu/libc.abilist | 2 + .../powerpc/powerpc32/nofpu/libc.abilist | 2 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 2 + .../sysv/linux/sparc/sparc32/libc.abilist | 2 + 35 files changed, 306 insertions(+), 40 deletions(-) create mode 100644 posix/glob64-time64.c create mode 100644 posix/globfree64-time64.c create mode 100644 sysdeps/unix/sysv/linux/glob64-time64.c create mode 100644 sysdeps/unix/sysv/linux/globfree64-time64.c diff --git a/include/glob.h b/include/glob.h index 1d2f78793e..f48c71960d 100644 --- a/include/glob.h +++ b/include/glob.h @@ -2,11 +2,39 @@ #include #ifndef _ISOMAC +# include + libc_hidden_proto (glob) libc_hidden_proto (glob64) libc_hidden_proto (globfree) libc_hidden_proto (globfree64) +# if __TIMESIZE == 64 +# define glob64_time64_t glob64_t +# else +# include + +typedef struct + { + size_t gl_pathc; + char **gl_pathv; + size_t gl_offs; + int gl_flags; + + void (*gl_closedir) (void *); + struct dirent64 *(*gl_readdir) (void *); + void *(*gl_opendir) (const char *); + int (*gl_lstat) (const char *__restrict, struct __stat64_t64 *__restrict); + int (*gl_stat) (const char *__restrict, struct __stat64_t64 *__restrict); + } glob64_time64_t; + +extern int __glob64_time64 (const char *pattern, int flags, + int (*errfunc) (const char *, int), + glob64_time64_t *pglob); +void __globfree64_time64 (glob64_time64_t *pglob); +libc_hidden_proto (__globfree64_time64) +# endif + /* Now define the internal interfaces. */ extern int __glob_pattern_p (const char *__pattern, int __quote); extern int __glob64 (const char *__pattern, int __flags, diff --git a/posix/Makefile b/posix/Makefile index 8e31c721e1..aba66efde8 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -66,7 +66,8 @@ routines := \ posix_madvise \ get_child_max sched_cpucount sched_cpualloc sched_cpufree \ streams-compat \ - shm-directory + shm-directory \ + glob64-time64 globfree64-time64 aux := init-posix environ tests := test-errno tstgetopt testfnm runtests runptests \ diff --git a/posix/glob.c b/posix/glob.c index 32c88e5d15..593a4c358f 100644 --- a/posix/glob.c +++ b/posix/glob.c @@ -59,25 +59,37 @@ # define readdir(str) __readdir64 (str) # define getpwnam_r(name, bufp, buf, len, res) \ __getpwnam_r (name, bufp, buf, len, res) -# define struct_stat64 struct stat64 # define FLEXIBLE_ARRAY_MEMBER +# ifndef struct_stat +# define struct_stat struct stat +# endif +# ifndef struct_stat64 +# define struct_stat64 struct stat64 +# endif +# ifndef GLOB_LSTAT +# define GLOB_LSTAT gl_lstat +# endif +# ifndef GLOB_STAT64 +# define GLOB_STAT64 __stat64 +# endif +# ifndef GLOB_LSTAT64 +# define GLOB_LSTAT64 __lstat64 +# endif # include #else /* !_LIBC */ # define __glob glob # define __getlogin_r(buf, len) getlogin_r (buf, len) -# define __lstat64(fname, buf) lstat (fname, buf) -# if defined _WIN32 && !defined __CYGWIN__ - /* Avoid GCC or clang warning. The original __stat64 macro is unused. */ -# undef __stat64 -# endif -# define __stat64(fname, buf) stat (fname, buf) # define __fxstatat64(_, d, f, st, flag) fstatat (d, f, st, flag) -# define struct_stat64 struct stat # ifndef __MVS__ # define __alloca alloca # endif # define __readdir readdir # define COMPILE_GLOB64 +# define struct_stat struct stat +# define struct_stat64 struct stat +# define GLOB_LSTAT gl_lstat +# define GLOB_STAT64 stat +# define GLOB_LSTAT64 lstat #endif /* _LIBC */ #include @@ -196,22 +208,14 @@ glob_lstat (glob_t *pglob, int flags, const char *fullname) { /* Use on glob-lstat-compat.c to provide a compat symbol which does not use lstat / gl_lstat. */ -#ifdef GLOB_NO_LSTAT -# define GL_LSTAT gl_stat -# define LSTAT64 __stat64 -#else -# define GL_LSTAT gl_lstat -# define LSTAT64 __lstat64 -#endif - union { - struct stat st; + struct_stat st; struct_stat64 st64; } ust; return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC) - ? pglob->GL_LSTAT (fullname, &ust.st) - : LSTAT64 (fullname, &ust.st64)); + ? pglob->GLOB_LSTAT (fullname, &ust.st) + : GLOB_LSTAT64 (fullname, &ust.st64)); } /* Set *R = A + B. Return true if the answer is mathematically @@ -249,11 +253,11 @@ static int collated_compare (const void *, const void *) __THROWNL; static bool is_dir (char const *filename, int flags, glob_t const *pglob) { - struct stat st; + struct_stat st; struct_stat64 st64; return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC) ? pglob->gl_stat (filename, &st) == 0 && S_ISDIR (st.st_mode) - : __stat64 (filename, &st64) == 0 && S_ISDIR (st64.st_mode)); + : GLOB_STAT64 (filename, &st64) == 0 && S_ISDIR (st64.st_mode)); } /* Find the end of the sub-pattern in a brace expression. */ diff --git a/posix/glob.h b/posix/glob.h index b5686600c7..700aeb2392 100644 --- a/posix/glob.h +++ b/posix/glob.h @@ -150,20 +150,42 @@ extern int glob (const char *__restrict __pattern, int __flags, /* Free storage allocated in PGLOB by a previous `glob' call. */ extern void globfree (glob_t *__pglob) __THROW; #else +# ifdef __USE_TIME_BITS64 +extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern, + int __flags, + int (*__errfunc) (const char *, int), + glob_t *__restrict __pglob), + __glob64_time64); + +extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), + __globfree64_time64); +# else extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern, int __flags, int (*__errfunc) (const char *, int), glob_t *__restrict __pglob), glob64); extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64); +# endif #endif #ifdef __USE_LARGEFILE64 +# ifdef __USE_TIME_BITS64 +extern int __REDIRECT_NTHNL (glob64, (const char *__restrict __pattern, + int __flags, + int (*__errfunc) (const char *, int), + glob64_t *__restrict __pglob), + __glob64_time64); + +extern void __REDIRECT_NTH (globfree64, (glob64_t *__pglob), + __globfree64_time64); +# else extern int glob64 (const char *__restrict __pattern, int __flags, int (*__errfunc) (const char *, int), glob64_t *__restrict __pglob) __THROWNL; extern void globfree64 (glob64_t *__pglob) __THROW; +# endif #endif diff --git a/posix/glob64-lstat-compat.c b/posix/glob64-lstat-compat.c index bd81a1e390..e90d4ae93e 100644 --- a/posix/glob64-lstat-compat.c +++ b/posix/glob64-lstat-compat.c @@ -28,7 +28,8 @@ # define GLOB_ATTRIBUTE attribute_compat_text_section /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ -# define GLOB_NO_LSTAT +# define GLOB_LSTAT gl_stat +# define GLOB_LSTAT64 __stat64 # include diff --git a/posix/glob64-time64.c b/posix/glob64-time64.c new file mode 100644 index 0000000000..04db45f93a --- /dev/null +++ b/posix/glob64-time64.c @@ -0,0 +1,49 @@ +/* Long File Support glob with 64 bit time support. + Copyright (C) 2021 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 +#include + +#if __TIMESIZE != 64 + +/* Do glob searching for PATTERN, placing results in PGLOB. + The bits defined above may be set in FLAGS. + If a directory cannot be opened or read and ERRFUNC is not nil, + it is called with the pathname that caused the error, and the + `errno' value from the failing call; if it returns non-zero + `glob' returns GLOB_ABORTED; if it returns zero, the error is ignored. + If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned. + Otherwise, `glob' returns zero. */ +int +__glob64_time64 (const char *pattern, int flags, + int (*errfunc) (const char *, int), glob64_time64_t *pglob) +{ + if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0) + { + __set_errno (EINVAL); + return -1; + } + + __set_errno (ENOSYS); + return GLOB_NOSYS; +} + +stub_warning (glob64) + +#endif diff --git a/posix/globfree64-time64.c b/posix/globfree64-time64.c new file mode 100644 index 0000000000..d815bc6df1 --- /dev/null +++ b/posix/globfree64-time64.c @@ -0,0 +1,30 @@ +/* Long File Support globfree with 64 bit time support. + Copyright (C) 2021 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 + +#if __TIMESIZE != 64 + +/* Free storage allocated in PGLOB by a previous `glob' call. */ +void +__globfree64_time64 (glob64_time64_t *pglob) +{ +} +libc_hidden_def (__globfree64_time64) + +#endif diff --git a/sysdeps/gnu/glob64-lstat-compat.c b/sysdeps/gnu/glob64-lstat-compat.c index 6764f1d062..ade4ccac8a 100644 --- a/sysdeps/gnu/glob64-lstat-compat.c +++ b/sysdeps/gnu/glob64-lstat-compat.c @@ -39,7 +39,8 @@ #define GLOB_ATTRIBUTE attribute_compat_text_section /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ -#define GLOB_NO_LSTAT +#define GLOB_LSTAT gl_stat +#define GLOB_LSTAT64 __stat64 #include diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 45d31a46bc..4df0ece1f3 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -187,6 +187,8 @@ libc { __select64; __utimes64; # posix + __glob64_time64; + __globfree64_time64; __nanosleep64; __pselec64; __wait3_time64; diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index d63e0dee75..9952c6936f 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -173,6 +173,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 1a0f0d1312..bf9c48fbcd 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -170,6 +170,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index 120a3fc1ce..d0494fcd74 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2133,6 +2133,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/glob-lstat-compat.c b/sysdeps/unix/sysv/linux/glob-lstat-compat.c index 1f502e3299..7729e0dc12 100644 --- a/sysdeps/unix/sysv/linux/glob-lstat-compat.c +++ b/sysdeps/unix/sysv/linux/glob-lstat-compat.c @@ -30,7 +30,11 @@ #define GLOB_ATTRIBUTE attribute_compat_text_section /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ -#define GLOB_NO_LSTAT +#define struct_stat struct stat +#define struct_stat64 struct stat64 +#define GLOB_LSTAT gl_stat +#define GLOB_STAT64 __stat64 +#define GLOB_LSTAT64 __stat64 #include diff --git a/sysdeps/unix/sysv/linux/glob.c b/sysdeps/unix/sysv/linux/glob.c index 1be4885b96..89c287d01d 100644 --- a/sysdeps/unix/sysv/linux/glob.c +++ b/sysdeps/unix/sysv/linux/glob.c @@ -19,6 +19,12 @@ #include #include +#define struct_stat struct stat +#define struct_stat64 struct stat64 +#define GLOB_LSTAT gl_lstat +#define GLOB_STAT64 __stat64 +#define GLOB_LSTAT64 __lstat64 + #define glob64 __no_glob64_decl #define __glob64 __no___glob64_decl #include diff --git a/sysdeps/unix/sysv/linux/glob64-lstat-compat.c b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c index 40ad625f58..302a44d3a4 100644 --- a/sysdeps/unix/sysv/linux/glob64-lstat-compat.c +++ b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c @@ -33,15 +33,15 @@ # define __glob __glob64_lstat_compat # define globfree globfree64 -# undef stat -# define stat stat64 - -# define COMPILE_GLOB64 1 - # define GLOB_ATTRIBUTE attribute_compat_text_section /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ -# define GLOB_NO_LSTAT +# define COMPILE_GLOB64 1 +# define struct_stat struct stat64 +# define struct_stat64 struct stat64 +# define GLOB_LSTAT gl_stat +# define GLOB_STAT64 __stat64 +# define GLOB_LSTAT64 __stat64 # include diff --git a/sysdeps/unix/sysv/linux/glob64-time64.c b/sysdeps/unix/sysv/linux/glob64-time64.c new file mode 100644 index 0000000000..260f067fa4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/glob64-time64.c @@ -0,0 +1,44 @@ +/* Find pathnames matching a pattern. Linux version. + Copyright (C) 2021 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 + +#if __TIMESIZE != 64 +# include +# include +# include + +# define dirent dirent64 +# define __readdir(dirp) __readdir64 (dirp) + +# define glob_t glob64_time64_t +# define __glob __glob64_time64 + +# define globfree(pglob) __globfree64_time64 (pglob) + +# define COMPILE_GLOB64 1 +# define struct_stat struct __stat64_t64 +# define struct_stat64 struct __stat64_t64 +# define GLOB_LSTAT gl_lstat +# define GLOB_STAT64 __stat64_time64 +# define GLOB_LSTAT64 __lstat64_time64 + +# define COMPILE_GLOB64 1 + +# include +#endif diff --git a/sysdeps/unix/sysv/linux/glob64.c b/sysdeps/unix/sysv/linux/glob64.c index 3cbadf34fb..572ca215df 100644 --- a/sysdeps/unix/sysv/linux/glob64.c +++ b/sysdeps/unix/sysv/linux/glob64.c @@ -31,10 +31,12 @@ # define __glob __glob64 # define globfree(pglob) globfree64 (pglob) -# undef stat -# define stat stat64 - # define COMPILE_GLOB64 1 +# define struct_stat struct stat64 +# define struct_stat64 struct stat64 +# define GLOB_LSTAT gl_lstat +# define GLOB_STAT64 __stat64 +# define GLOB_LSTAT64 __lstat64 # include diff --git a/sysdeps/unix/sysv/linux/globfree64-time64.c b/sysdeps/unix/sysv/linux/globfree64-time64.c new file mode 100644 index 0000000000..d6b1e6ac49 --- /dev/null +++ b/sysdeps/unix/sysv/linux/globfree64-time64.c @@ -0,0 +1,35 @@ +/* Frees the dynamically allocated storage from an earlier call to glob. + Linux version. + Copyright (C) 2021 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 + +#if __TIMESIZE != 64 +# include +# include +# include + +# define glob_t glob64_time64_t +# define globfree(pglob) __globfree64_time64 (pglob) + +# undef stat +# define stat __stat64_t64 + +# include +libc_hidden_def (__globfree64_time64) +#endif diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 77c7d2faf3..33f9f0ba5c 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2092,6 +2092,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 7d1a9691e7..44e3e4fcb1 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2259,6 +2259,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index da00a3d3c3..84a4a1d60b 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -174,6 +174,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 3e0f00210f..eb290d2000 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2204,6 +2204,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 9bed39a8e8..a341137565 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2184,6 +2184,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index 872321bbab..956291e8c0 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2181,6 +2181,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 77dcc8ab7d..ea5993d651 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2175,6 +2175,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index c41f85ce01..e167afac72 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2173,6 +2173,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 4208f9df82..0ebfc36f9b 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2181,6 +2181,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index ff0bb57cb6..06febde125 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2222,6 +2222,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/oldglob.c b/sysdeps/unix/sysv/linux/oldglob.c index 59bf89dc1d..a9a4439ddb 100644 --- a/sysdeps/unix/sysv/linux/oldglob.c +++ b/sysdeps/unix/sysv/linux/oldglob.c @@ -28,13 +28,12 @@ libc_hidden_proto (__old_glob64); #define convert_dirent __old_convert_dirent #define glob_in_dir __old_glob_in_dir -#undef stat -#define stat stat64 -#undef __stat -#define __stat(file, buf) __stat64 (file, buf) - /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ -#define GLOB_NO_LSTAT +#define struct_stat struct stat64 +#define struct_stat64 struct stat64 +#define GLOB_LSTAT gl_stat +#define GLOB_STAT64 __stat64 +#define GLOB_LSTAT64 __stat64 #define GLOB_ATTRIBUTE attribute_compat_text_section diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 57f1fe012a..e292d5afdd 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2231,6 +2231,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 6c9fa9c098..332bb8a3bc 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2264,6 +2264,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index d357619c55..e2c81ee4fc 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2229,6 +2229,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 725952a763..adc5305c41 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2099,6 +2099,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 7f07b96287..4757127f97 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2096,6 +2096,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 3b7af990d4..25429967b0 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2220,6 +2220,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F From patchwork Fri Mar 5 20:15:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42321 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 0CF5B39A5C01; Fri, 5 Mar 2021 20:16:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0CF5B39A5C01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975378; bh=Vy61eQHRgwzDL9C+JVpzM32TIHpVtupFTk5lN43ysiE=; 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=iFQ7ToogBEkDeEu/zjYo3fol1p4LhWvAt5tyE5CKFmeo/bI+PxqKMoqc5KF2MJx0/ UZ8PkLaFppKz3Z1DSP3LBTiVFjrSvAoFKsNoaAIWvRJ7ZAT8ZY2wwkoaW7FhOsblpP aTbrTA23fHuc1aLPWU5mvcit5sC1RUScC3CxVl6E= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id 5E582399F037 for ; Fri, 5 Mar 2021 20:16:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5E582399F037 Received: by mail-qk1-x72a.google.com with SMTP id d20so3311241qkc.2 for ; Fri, 05 Mar 2021 12:16:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vy61eQHRgwzDL9C+JVpzM32TIHpVtupFTk5lN43ysiE=; b=lCqfdgTqYhqw9Kn6USRBGgGDwz7raVlDOzFKZbfy5ZfZyk7SAH8fkX0h24hwILy+O/ SJrhTJiMlkj/IQ3jroHFOlgh6XJlnkNx3ZYQfLGmQBEzJRFMrUC/RkhcI+LSEbHCcuC2 JAxKA3HA9vZgBIF6+ayfpiZWlUH6IrvOLcPYVDQp3wygyVgH6x9arAZKLrTV4JkSeXct 18+EST8OJf3UXEsswjqeRrea9Pa2zep6qa+oBzUI9z7Kec4sjHHgiOLbV43yvbh196L2 Tn4a9pogbQ/rx8czSL5KDzl1ciAa3NU1VKCbZH8W4vRMkFNfvsYztGiJojWnmd1zSweh ntcw== X-Gm-Message-State: AOAM532to56jXjyhaTvdOmjleOt01arVcah+n3SkLSBgWNxb/LHZmzK5 eHcp+uqbJcRwtIhuS9TzXkMtEq0e770mww== X-Google-Smtp-Source: ABdhPJwt/y5njGoFPKQjeeqHwUNK1vQp17saDmiIz9p9RGR82vfCMBbMzeTT72diXWSohd23z5dOuA== X-Received: by 2002:a37:9b82:: with SMTP id d124mr10602175qke.489.1614975371519; Fri, 05 Mar 2021 12:16:11 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:11 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 40/52] io: Add fts64 with 64 bit time_t support Date: Fri, 5 Mar 2021 17:15:06 -0300 Message-Id: <20210305201518.798584-41-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Similar to glob, fts routines passes a stat pointer that might differ of size and layout when 64 bit time API is used. Checked on i686-linux-gnu and x86_64-linux-gnu. --- include/fts.h | 51 +++++++++++++++++++ io/Makefile | 4 +- io/fts.h | 43 ++++++++++++++-- io/fts64-time64.c | 35 +++++++++++++ sysdeps/unix/sysv/linux/Versions | 5 ++ sysdeps/unix/sysv/linux/arm/be/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/arm/le/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/csky/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/hppa/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/i386/libc.abilist | 5 ++ .../sysv/linux/m68k/coldfire/libc.abilist | 5 ++ .../unix/sysv/linux/m68k/m680x0/libc.abilist | 5 ++ .../sysv/linux/microblaze/be/libc.abilist | 5 ++ .../sysv/linux/microblaze/le/libc.abilist | 5 ++ .../sysv/linux/mips/mips32/fpu/libc.abilist | 5 ++ .../sysv/linux/mips/mips32/nofpu/libc.abilist | 5 ++ .../sysv/linux/mips/mips64/n32/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/nios2/libc.abilist | 5 ++ .../linux/powerpc/powerpc32/fpu/libc.abilist | 5 ++ .../powerpc/powerpc32/nofpu/libc.abilist | 5 ++ .../unix/sysv/linux/s390/s390-32/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/sh/be/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/sh/le/libc.abilist | 5 ++ .../sysv/linux/sparc/sparc32/libc.abilist | 5 ++ 24 files changed, 227 insertions(+), 6 deletions(-) create mode 100644 io/fts64-time64.c diff --git a/include/fts.h b/include/fts.h index 145dce6779..ea36a9b9be 100644 --- a/include/fts.h +++ b/include/fts.h @@ -1 +1,52 @@ +#ifndef _FTS_H #include + +#ifndef _ISOMAC +# if __TIMESIZE != 64 +# include + +typedef struct +{ + struct _ftsent64_time64 *fts_cur; + struct _ftsent64_time64 *fts_child; + struct _ftsent64_time64 **fts_array; + dev_t fts_dev; + char *fts_path; + int fts_rfd; + int fts_pathlen; + int fts_nitems; + int (*fts_compar) (const void *, const void *); + int fts_options; +} FTS64_TIME64; + +typedef struct _ftsent64_time64 +{ + struct _ftsent64_time64 *fts_cycle; + struct _ftsent64_time64 *fts_parent; + struct _ftsent64_time64 *fts_link; + long fts_number; + void *fts_pointer; + char *fts_accpath; + char *fts_path; + int fts_errno; + int fts_symfd; + unsigned short fts_pathlen; + unsigned short fts_namelen; + + ino64_t fts_ino; + dev_t fts_dev; + nlink_t fts_nlink; + + short fts_level; + unsigned short fts_info; + unsigned short fts_flags; + unsigned short fts_instr; + + struct __stat64_t64 *fts_statp; + char fts_name[1]; +} FSTENT64_TIME64; + +# endif +#endif + +#endif /* _FTS_H */ diff --git a/io/Makefile b/io/Makefile index 59d36e8782..f3a34854e1 100644 --- a/io/Makefile +++ b/io/Makefile @@ -54,7 +54,8 @@ routines := \ posix_fadvise posix_fadvise64 \ posix_fallocate posix_fallocate64 \ sendfile sendfile64 copy_file_range \ - utimensat futimens file_change_detection + utimensat futimens file_change_detection \ + fts64-time64 others := pwd test-srcs := ftwtest @@ -96,6 +97,7 @@ CFLAGS-statvfs.c += -fexceptions CFLAGS-fstatvfs.c += -fexceptions CFLAGS-fts.c += -Wno-uninitialized $(uses-callbacks) -fexceptions CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions +CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions CFLAGS-ftw.c += $(uses-callbacks) -fexceptions CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions CFLAGS-posix_fallocate.c += -fexceptions diff --git a/io/fts.h b/io/fts.h index 867677a27e..8d3395fa31 100644 --- a/io/fts.h +++ b/io/fts.h @@ -187,6 +187,7 @@ FTSENT *fts_read (FTS *); int fts_set (FTS *, FTSENT *, int) __THROW; #else # ifdef __REDIRECT +# ifndef __USE_TIME_BITS64 FTSENT *__REDIRECT (fts_children, (FTS *, int), fts64_children); int __REDIRECT (fts_close, (FTS *), fts64_close); FTS *__REDIRECT (fts_open, (char * const *, int, @@ -194,21 +195,53 @@ FTS *__REDIRECT (fts_open, (char * const *, int, fts64_open); FTSENT *__REDIRECT (fts_read, (FTS *), fts64_read); int __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), fts64_set); +# else +FTSENT *__REDIRECT (fts_children, (FTS *, int), __fts64_children_time64); +int __REDIRECT (fts_close, (FTS *), __fts64_close_time64); +FTS *__REDIRECT (fts_open, (char * const *, int, + int (*)(const FTSENT **, const FTSENT **)), + __fts64_open_time64); +FTSENT *__REDIRECT (fts_read, (FTS *), __fts64_read_time64); +int __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), + __fts64_set_time64); +# endif # else -# define fts_children fts64_children -# define fts_close fts64_close -# define fts_open fts64_open -# define fts_read fts64_read -# define fts_set fts64_set +# ifndef __USE_TIME_BITS64 +# define fts_children fts64_children +# define fts_close fts64_close +# define fts_open fts64_open +# define fts_read fts64_read +# define fts_set fts64_set +# else +# endif # endif #endif #ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 FTSENT64 *fts64_children (FTS64 *, int); int fts64_close (FTS64 *); FTS64 *fts64_open (char * const *, int, int (*)(const FTSENT64 **, const FTSENT64 **)); FTSENT64 *fts64_read (FTS64 *); int fts64_set (FTS64 *, FTSENT64 *, int) __THROW; +# else +# ifdef __REDIRECT +FTSENT *__REDIRECT (fts64_children, (FTS64 *, int), __fts64_children_time64); +int __REDIRECT (fts64_close, (FTS64 *), __fts64_close_time64); +FTS *__REDIRECT (fts64_open, (char * const *, int, + int (*)(const FTSENT64 **, const FTSENT64 **)), + __fts64_open_time64); +FTSENT *__REDIRECT (fts64_read, (FTS64 *), __fts64_read_time64); +int __REDIRECT_NTH (fts64_set, (FTS64 *, FTSENT64 *, int), + __fts64_set_time64); +# else +# define fts_children __fts64_children_time64 +# define fts_close __fts64_close_time64 +# define fts_open __fts64_open_time64 +# define fts_read __fts64_read_time64 +# define fts_set __fts64_set_time64 +# endif +# endif #endif __END_DECLS diff --git a/io/fts64-time64.c b/io/fts64-time64.c new file mode 100644 index 0000000000..c8885ca79b --- /dev/null +++ b/io/fts64-time64.c @@ -0,0 +1,35 @@ +/* File tree traversal functions LFS version. + Copyright (C) 2015-2021 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 + +#if __TIMESIZE != 64 +# define FTS_OPEN __fts64_open_time64 +# define FTS_CLOSE __fts64_close_time64 +# define FTS_READ __fts64_read_time64 +# define FTS_SET __fts64_set_time64 +# define FTS_CHILDREN __fts64_children_time64 +# define FTSOBJ FTS64_TIME64 +# define FTSENTRY FSTENT64_TIME64 +# define INO_T ino64_t +# define STRUCT_STAT __stat64_t64 +# define STAT __stat64_time64 +# define LSTAT __lstat64_time64 + +# include "fts.c" +#endif diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 4df0ece1f3..ba5216e928 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -180,6 +180,11 @@ libc { __lstat64_time64; __fstat64_time64; __fstatat64_time64; + __fts64_open_time64; + __fts64_close_time64; + __fts64_read_time64; + __fts64_set_time64; + __fts64_children_time64; # misc __futimes64; __futimesat64; diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 9952c6936f..4034576f83 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -167,6 +167,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index bf9c48fbcd..655035d9b0 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -164,6 +164,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index d0494fcd74..51825b5516 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2127,6 +2127,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 33f9f0ba5c..8523f451f2 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2086,6 +2086,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 44e3e4fcb1..b85302318c 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2253,6 +2253,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 84a4a1d60b..eb9d2a23fe 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -168,6 +168,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index eb290d2000..496c57a039 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2198,6 +2198,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index a341137565..7216a031eb 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2178,6 +2178,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index 956291e8c0..6e1b8ff3a7 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2175,6 +2175,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index ea5993d651..89e3621708 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2169,6 +2169,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index e167afac72..1080cc8332 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2167,6 +2167,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 0ebfc36f9b..98b2fc62f3 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2175,6 +2175,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index 06febde125..f5140aec1e 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2216,6 +2216,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index e292d5afdd..57daf51b4e 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2225,6 +2225,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 332bb8a3bc..fae83acd3b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2258,6 +2258,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index e2c81ee4fc..47c86f2b03 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2223,6 +2223,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index adc5305c41..9d60db0845 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2093,6 +2093,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 4757127f97..5d6a69b751 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2090,6 +2090,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 25429967b0..c787962323 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2214,6 +2214,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F From patchwork Fri Mar 5 20:15:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42322 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 9ACD539A5C02; Fri, 5 Mar 2021 20:16:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9ACD539A5C02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975378; bh=TyN16fX2S7/+0WdTAljP3YLLfpeO1AwjdWoOYV3I894=; 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=CMDeX3XMAu2eGZ6DzeGjYE4Ucim5l/jv0NzMCg5ziDvvEPv4s8Z0dHWwUEB4JsqrW rUwkXFteuLemLQMW30VVTjoS7SvnRblC0sRyzYraXBKNihGtc8T+5RUF8jx5kkNg3l zCrS9lGiu84eAnZahLNZB688+s9+YcvmDUuJISFw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id B24AF399F01E for ; Fri, 5 Mar 2021 20:16:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B24AF399F01E Received: by mail-qk1-x72a.google.com with SMTP id z128so3240690qkc.12 for ; Fri, 05 Mar 2021 12:16:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TyN16fX2S7/+0WdTAljP3YLLfpeO1AwjdWoOYV3I894=; b=D+kZ/yHHIMgP1BigNm9xmZY37QhRACJEvsjWcmSQ9ZcMHpjOTyEpw1Rr4G9T0fHnpi hP9yrRfWHe6/rXlxCHgDI9oKXWc4mrF5E8Xu/FQ9XPa/yfhiu0VyRdR5KooFeecCCO2m pqL9Slh8eyAamwSn9Xb0J4uQCfzm3og1+ckNlpKHmTnG5y1KRcxY6Hj6AqUmBcrKaiNd QYGqDawaazqIVEWO4VmnzZ5praX6tfpaMgKStKnyIsnR7+qtc3X5obSxnalKlM8Q7vsF m69Oy116H0KIINxMMl5YvracluAR15ldfNqg0kRXj4ykxCAnJ2yc5ioTWhmT51oQHxVR USyQ== X-Gm-Message-State: AOAM532YF/c7VKEmkwRfgTulJuVUkr3PgFLgy2UWuQFbAH+bYH344g+T 3PtHGu7FaMnKAcgmk09GQgazFp9jT/BYQQ== X-Google-Smtp-Source: ABdhPJzHk01Hir9SFMZqu1cROb/GpI74kple6CHIycHhyK2/H5vRVWmJAcVXHh4YMjR47uI/zveQKg== X-Received: by 2002:a37:a44:: with SMTP id 65mr10464790qkk.479.1614975372741; Fri, 05 Mar 2021 12:16:12 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:12 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 41/52] io: Add ftw64 with 64 bit time_t support Date: Fri, 5 Mar 2021 17:15:07 -0300 Message-Id: <20210305201518.798584-42-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Similar to fts, ftw routines passes a stat pointer that might differ of size and layout when 64 bit time API is used. Checked on i686-linux-gnu and x86_64-linux-gnu. --- include/ftw.h | 18 ++++++++ io/Makefile | 4 +- io/ftw.c | 5 +- io/ftw.h | 46 ++++++++++++++++++- io/ftw64-time64.c | 34 ++++++++++++++ sysdeps/unix/sysv/linux/Versions | 2 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 2 + sysdeps/unix/sysv/linux/csky/libc.abilist | 2 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 2 + sysdeps/unix/sysv/linux/i386/libc.abilist | 2 + .../sysv/linux/m68k/coldfire/libc.abilist | 2 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 2 + .../sysv/linux/microblaze/be/libc.abilist | 2 + .../sysv/linux/microblaze/le/libc.abilist | 2 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 2 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 2 + .../sysv/linux/mips/mips64/n32/libc.abilist | 2 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 2 + .../linux/powerpc/powerpc32/fpu/libc.abilist | 2 + .../powerpc/powerpc32/nofpu/libc.abilist | 2 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 2 + .../sysv/linux/sparc/sparc32/libc.abilist | 2 + 25 files changed, 141 insertions(+), 6 deletions(-) create mode 100644 io/ftw64-time64.c diff --git a/include/ftw.h b/include/ftw.h index 4fb654cf22..8fb89c4046 100644 --- a/include/ftw.h +++ b/include/ftw.h @@ -1 +1,19 @@ +#ifndef _FTW_H #include + +#ifndef _ISOMAC +# if __TIMESIZE != 64 +# include + +typedef int (*__ftw64_time64_func_t) (const char *, + const struct __stat64_t64 *, int); +typedef int (*__nftw64_time64_func_t) (const char *, + const struct __stat64_t64 *, int, + struct FTW *); + +extern int __ftw64_time64 (const char *, __ftw64_time64_func_t, int); +extern int __nftw64_time64 (const char *, __nftw64_time64_func_t, int, int); +# endif +#endif + +#endif /* _FTW_H */ diff --git a/io/Makefile b/io/Makefile index f3a34854e1..6c637f7c6d 100644 --- a/io/Makefile +++ b/io/Makefile @@ -55,7 +55,8 @@ routines := \ posix_fallocate posix_fallocate64 \ sendfile sendfile64 copy_file_range \ utimensat futimens file_change_detection \ - fts64-time64 + fts64-time64 \ + ftw64-time64 others := pwd test-srcs := ftwtest @@ -100,6 +101,7 @@ CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions CFLAGS-ftw.c += $(uses-callbacks) -fexceptions CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions +CFLAGS-ftw64-time64.c += $(uses-callbacks) -fexceptions CFLAGS-posix_fallocate.c += -fexceptions CFLAGS-posix_fallocate64.c += -fexceptions CFLAGS-fallocate.c += -fexceptions diff --git a/io/ftw.c b/io/ftw.c index baca3deeee..ce1c6a14a3 100644 --- a/io/ftw.c +++ b/io/ftw.c @@ -821,7 +821,7 @@ FTW_NAME (const char *path, FTW_FUNC_T func, int descriptors) return ftw_startup (path, 0, func, descriptors, 0); } -#ifndef _LIBC +#ifndef NFTW_OLD_NAME int NFTW_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags) { @@ -844,7 +844,6 @@ NFTW_NEW_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags) } return ftw_startup (path, 1, func, descriptors, flags); } - versioned_symbol (libc, NFTW_NEW_NAME, NFTW_NAME, GLIBC_2_3_3); # if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_3_3) @@ -863,4 +862,4 @@ NFTW_OLD_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags) compat_symbol (libc, NFTW_OLD_NAME, NFTW_NAME, GLIBC_2_1); # endif -#endif +#endif /* NFTW_OLD_NAME */ diff --git a/io/ftw.h b/io/ftw.h index 751d689cdb..446498856d 100644 --- a/io/ftw.h +++ b/io/ftw.h @@ -137,15 +137,36 @@ extern int ftw (const char *__dir, __ftw_func_t __func, int __descriptors) __nonnull ((1, 2)); #else # ifdef __REDIRECT +# ifndef __USE_TIME_BITS64 extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func, int __descriptors), ftw64) __nonnull ((1, 2)); +# else +extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func, + int __descriptors), __ftw64_time64) + __nonnull ((1, 2)); +# endif # else -# define ftw ftw64 +# ifndef __USE_TIME_BITS64 +# define ftw ftw64 +# else +# define ftw __ftw64_time64 +# endif # endif #endif #ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 extern int ftw64 (const char *__dir, __ftw64_func_t __func, int __descriptors) __nonnull ((1, 2)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (ftw64, (const char *__dir, __ftw64_func_t __func, + int __descriptors), + __ftw64_time64) + __nonnull ((1, 2)); +# else +# define nftw64 __nftw64_time64 +# endif +# endif #endif #ifdef __USE_XOPEN_EXTENDED @@ -159,16 +180,37 @@ extern int nftw (const char *__dir, __nftw_func_t __func, int __descriptors, int __flag) __nonnull ((1, 2)); # else # ifdef __REDIRECT +# ifndef __USE_TIME_BITS64 extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func, int __descriptors, int __flag), nftw64) __nonnull ((1, 2)); +# else +extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func, + int __descriptors, int __flag), __nftw64_time64) + __nonnull ((1, 2)); +# endif # else -# define nftw nftw64 +# ifndef __USE_TIME_BITS64 +# define nftw nftw64 +# else +# define nftw __nftw64_time64 +# endif # endif # endif # ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 extern int nftw64 (const char *__dir, __nftw64_func_t __func, int __descriptors, int __flag) __nonnull ((1, 2)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (nftw64, (const char *__dir, __nftw64_func_t __func, + int __descriptors, int __flag), + __nftw64_time64) + __nonnull ((1, 2)); +# else +# define nftw64 __nftw64_time64 +# endif +# endif # endif #endif diff --git a/io/ftw64-time64.c b/io/ftw64-time64.c new file mode 100644 index 0000000000..7c9db5448a --- /dev/null +++ b/io/ftw64-time64.c @@ -0,0 +1,34 @@ +/* File tree walker functions. LFS version. + Copyright (C) 1996-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + + 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 + +#if __TIMESIZE != 64 +# define FTW_NAME __ftw64_time64 +# define NFTW_NAME __nftw64_time64 +# define INO_T ino64_t +# define STRUCT_STAT __stat64_t64 +# define LSTAT __lstat64_time64 +# define STAT __stat64_time64 +# define FSTATAT __fstatat64_time64 +# define FTW_FUNC_T __ftw64_time64_func_t +# define NFTW_FUNC_T __nftw64_time64_func_t + +# include "ftw.c" +#endif diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index ba5216e928..b53391f613 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -185,6 +185,8 @@ libc { __fts64_read_time64; __fts64_set_time64; __fts64_children_time64; + __ftw64_time64; + __nftw64_time64; # misc __futimes64; __futimesat64; diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 4034576f83..a34bca151d 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -172,6 +172,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -190,6 +191,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 655035d9b0..5a7c57afa7 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -169,6 +169,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -187,6 +188,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index 51825b5516..c8b1890033 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2132,6 +2132,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2150,6 +2151,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 8523f451f2..5eb997849b 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2091,6 +2091,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2109,6 +2110,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index b85302318c..3549788a52 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2258,6 +2258,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2276,6 +2277,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index eb9d2a23fe..f6b1b06ce9 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -173,6 +173,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -191,6 +192,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 496c57a039..2f92eae937 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2203,6 +2203,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2221,6 +2222,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 7216a031eb..ae86eed8d0 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2183,6 +2183,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2201,6 +2202,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index 6e1b8ff3a7..9f6b846a71 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2180,6 +2180,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2198,6 +2199,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 89e3621708..c16000604b 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2174,6 +2174,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2192,6 +2193,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 1080cc8332..76b864f9d2 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2172,6 +2172,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2190,6 +2191,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 98b2fc62f3..a20fb835e4 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2180,6 +2180,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2198,6 +2199,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index f5140aec1e..a8b7a8c92c 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2221,6 +2221,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2239,6 +2240,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 57daf51b4e..d5ab432dc3 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2230,6 +2230,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2248,6 +2249,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index fae83acd3b..7885585950 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2263,6 +2263,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2281,6 +2282,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 47c86f2b03..de75dc4ac8 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2228,6 +2228,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2246,6 +2247,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 9d60db0845..573c2fcbbf 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2098,6 +2098,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2116,6 +2117,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 5d6a69b751..ef942ed276 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2095,6 +2095,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2113,6 +2114,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index c787962323..802a2eb7ce 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2219,6 +2219,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2237,6 +2238,7 @@ GLIBC_2.34 __lutimes64 F GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F From patchwork Fri Mar 5 20:15:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42323 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 4437B39A5C05; Fri, 5 Mar 2021 20:16:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4437B39A5C05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975379; bh=4UBSAFp6cgdYI14jD0rxghCp3tH3PQuHWegLcKBQmWM=; 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=pphktEvEJKc4ZhPbtqAsQw4Dzpp6+wP5e8l6DH47IIo8LGHbXsNWR3y+mgP/tWEjr ceJKz+LlKJ4ScwqRL/D6MLEme0GNBaNzEK3nGdHeHs+aQ3R613M5Q6BifKX5dCm5tz yj1ngqPz+jBACjCl+UDuQkVNbzi7Xa7QmTu3VyHA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by sourceware.org (Postfix) with ESMTPS id A0A8F399C033 for ; Fri, 5 Mar 2021 20:16:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A0A8F399C033 Received: by mail-qt1-x833.google.com with SMTP id w1so2787157qto.2 for ; Fri, 05 Mar 2021 12:16:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4UBSAFp6cgdYI14jD0rxghCp3tH3PQuHWegLcKBQmWM=; b=pxqQ7Tky55IRoFJDSwI8VUn7HZDE5tS1huoUMbDOa80nK7IcQdLFuT+F5YjtiMbwXz 7OTwJXu6djw4H+HkFp6QvKjgD0uLsSHy0ZGdQc3wTsQcRukIFmVCMAhh0hPTsrzkM0Y7 Ob5lN1U4+KWB8enxBD9GGFdtUuMZBKuX4zGKllN2fVNlRmIWqV7ZSGZTgOY8+OR9BRXA T0a62kd8Q2pFFzGDogmSVW8rC0z2YD5hFgb98KGlwjs2paU+65r1EdwpH0OtGwR9pHIs nQRInnyb80Ydi8W4oONMDbl2Yftih49iBB0ldhqSPPVA2/oBIoiSA1dIBtaG7kaR0VWU 3Xhw== X-Gm-Message-State: AOAM533YV26EKlmmjgbkkQFq6WeGtL2eFFLePN+Fq8hcb1ae3+iPYgcr XVVt0mVHCSi1W179hDxz8AyGFhgvJLAjhA== X-Google-Smtp-Source: ABdhPJywkw/K7Hnx0M2bvKoMU/eGhL7GqS0D+kcvZVxTDRNNFNL2ywK9YunyPMSvc04r8e6gMHx4ZQ== X-Received: by 2002:ac8:d4f:: with SMTP id r15mr10590011qti.289.1614975373865; Fri, 05 Mar 2021 12:16:13 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:13 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 42/52] libsupport: Add 64 bit time_t support for time functions Date: Fri, 5 Mar 2021 17:15:08 -0300 Message-Id: <20210305201518.798584-43-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The patch adds redirections for xclock_gettime, xclock_settime, timespec_add, timespec_sub, test_timespec_before_impl, test_timespec_equal_or_after_impl, support_timespec_ns, support_timespec_normalize, and support_timespec_check_in_range when _TIME_BITS=64 is defined. --- support/Makefile | 5 ++++ support/timespec-add-time64.c | 27 +++++++++++++++++ support/timespec-add.c | 2 +- support/timespec-sub-time64.c | 27 +++++++++++++++++ support/timespec-sub.c | 2 +- support/timespec-time64.c | 40 +++++++++++++++++++++++++ support/timespec.c | 9 +++--- support/timespec.h | 52 +++++++++++++++++++++++++-------- support/xclock_gettime_time64.c | 26 +++++++++++++++++ support/xtime.h | 5 ++++ 10 files changed, 176 insertions(+), 19 deletions(-) create mode 100644 support/timespec-add-time64.c create mode 100644 support/timespec-sub-time64.c create mode 100644 support/timespec-time64.c create mode 100644 support/xclock_gettime_time64.c diff --git a/support/Makefile b/support/Makefile index bb9889efb4..846e0dbb26 100644 --- a/support/Makefile +++ b/support/Makefile @@ -79,8 +79,11 @@ libsupport-routines = \ support_test_verify_impl \ temp_file \ timespec \ + timespec-time64 \ timespec-add \ + timespec-add-time64 \ timespec-sub \ + timespec-sub-time64 \ write_message \ xaccept \ xaccept4 \ @@ -90,6 +93,7 @@ libsupport-routines = \ xchdir \ xchroot \ xclock_gettime \ + xclock_gettime_time64 \ xclose \ xchmod \ xconnect \ @@ -209,6 +213,7 @@ CFLAGS-support_paths.c = \ # in support_timespec_check_in_range and for that computation we use # -fexcess-precision=standard. CFLAGS-timespec.c += -fexcess-precision=standard +CFLAGS-timespec-time64.c += -fexcess-precision=standard ifeq (,$(CXX)) LINKS_DSO_PROGRAM = links-dso-program-c diff --git a/support/timespec-add-time64.c b/support/timespec-add-time64.c new file mode 100644 index 0000000000..8574e1602c --- /dev/null +++ b/support/timespec-add-time64.c @@ -0,0 +1,27 @@ +/* Add two struct __timespec64 values. 64 bit time support. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library and is also part of gnulib. + Patches to this file should be submitted to both projects. + + 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 + +#if __TIMESIZE != 64 +# define timespec __timespec64 +# define time_t __time64_t +# define timespec_add timespec_add_time64 +# include "timespec-add.c" +#endif diff --git a/support/timespec-add.c b/support/timespec-add.c index cf8bd91291..8ed3acef6d 100644 --- a/support/timespec-add.c +++ b/support/timespec-add.c @@ -61,5 +61,5 @@ timespec_add (struct timespec a, struct timespec b) } } - return make_timespec (rs, rns); + return (struct timespec) { .tv_sec = rs, .tv_nsec = rns }; } diff --git a/support/timespec-sub-time64.c b/support/timespec-sub-time64.c new file mode 100644 index 0000000000..f88307016d --- /dev/null +++ b/support/timespec-sub-time64.c @@ -0,0 +1,27 @@ +/* Subtract two struct __timespec64 values. 64 bit time support. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library and is also part of gnulib. + Patches to this file should be submitted to both projects. + + 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 + +#if __TIMESIZE != 64 +# define timespec __timespec64 +# define time_t __time64_t +# define timespec_sub timespec_sub_time64 +# include "timespec-sub.c" +#endif diff --git a/support/timespec-sub.c b/support/timespec-sub.c index 08cc233086..0b8fea042d 100644 --- a/support/timespec-sub.c +++ b/support/timespec-sub.c @@ -61,5 +61,5 @@ timespec_sub (struct timespec a, struct timespec b) } } - return make_timespec (rs, rns); + return (struct timespec) { .tv_sec = rs, .tv_nsec = rns }; } diff --git a/support/timespec-time64.c b/support/timespec-time64.c new file mode 100644 index 0000000000..5bbf8be7e0 --- /dev/null +++ b/support/timespec-time64.c @@ -0,0 +1,40 @@ +/* Support code for timespec checks. 64 bit time support. + Copyright (C) 2021 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 +#include +#include +#include + +#if __TIMESIZE != 64 +struct __timespec64 timespec_sub_time64 (struct __timespec64, + struct __timespec64); + +#define test_timespec_before_impl test_timespec_before_impl_time64 +#define test_timespec_equal_or_after_impl \ + test_timespec_equal_or_after_impl_time64 +#define support_timespec_ns support_timespec_ns_time64 +#define support_timespec_normalize support_timespec_normalize_time64 +#define support_timespec_check_in_range \ + support_timespec_check_in_range_time64 +#define timespec __timespec64 +#define timespec_sub timespec_sub_time64 + +#include "timespec.c" +#endif diff --git a/support/timespec.c b/support/timespec.c index b02afad9d3..fcc54861b1 100644 --- a/support/timespec.c +++ b/support/timespec.c @@ -23,9 +23,8 @@ #include void -test_timespec_before_impl (const char *file, int line, - const struct timespec left, - const struct timespec right) +test_timespec_before_impl (const char *file, int line, struct timespec left, + struct timespec right) { if (left.tv_sec > right.tv_sec || (left.tv_sec == right.tv_sec @@ -43,8 +42,8 @@ test_timespec_before_impl (const char *file, int line, void test_timespec_equal_or_after_impl (const char *file, int line, - const struct timespec left, - const struct timespec right) + struct timespec left, + struct timespec right) { if (left.tv_sec < right.tv_sec || (left.tv_sec == right.tv_sec diff --git a/support/timespec.h b/support/timespec.h index a3eb72aa01..0478aef51f 100644 --- a/support/timespec.h +++ b/support/timespec.h @@ -24,11 +24,6 @@ #include #include -struct timespec timespec_add (struct timespec, struct timespec) - __attribute__((const)); -struct timespec timespec_sub (struct timespec, struct timespec) - __attribute__((const)); - static inline struct timespec make_timespec (time_t s, long int ns) { @@ -40,21 +35,54 @@ make_timespec (time_t s, long int ns) enum { TIMESPEC_HZ = 1000000000 }; +#ifndef __USE_TIME_BITS64 +struct timespec timespec_add (struct timespec, struct timespec) + __attribute__((const)); +struct timespec timespec_sub (struct timespec, struct timespec) + __attribute__((const)); + void test_timespec_before_impl (const char *file, int line, - const struct timespec left, - const struct timespec right); + struct timespec left, + struct timespec right); void test_timespec_equal_or_after_impl (const char *file, int line, - const struct timespec left, - const struct timespec right); + struct timespec left, + struct timespec right); time_t support_timespec_ns (struct timespec time); struct timespec support_timespec_normalize (struct timespec time); -int support_timespec_check_in_range (struct timespec expected, struct timespec observed, - double lower_bound, double upper_bound); - +int support_timespec_check_in_range (struct timespec expected, + struct timespec observed, + double lower_bound, double upper_bound); + +#else +struct timespec __REDIRECT (timespec_add, (struct timespec, struct timespec), + timespec_add_time64); +struct timespec __REDIRECT (timespec_sub, (struct timespec, struct timespec), + timespec_sub_time64); +void __REDIRECT (test_timespec_before_impl, (const char *file, int line, + struct timespec left, + struct timespec right), + test_timespec_before_impl_time64); +void __REDIRECT (test_timespec_equal_or_after_impl, (const char *f, int line, + struct timespec left, + struct timespec right), + test_timespec_equal_or_after_impl_time64); + +time_t __REDIRECT (support_timespec_ns, (struct timespec time), + support_timespec_ns_time64); + +struct timespec __REDIRECT (support_timespec_normalize, (struct timespec time), + support_timespec_normalize_time64); + +int __REDIRECT (support_timespec_check_in_range, (struct timespec expected, + struct timespec observed, + double lower_bound, + double upper_bound), + support_timespec_check_in_range_time64); +#endif /* Check that the timespec on the left represents a time before the time on the right. */ diff --git a/support/xclock_gettime_time64.c b/support/xclock_gettime_time64.c new file mode 100644 index 0000000000..bf9fe9bf9c --- /dev/null +++ b/support/xclock_gettime_time64.c @@ -0,0 +1,26 @@ +/* clock_settime with error checking. 64 bit time_t support. + Copyright (C) 2021 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 + +#if __TIMESIZE != 64 +# define xclock_gettime xclock_gettime_time64 +# define timespec __timespec64 +# define clock_gettime __clock_gettime64 +# include "xclock_gettime.c" +#endif diff --git a/support/xtime.h b/support/xtime.h index 2482837dee..e5fb56a9fc 100644 --- a/support/xtime.h +++ b/support/xtime.h @@ -26,7 +26,12 @@ __BEGIN_DECLS /* The following functions call the corresponding libc functions and terminate the process on error. */ +#ifndef __USE_TIME_BITS64 void xclock_gettime (clockid_t clock, struct timespec *ts); +#else +void __REDIRECT (xclock_gettime, (clockid_t clock, struct timespec *ts), + xclock_gettime_time64); +#endif /* This helper can often simplify tests by avoiding an explicit variable declaration or allowing that declaration to be const. */ From patchwork Fri Mar 5 20:15:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42324 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 C9FC839A5C07; Fri, 5 Mar 2021 20:16:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9FC839A5C07 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975379; bh=VwkbMVjbD+11R3Lj7wG4B0tP48R4jfT9Y32wDGEc6vE=; 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=jUQ6DCBfD3hKaZwZIXRyqyl5+h9XIeC9yuhzoo430gGupi2z6+HwR+76LsdjVaWNU +49pE2yDGbRvkYA4Mo8+tjxso1ingafG6tpijEftyHC7GHdmauusaA00+olBq7OZca JGPgL3zGfFqQp0xMi2HlkVJKFwafAdJA8S+bcbrw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by sourceware.org (Postfix) with ESMTPS id ABA7E399F023 for ; Fri, 5 Mar 2021 20:16:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ABA7E399F023 Received: by mail-qk1-x72f.google.com with SMTP id a9so3245136qkn.13 for ; Fri, 05 Mar 2021 12:16:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VwkbMVjbD+11R3Lj7wG4B0tP48R4jfT9Y32wDGEc6vE=; b=DRi+fAHvab8rJl1K5zXpHq2s5dNLTZ0XC7seqWykOLnlPAc0vI0kua9X6wUq8I6OBX Chyhtz2gB9l6Jd8u3VyCk53ytSKkTGzL7Gl9PACrV6ZBwqHP/qar6K3kkswmh94KpluQ AouB8f2ZIzgnqK6Ud6330soiStR4Rmx4aA8U5P/kXthjEK6jzbj4Oj7Q3sSLbZ4nLkOD Gu8gAQBaKO7/RQxdX6LMeqT13H2davvPf1pogYd/VmU7nTVGdGCfY3n7r5KaGy9Qfviz tTB/MhaRUqyU9/L0vHnishSyOG1ok4OxMdwsK7TB8OT61C5VVBBdHHCes85Y34X55YxH jS5g== X-Gm-Message-State: AOAM530dlwthpHm6Yweu7VEuiYDser7xAEhZshSvZUaIJ7PT0kx+gAAP vcsqUrpqQoLR3hRI+EmJ19gM7Ufjh9sQJg== X-Google-Smtp-Source: ABdhPJwL8ZWL2xy537jHVbOpXhotM1vw+O9oZY253rx6/K+R5Gd4d5pEJRnRH49uR6nGGdNGUn2EkA== X-Received: by 2002:a05:620a:4504:: with SMTP id t4mr10709662qkp.369.1614975375019; Fri, 05 Mar 2021 12:16:15 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:14 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 43/52] libsupport: Add 64 bit time_t support for stat functions Date: Fri, 5 Mar 2021 17:15:09 -0300 Message-Id: <20210305201518.798584-44-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The patch adds redirections for xstat, xlstat, and xfstat when _TIME_BITS=64 is defined. --- support/Makefile | 3 +++ support/support-xfstat-time64.c | 32 ++++++++++++++++++++++++++++++++ support/support-xstat-time64.c | 32 ++++++++++++++++++++++++++++++++ support/xlstat-time64.c | 32 ++++++++++++++++++++++++++++++++ support/xunistd.h | 13 +++++++++++++ 5 files changed, 112 insertions(+) create mode 100644 support/support-xfstat-time64.c create mode 100644 support/support-xstat-time64.c create mode 100644 support/xlstat-time64.c diff --git a/support/Makefile b/support/Makefile index 846e0dbb26..6f696c70be 100644 --- a/support/Makefile +++ b/support/Makefile @@ -40,7 +40,9 @@ libsupport-routines = \ resolv_test \ set_fortify_handler \ support-xfstat \ + support-xfstat-time64 \ support-xstat \ + support-xstat-time64 \ support_become_root \ support_can_chroot \ support_capture_subprocess \ @@ -111,6 +113,7 @@ libsupport-routines = \ xlisten \ xlseek \ xlstat \ + xlstat-time64 \ xmalloc \ xmemstream \ xmkdir \ diff --git a/support/support-xfstat-time64.c b/support/support-xfstat-time64.c new file mode 100644 index 0000000000..324c5d20d2 --- /dev/null +++ b/support/support-xfstat-time64.c @@ -0,0 +1,32 @@ +/* 64-bit time_t stat with error checking. + Copyright (C) 2021 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 + . */ + +/* NB: Non-standard file name to avoid sysdeps override for xstat. */ + +#include +#include +#include + +#if __TIMESIZE != 64 +void +xfstat_time64 (int fd, struct __stat64_t64 *result) +{ + if (__fstat64_time64 (fd, result) != 0) + FAIL_EXIT1 ("__fstat64_time64 (%d): %m", fd); +} +#endif diff --git a/support/support-xstat-time64.c b/support/support-xstat-time64.c new file mode 100644 index 0000000000..7d0194b98a --- /dev/null +++ b/support/support-xstat-time64.c @@ -0,0 +1,32 @@ +/* 64-bit time_t stat with error checking. + Copyright (C) 2021 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 + . */ + +/* NB: Non-standard file name to avoid sysdeps override for xstat. */ + +#include +#include +#include + +#if __TIMESIZE != 64 +void +xstat_time64 (const char *path, struct __stat64_t64 *result) +{ + if (__stat64_time64 (path, result) != 0) + FAIL_EXIT1 ("__stat64_time64 (\"%s\"): %m", path); +} +#endif diff --git a/support/xlstat-time64.c b/support/xlstat-time64.c new file mode 100644 index 0000000000..ef4d922635 --- /dev/null +++ b/support/xlstat-time64.c @@ -0,0 +1,32 @@ +/* 64-bit time_t stat with error checking. + Copyright (C) 2021 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 + . */ + +/* NB: Non-standard file name to avoid sysdeps override for xstat. */ + +#include +#include +#include + +#if __TIMESIZE != 64 +void +xlstat_time64 (const char *path, struct __stat64_t64 *result) +{ + if (__lstat64_time64 (path, result) != 0) + FAIL_EXIT1 ("__lstat64_time64 (\"%s\"): %m", path); +} +#endif diff --git a/support/xunistd.h b/support/xunistd.h index c642588c29..e4ade65c85 100644 --- a/support/xunistd.h +++ b/support/xunistd.h @@ -24,6 +24,7 @@ #include #include +#include #include __BEGIN_DECLS @@ -35,9 +36,21 @@ pid_t xwaitpid (pid_t, int *status, int flags); void xpipe (int[2]); void xdup2 (int, int); int xopen (const char *path, int flags, mode_t); +#ifndef __USE_TIME_BITS64 +# ifdef __USE_FILE_OFFSET64 +void xstat (const char *path, struct stat *); +void xlstat (const char *path, struct stat *); +void xfstat (int fd, struct stat *); +# else void xstat (const char *path, struct stat64 *); void xlstat (const char *path, struct stat64 *); void xfstat (int fd, struct stat64 *); +# endif +#else +void __REDIRECT (xstat, (const char *path, struct stat *), xstat_time64); +void __REDIRECT (xlstat, (const char *path, struct stat *), xlstat_time64); +void __REDIRECT (xfstat, (int fd, struct stat *), xfstat_time64); +#endif void xmkdir (const char *path, mode_t); void xchroot (const char *path); void xunlink (const char *path); From patchwork Fri Mar 5 20:15:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 42327 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 5387D39A5C15; Fri, 5 Mar 2021 20:16:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5387D39A5C15 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975384; bh=zRhRYGuqFyDwM8NgTimOLK1hQr8xDvz3AgH8Uv0eW3U=; 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=UIPwtaHcC4eygqRwVNTn1WufKw0SQxbS/24758CM7QYSYdhgQrOPc3u1J6Yw34ZDK 8M3gHGSCwC1DrhSvDyxvYjRnIf2QmfFveQSIjoL0pGmV9yAWTjaa78AYFd+Ye/ml1J sx08+ciTQZzNEEmOM40XCe/m/b+uQerRH8gSA88c= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by sourceware.org (Postfix) with ESMTPS id BCF0F399F031 for ; Fri, 5 Mar 2021 20:16:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BCF0F399F031 Received: by mail-qk1-x72f.google.com with SMTP id z128so3240893qkc.12 for ; Fri, 05 Mar 2021 12:16:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zRhRYGuqFyDwM8NgTimOLK1hQr8xDvz3AgH8Uv0eW3U=; b=dn4i0PYPS0lgAqKnuz9/7pohUXL/jHeXDk6D6cNLmBTcB0mkZ6VpSNFyYoYqZluKCW MZydBD/L9nvMGtbISWFQz5+RGrDdv+xIMbBzifbVaDc9XnmAxMPurcSlJmhcNO+UjRbj Mcxn0uIB1y3aMvsJjsk/Ee/7XK67slq8rylDTdqtAAZS8XeFQ9X1sLVef8S/ytx3/VDM iKUvPBE1EuDvjtcAuTVEq4nFhY1YFNK4fwuz5ZjgqGxaliJalOxNzxRy0YSttZoHRAt8 96X6s52GbPWfJOJsLu6/b4/gNeBopWglIDlvg1w23LLVNZzWDwoT1KEp4byLUX8/X5sv kpvA== X-Gm-Message-State: AOAM533IwATxX3Yc6xBj9S/Eaw8ryIJkqLqJFvyethko7pKsbPAiy7YW rbCG+1u5iaZ60AF4WPphz3FKodGfuj99xw== X-Google-Smtp-Source: ABdhPJxk4wDAwoXCUjMt+L1m7WJ7WikBw2wEEHb2a1sRMuCwi1WxsHRNK5UKoOIxqvjqOYgVdjWONg== X-Received: by 2002:a05:620a:108f:: with SMTP id g15mr11059857qkk.298.1614975376360; Fri, 05 Mar 2021 12:16:16 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.16.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:16:16 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 44/52] y2038: Add test coverage Date: Fri, 5 Mar 2021 17:15:10 -0300 Message-Id: <20210305201518.798584-45-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It is enabled through a new rule, tests-y2038, which is built only when the ABI supports the comapt 64-bit time_t (defined by the header time64-compat.h, which also enables the creation of the symbol Version for Linux). It means the tests are not built for ABI which already provide default 64-bit time_t. The new rule already adds the required LFS and 64-bit time_t compiler flags. The current coverage is: * libc: - adjtime - adjtimex - clock_adjtime tst-clock_adjtime-time64 - clock_getres tst-clock-time64, tst-cpuclock1-time64 - clock_gettime tst-clock-time64, tst-clock2-time64, tst-cpuclock1-time64 - clock_nanoslee tst-clock_nanosleep-time64, tst-cpuclock1-time64 - clock_settime tst-clock2-time64 - ctime tst-ctime-time64 - ctime_r tst-ctime-time64 - difftime tst-difftime-time64 - fstat tst-stat-time64 - fstatat tst-stat-time64 - futimens tst-futimens-time64 - futimes tst-futimes-time64 - futimesat tst-futimesat-time64 - fts_* tst-fts-time64 - getitimer tst-itimer-timer64 - getrusage - gettimeofday tst-clock_nanosleep-time64 - glob / globfree tst-gnuglob64-time64 - gmtime tst-gmtime-time64 - gmtime_r tst-gmtime-time64 - lstat tst-stat-time64 - localtime tst-y2039-time64 - localtime_t tst-y2039-time64 - lutimes tst-lutimes-time64 - mktime tst-mktime4-time64 - mq_timedreceive tst-mqueue{1248}-time64 - mq_timedsend tst-mqueue{1248}-time64 - msgctl test-sysvmsg-time64 - nanosleep tst-cpuclock{12}-time64, tst-mqueue8-time64, tst-clock-time64 - nftw / ftw ftwtest-time64 - ntp_adjtime - ntp_gettime - ntp_gettimex - ppoll tst-ppoll-time64 - pselect tst-pselect-time64 - recvmmsg tst-cancel4_2-time64 - sched_rr_get_interval tst-sched_rr_get_interval-time64 - select - semctl test-sysvsem-time64 - semtimedop test-sysvsem-time64 - setitimer tst-mqueue2-time64, tst-itimer-timer64 - settimeofday - shmctl test-sysvshm-time64 - sigtimedwait - stat tst-stat-time64 - time tst-mqueue{1248}-time64 - timegm tst-timegm-time64 - timer_gettime tst-timer4-time64 - timer_settime tst-timer4-time64 - timerfd_gettime tst-timerfd-time64 - timerfd_settime tst-timerfd-time64 - timespec_get tst-timespec_get-time64 - utime tst-utime-time64 - utimensat tst-utimensat-time64 - utimes tst-utimes-time64 - wait3 tst-wait3-time64 - wait4 tst-wait4-time64 * libpthread: - cnd_timedwait tst-cnd-timedwait-time64 - mtx_timedlock tst-mtx-timedlock-time64 - pthread_clockjoin_np tst-join14-time64 - pthread_cond_clockwait tst-cond11-time64 - pthread_cond_timedwait tst-abstime-time64 - pthread_mutex_clocklock tst-abstime-time64 - pthread_mutex_timedlock tst-abstime-time64 - pthread_rwlock_clockrdlock tst-abstime-time64, tst-rwlock14-time64 - pthread_rwlock_clockwrlock tst-abstime-time64, tst-rwlock14-time64 - pthread_rwlock_timedrdlock tst-abstime-time64, tst-rwlock14-time64 - pthread_rwlock_timedwrlock tst-abstime-time64, tst-rwlock14-time64 - pthread_timedjoin_np tst-join14-time64 - sem_clockwait tst-sem5-time64 - sem_timedwait tst-sem5-time64 - thrd_sleep tst-thrd-sleep-time64 * librt: - aio_suspend tst-aio6-time64 - mq_timedreceive tst-mqueue{1248}-time64 - mq_timedsend tst-mqueue{1248}-time64 - timer_gettime tst-timer4-time64 - timer_settime tst-timer4-time64 * libanl: - gai_suspend Reviewed-by: Lukasz Majewski --- Makeconfig | 14 +++ Makerules | 18 +++- io/Makefile | 16 ++- io/ftwtest-time64.c | 1 + io/tst-fts-time64.c | 1 + io/tst-futimesat-time64.c | 4 + io/tst-futimesat.c | 47 +++++--- io/tst-stat-time64.c | 102 ++++++++++++++++++ io/tst-utimensat-time64.c | 2 + misc/Makefile | 2 + misc/tst-pselect-time64.c | 1 + nptl/Makefile | 3 + nptl/tst-cancel4_2-time64.c | 1 + posix/Makefile | 2 + posix/tst-gnuglob64-time64.c | 7 ++ posix/tst-sched_rr_get_interval-time64.c | 1 + posix/tst-wait3-time64.c | 1 + posix/tst-wait4-time64.c | 1 + rt/Makefile | 9 ++ rt/tst-aio6-time64.c | 1 + rt/tst-cpuclock2-time64.c | 1 + rt/tst-cpuclock2.c | 9 +- rt/tst-mqueue1-time64.c | 1 + rt/tst-mqueue2-time64.c | 1 + rt/tst-mqueue4-time64.c | 1 + rt/tst-mqueue8-time64.c | 1 + rt/tst-timer4-time64.c | 1 + sysdeps/pthread/Makefile | 10 ++ sysdeps/pthread/tst-abstime-time64.c | 1 + sysdeps/pthread/tst-cnd-timedwait-time64.c | 1 + sysdeps/pthread/tst-cond11-time64.c | 1 + sysdeps/pthread/tst-join14-time64.c | 1 + sysdeps/pthread/tst-mtx-timedlock-time64.c | 1 + sysdeps/pthread/tst-rwlock14-time64.c | 1 + sysdeps/pthread/tst-sem5-time64.c | 1 + sysdeps/pthread/tst-thrd-sleep-time64.c | 1 + sysdeps/unix/sysv/linux/Makefile | 8 ++ sysdeps/unix/sysv/linux/Versions | 4 +- sysdeps/unix/sysv/linux/tst-futimens-time64.c | 2 + sysdeps/unix/sysv/linux/tst-futimens.c | 8 +- sysdeps/unix/sysv/linux/tst-futimes-time64.c | 2 + sysdeps/unix/sysv/linux/tst-lutimes-time64.c | 2 + sysdeps/unix/sysv/linux/tst-ppoll-time64.c | 1 + sysdeps/unix/sysv/linux/tst-timerfd-time64.c | 1 + sysdeps/unix/sysv/linux/tst-utime-time64.c | 2 + sysdeps/unix/sysv/linux/tst-utime.c | 6 +- sysdeps/unix/sysv/linux/tst-utimes-time64.c | 2 + sysdeps/unix/sysv/linux/tst-utimes.c | 6 +- sysvipc/Makefile | 2 + sysvipc/test-sysvmsg-time64.c | 1 + sysvipc/test-sysvsem-time64.c | 1 + sysvipc/test-sysvshm-time64.c | 1 + time/Makefile | 15 +++ time/tst-adjtime-time64.c | 1 + time/tst-clock-time64.c | 1 + time/tst-clock2-time64.c | 1 + time/tst-clock_nanosleep-time64.c | 1 + time/tst-cpuclock1-time64.c | 1 + time/tst-ctime-time64.c | 1 + time/tst-ctime.c | 16 +++ time/tst-difftime-time64.c | 1 + time/tst-gmtime-time64.c | 1 + time/tst-itimer-time64.c | 1 + time/tst-mktime4-time64.c | 1 + time/tst-timegm-time64.c | 1 + time/tst-timespec_get-time64.c | 1 + time/tst-y2039-time64.c | 1 + time/tst-y2039.c | 10 ++ 68 files changed, 346 insertions(+), 24 deletions(-) create mode 100644 io/ftwtest-time64.c create mode 100644 io/tst-fts-time64.c create mode 100644 io/tst-futimesat-time64.c create mode 100644 io/tst-stat-time64.c create mode 100644 io/tst-utimensat-time64.c create mode 100644 misc/tst-pselect-time64.c create mode 100644 nptl/tst-cancel4_2-time64.c create mode 100644 posix/tst-gnuglob64-time64.c create mode 100644 posix/tst-sched_rr_get_interval-time64.c create mode 100644 posix/tst-wait3-time64.c create mode 100644 posix/tst-wait4-time64.c create mode 100644 rt/tst-aio6-time64.c create mode 100644 rt/tst-cpuclock2-time64.c create mode 100644 rt/tst-mqueue1-time64.c create mode 100644 rt/tst-mqueue2-time64.c create mode 100644 rt/tst-mqueue4-time64.c create mode 100644 rt/tst-mqueue8-time64.c create mode 100644 rt/tst-timer4-time64.c create mode 100644 sysdeps/pthread/tst-abstime-time64.c create mode 100644 sysdeps/pthread/tst-cnd-timedwait-time64.c create mode 100644 sysdeps/pthread/tst-cond11-time64.c create mode 100644 sysdeps/pthread/tst-join14-time64.c create mode 100644 sysdeps/pthread/tst-mtx-timedlock-time64.c create mode 100644 sysdeps/pthread/tst-rwlock14-time64.c create mode 100644 sysdeps/pthread/tst-sem5-time64.c create mode 100644 sysdeps/pthread/tst-thrd-sleep-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-futimens-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-futimes-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-lutimes-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-ppoll-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-timerfd-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-utime-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-utimes-time64.c create mode 100644 sysvipc/test-sysvmsg-time64.c create mode 100644 sysvipc/test-sysvsem-time64.c create mode 100644 sysvipc/test-sysvshm-time64.c create mode 100644 time/tst-adjtime-time64.c create mode 100644 time/tst-clock-time64.c create mode 100644 time/tst-clock2-time64.c create mode 100644 time/tst-clock_nanosleep-time64.c create mode 100644 time/tst-cpuclock1-time64.c create mode 100644 time/tst-ctime-time64.c create mode 100644 time/tst-difftime-time64.c create mode 100644 time/tst-gmtime-time64.c create mode 100644 time/tst-itimer-time64.c create mode 100644 time/tst-mktime4-time64.c create mode 100644 time/tst-timegm-time64.c create mode 100644 time/tst-timespec_get-time64.c create mode 100644 time/tst-y2039-time64.c diff --git a/Makeconfig b/Makeconfig index 0a4811b5e5..e12ee30eca 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1227,6 +1227,20 @@ $(common-objpfx)versions.stmp: $(common-objpfx)Versions.all \ touch $@ endif # avoid-generated endif # $(build-shared) = yes + +-include $(common-objpfx)time64-compat.mk +postclean-generated += time64-compat.mk + +$(common-objpfx)time64-compat.mk: $(sysd-versions-force) \ + $(common-objpfx)time64-compat.i + sed '/^[ ]*#/d;/^[ ]*$$/d' $< > $@T + mv -f $@T $@ +$(common-objpfx)time64-compat.i: $(..)Makeconfig + printf "#include \n#ifdef TIME64_NON_DEFAULT\nhave-time64-compat = yes\n#endif" \ + | $(CC) -E -undef $(CPPFLAGS) -x assembler-with-cpp - > $@T + mv -f $@T $@ + + endif # sysd-sorted-done # The name under which the run-time dynamic linker is installed. diff --git a/Makerules b/Makerules index fc5251ffad..f4f641bb26 100644 --- a/Makerules +++ b/Makerules @@ -771,7 +771,8 @@ endif $(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \ $(patsubst %.oS,%.d,$(filter %.oS,$(extra-objs))) \ $(patsubst %.o,%.d,$(filter %.o,$(extra-test-objs:.os=.o))) \ - $(addsuffix .d,$(tests) $(tests-internal) $(xtests) $(test-srcs)) + $(addsuffix .d,$(tests) $(tests-internal) $(xtests) \ + $(test-srcs) $(tests-time64) $(xtests-time64)) ifeq ($(build-programs),yes) +depfiles += $(addsuffix .d,$(others) $(sysdep-others)) endif @@ -1286,6 +1287,21 @@ check: tests .PHONY: xcheck xcheck: xtests +# Handle tests-time64 and xtests-time64 that should built with LFS +# and 64-bit time support. +include $(o-iterator) +define o-iterator-doit +$(foreach f,$(tests-time64) $(xtests-time64),\ + $(objpfx)$(f)$(o)): CFLAGS += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 +endef +object-suffixes-left := $(all-object-suffixes) +include $(o-iterator) + +ifeq ($(have-time64-compat),yes) +tests += $(foreach t,$(tests-time64),$(t)) +xtests += $(foreach t,$(xtests-time64),$(t)) +endif + # The only difference between MODULE_NAME=testsuite and MODULE_NAME=nonlib is # that almost all internal declarations from config.h, libc-symbols.h, and # include/*.h are not available to 'testsuite' code, but are to 'nonlib' code. diff --git a/io/Makefile b/io/Makefile index 6c637f7c6d..a39f0ecfc1 100644 --- a/io/Makefile +++ b/io/Makefile @@ -59,7 +59,7 @@ routines := \ ftw64-time64 others := pwd -test-srcs := ftwtest +test-srcs := ftwtest ftwtest-time64 tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 tst-statvfs \ tst-openat tst-unlinkat tst-fstatat tst-futimesat \ @@ -72,12 +72,18 @@ tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ tst-ftw-lnk tst-file_change_detection tst-lchmod \ tst-ftw-bz26353 tst-utimensat +tests-time64 := tst-fts-time64 \ + tst-stat-time64 \ + tst-futimesat-time64 \ + tst-utimensat-time64 + # Likewise for statx, but we do not need static linking here. tests-internal += tst-statx tests-static += tst-statx ifeq ($(run-built-tests),yes) -tests-special += $(objpfx)ftwtest.out +tests-special += $(objpfx)ftwtest.out \ + $(objpfx)ftwtest-time64.out endif include ../Rules @@ -118,8 +124,14 @@ tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp tst-open-tmpfile-ARGS = --test-dir=$(objpfx) +CFLAGS-ftwtest-time64.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 + ifeq ($(run-built-tests),yes) $(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \ $(evaluate-test) + +$(objpfx)ftwtest-time64.out: ftwtest-sh $(objpfx)ftwtest-time64 + $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \ + $(evaluate-test) endif diff --git a/io/ftwtest-time64.c b/io/ftwtest-time64.c new file mode 100644 index 0000000000..67f1c46826 --- /dev/null +++ b/io/ftwtest-time64.c @@ -0,0 +1 @@ +#include "ftwtest.c" diff --git a/io/tst-fts-time64.c b/io/tst-fts-time64.c new file mode 100644 index 0000000000..a4a41fe1cf --- /dev/null +++ b/io/tst-fts-time64.c @@ -0,0 +1 @@ +#include "tst-fts.c" diff --git a/io/tst-futimesat-time64.c b/io/tst-futimesat-time64.c new file mode 100644 index 0000000000..f6c0500eef --- /dev/null +++ b/io/tst-futimesat-time64.c @@ -0,0 +1,4 @@ +#define struct_stat struct stat +#define fstat fstat +#define fstatat fstatat +#include "io/tst-futimesat.c" diff --git a/io/tst-futimesat.c b/io/tst-futimesat.c index af58ad06dd..c32ab2b668 100644 --- a/io/tst-futimesat.c +++ b/io/tst-futimesat.c @@ -1,4 +1,23 @@ +/* futimesat basic tests. + Copyright (C) 2021 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 #include #include #include @@ -7,19 +26,19 @@ #include #include +#include +#include -static void prepare (void); -#define PREPARE(argc, argv) prepare () - -static int do_test (void); -#define TEST_FUNCTION do_test () - -#include "../test-skeleton.c" +#ifndef struct_stat +# define struct_stat struct stat64 +# define fstat fstat64 +# define fstatat fstatat64 +#endif static int dir_fd; static void -prepare (void) +prepare (int argc, char *argv[]) { size_t test_dir_len = strlen (test_dir); static const char dir_name[] = "/tst-futimesat.XXXXXX"; @@ -48,7 +67,7 @@ prepare (void) exit (1); } } - +#define PREPARE prepare static int do_test (void) @@ -98,8 +117,8 @@ do_test (void) write (fd, "hello", 5); puts ("file created"); - struct stat64 st1; - if (fstat64 (fd, &st1) != 0) + struct_stat st1; + if (fstat (fd, &st1) != 0) { puts ("fstat64 failed"); return 1; @@ -118,8 +137,8 @@ do_test (void) return 1; } - struct stat64 st2; - if (fstatat64 (dir_fd, "some-file", &st2, 0) != 0) + struct_stat st2; + if (fstatat (dir_fd, "some-file", &st2, 0) != 0) { puts ("fstatat64 failed"); return 1; @@ -146,3 +165,5 @@ do_test (void) return 0; } + +#include diff --git a/io/tst-stat-time64.c b/io/tst-stat-time64.c new file mode 100644 index 0000000000..c10fe1284a --- /dev/null +++ b/io/tst-stat-time64.c @@ -0,0 +1,102 @@ +/* Basic test of stat with 64 bit time_t interfaces. + Copyright (C) 2021 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 +#include +#include +#include +#include +#include +#include +#include +#include + +/* The idea of the test is check whether the 64 bit time_t stat implementation + returns the expected value for comparable fields, so it does not really + matter whether statx uses a fallback implementation or not. */ + +static void +stat_check (int fd, const char *path, struct stat *st) +{ + TEST_COMPARE (stat (path, st), 0); +} + +static void +lstat_check (int fd, const char *path, struct stat *st) +{ + TEST_COMPARE (lstat (path, st), 0); +} + +static void +fstat_check (int fd, const char *path, struct stat *st) +{ + TEST_COMPARE (fstat (fd, st), 0); +} + +static void +fstatat_check (int fd, const char *path, struct stat *st) +{ + TEST_COMPARE (fstatat (fd, path, st, 0), 0); +} + +typedef void (*test_t)(int, const char *path, struct stat *); + +static int +do_test (void) +{ + char *path; + int fd = create_temp_file ("tst-statx-", &path); + TEST_VERIFY_EXIT (fd >= 0); + support_write_file_string (path, "abc"); + + struct statx stx; + TEST_COMPARE (statx (fd, path, 0, STATX_BASIC_STATS, &stx), 0); + + for (test_t *test = (test_t[]) { stat_check, lstat_check, fstat_check, + fstatat_check, NULL }; + *test != NULL; test++) + { + struct stat st; + (*test) (fd, path, &st); + + TEST_COMPARE (stx.stx_dev_major, major (st.st_dev)); + TEST_COMPARE (stx.stx_dev_minor, minor (st.st_dev)); + TEST_COMPARE (stx.stx_ino, st.st_ino); + TEST_COMPARE (stx.stx_mode, st.st_mode); + TEST_COMPARE (stx.stx_nlink, st.st_nlink); + TEST_COMPARE (stx.stx_uid, st.st_uid); + TEST_COMPARE (stx.stx_gid, st.st_gid); + TEST_COMPARE (stx.stx_rdev_major, major (st.st_rdev)); + TEST_COMPARE (stx.stx_rdev_minor, minor (st.st_rdev)); + TEST_COMPARE (stx.stx_blksize, st.st_blksize); + TEST_COMPARE (stx.stx_blocks, st.st_blocks); + + TEST_COMPARE (stx.stx_ctime.tv_sec, st.st_ctim.tv_sec); + TEST_COMPARE (stx.stx_ctime.tv_nsec, st.st_ctim.tv_nsec); + TEST_COMPARE (stx.stx_mtime.tv_sec, st.st_mtim.tv_sec); + TEST_COMPARE (stx.stx_mtime.tv_nsec, st.st_mtim.tv_nsec); + } + + xclose (fd); + free (path); + + return 0; +} + +#include diff --git a/io/tst-utimensat-time64.c b/io/tst-utimensat-time64.c new file mode 100644 index 0000000000..7ac7d8df1d --- /dev/null +++ b/io/tst-utimensat-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-utimensat.c" diff --git a/misc/Makefile b/misc/Makefile index cfc15355d6..a8363d4b76 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -90,6 +90,8 @@ tests := tst-dirname tst-tsearch tst-fdset tst-mntent tst-hsearch \ tst-ldbl-warn tst-ldbl-error tst-dbl-efgcvt tst-ldbl-efgcvt \ tst-mntent-autofs tst-syscalls tst-mntent-escape +tests-time64 := tst-pselect-time64 + # Tests which need libdl. ifeq (yes,$(build-shared)) tests += tst-gethostid diff --git a/misc/tst-pselect-time64.c b/misc/tst-pselect-time64.c new file mode 100644 index 0000000000..15a1e49292 --- /dev/null +++ b/misc/tst-pselect-time64.c @@ -0,0 +1 @@ +#include "tst-pselect.c" diff --git a/nptl/Makefile b/nptl/Makefile index 33766eaf7a..d1c786e88b 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -380,6 +380,9 @@ xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \ tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 tst-setgroups \ tst-mutexpp5 tst-mutexpp9 +tests-time64 := \ + tst-cancel4_2-time64 + # This test can run into task limits because of a linux kernel bug # and then cause the make process to fail too, see bug 24537. xtests += tst-eintr1 diff --git a/nptl/tst-cancel4_2-time64.c b/nptl/tst-cancel4_2-time64.c new file mode 100644 index 0000000000..4ac086a312 --- /dev/null +++ b/nptl/tst-cancel4_2-time64.c @@ -0,0 +1 @@ +#include "tst-cancel4_2.c" diff --git a/posix/Makefile b/posix/Makefile index aba66efde8..e246ff1d14 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -109,7 +109,9 @@ tests-internal := bug-regex5 bug-regex20 bug-regex33 \ tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 \ tst-glob_lstat_compat tst-spawn4-compat tests-container := bug-ga2 +tests-time64 := tst-wait4-time64 tst-wait3-time64 tst-gnuglob64-time64 xtests := tst-getaddrinfo4 tst-getaddrinfo5 tst-sched_rr_get_interval +xtests-time64 := tst-sched_rr_get_interval-time64 ifeq (yes,$(build-shared)) test-srcs := globtest tests += wordexp-test tst-exec tst-spawn tst-spawn2 tst-spawn3 diff --git a/posix/tst-gnuglob64-time64.c b/posix/tst-gnuglob64-time64.c new file mode 100644 index 0000000000..00922bcdc6 --- /dev/null +++ b/posix/tst-gnuglob64-time64.c @@ -0,0 +1,7 @@ +#define GLOB_FUNC glob +#define GLOB_TYPE glob_t +#define GLOBFREE_FUNC globfree +#define DIRENT_STRUCT dirent +#define STAT_STRUCT stat + +#include "tst-gnuglob-skeleton.c" diff --git a/posix/tst-sched_rr_get_interval-time64.c b/posix/tst-sched_rr_get_interval-time64.c new file mode 100644 index 0000000000..f4e66d2939 --- /dev/null +++ b/posix/tst-sched_rr_get_interval-time64.c @@ -0,0 +1 @@ +#include "tst-sched_rr_get_interval.c" diff --git a/posix/tst-wait3-time64.c b/posix/tst-wait3-time64.c new file mode 100644 index 0000000000..2837bc7a9e --- /dev/null +++ b/posix/tst-wait3-time64.c @@ -0,0 +1 @@ +#include "tst-wait3.c" diff --git a/posix/tst-wait4-time64.c b/posix/tst-wait4-time64.c new file mode 100644 index 0000000000..12543b270f --- /dev/null +++ b/posix/tst-wait4-time64.c @@ -0,0 +1 @@ +#include "tst-wait4.c" diff --git a/rt/Makefile b/rt/Makefile index 7b374f2073..3ce98297f9 100644 --- a/rt/Makefile +++ b/rt/Makefile @@ -49,6 +49,15 @@ tests := tst-shm tst-timer tst-timer2 \ tst-shm-cancel tests-internal := tst-timer-sigmask +tests-time64 := \ + tst-aio6-time64 \ + tst-cpuclock2-time64 \ + tst-mqueue1-time64 \ + tst-mqueue2-time64 \ + tst-mqueue4-time64 \ + tst-mqueue8-time64 \ + tst-timer4-time64 + extra-libs := librt extra-libs-others := $(extra-libs) diff --git a/rt/tst-aio6-time64.c b/rt/tst-aio6-time64.c new file mode 100644 index 0000000000..a386a577ec --- /dev/null +++ b/rt/tst-aio6-time64.c @@ -0,0 +1 @@ +#include "tst-aio6.c" diff --git a/rt/tst-cpuclock2-time64.c b/rt/tst-cpuclock2-time64.c new file mode 100644 index 0000000000..05775522bb --- /dev/null +++ b/rt/tst-cpuclock2-time64.c @@ -0,0 +1 @@ +#include "tst-cpuclock2.c" diff --git a/rt/tst-cpuclock2.c b/rt/tst-cpuclock2.c index c1c7ed2ad8..eebc3609d0 100644 --- a/rt/tst-cpuclock2.c +++ b/rt/tst-cpuclock2.c @@ -21,7 +21,11 @@ #if (_POSIX_THREADS - 0) <= 0 -# define TEST_FUNCTION 0 +static int +do_test () +{ + return 0; +} #else @@ -330,7 +334,6 @@ do_test (void) return result; } -# define TEST_FUNCTION do_test () #endif -#include "../test-skeleton.c" +#include diff --git a/rt/tst-mqueue1-time64.c b/rt/tst-mqueue1-time64.c new file mode 100644 index 0000000000..9c600a9a97 --- /dev/null +++ b/rt/tst-mqueue1-time64.c @@ -0,0 +1 @@ +#include "tst-mqueue1.c" diff --git a/rt/tst-mqueue2-time64.c b/rt/tst-mqueue2-time64.c new file mode 100644 index 0000000000..9d49f0b196 --- /dev/null +++ b/rt/tst-mqueue2-time64.c @@ -0,0 +1 @@ +#include "tst-mqueue2.c" diff --git a/rt/tst-mqueue4-time64.c b/rt/tst-mqueue4-time64.c new file mode 100644 index 0000000000..c23a228dc4 --- /dev/null +++ b/rt/tst-mqueue4-time64.c @@ -0,0 +1 @@ +#include "tst-mqueue4.c" diff --git a/rt/tst-mqueue8-time64.c b/rt/tst-mqueue8-time64.c new file mode 100644 index 0000000000..972637f7f5 --- /dev/null +++ b/rt/tst-mqueue8-time64.c @@ -0,0 +1 @@ +#include "tst-mqueue8.c" diff --git a/rt/tst-timer4-time64.c b/rt/tst-timer4-time64.c new file mode 100644 index 0000000000..e47a593f10 --- /dev/null +++ b/rt/tst-timer4-time64.c @@ -0,0 +1 @@ +#include "tst-timer4.c" diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile index 53b65ef349..31df6f97e5 100644 --- a/sysdeps/pthread/Makefile +++ b/sysdeps/pthread/Makefile @@ -109,6 +109,16 @@ tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \ tst-unwind-thread \ tst-pt-vfork1 tst-pt-vfork2 tst-vfork1x tst-vfork2x \ +tests-time64 := \ + tst-abstime-time64 \ + tst-cnd-timedwait-time64 \ + tst-cond11-time64 \ + tst-join14-time64 \ + tst-mtx-timedlock-time64 \ + tst-rwlock14-time64 \ + tst-sem5-time64 \ + tst-thrd-sleep-time64 \ + # Files which must not be linked with libpthread. tests-nolibpthread = tst-unload diff --git a/sysdeps/pthread/tst-abstime-time64.c b/sysdeps/pthread/tst-abstime-time64.c new file mode 100644 index 0000000000..2fc77cb365 --- /dev/null +++ b/sysdeps/pthread/tst-abstime-time64.c @@ -0,0 +1 @@ +#include "tst-abstime.c" diff --git a/sysdeps/pthread/tst-cnd-timedwait-time64.c b/sysdeps/pthread/tst-cnd-timedwait-time64.c new file mode 100644 index 0000000000..9b2abfd277 --- /dev/null +++ b/sysdeps/pthread/tst-cnd-timedwait-time64.c @@ -0,0 +1 @@ +#include "tst-cnd-timedwait.c" diff --git a/sysdeps/pthread/tst-cond11-time64.c b/sysdeps/pthread/tst-cond11-time64.c new file mode 100644 index 0000000000..9bccb8ec8b --- /dev/null +++ b/sysdeps/pthread/tst-cond11-time64.c @@ -0,0 +1 @@ +#include "tst-cond11.c" diff --git a/sysdeps/pthread/tst-join14-time64.c b/sysdeps/pthread/tst-join14-time64.c new file mode 100644 index 0000000000..bed784ee24 --- /dev/null +++ b/sysdeps/pthread/tst-join14-time64.c @@ -0,0 +1 @@ +#include "tst-join14.c" diff --git a/sysdeps/pthread/tst-mtx-timedlock-time64.c b/sysdeps/pthread/tst-mtx-timedlock-time64.c new file mode 100644 index 0000000000..b3393c99ef --- /dev/null +++ b/sysdeps/pthread/tst-mtx-timedlock-time64.c @@ -0,0 +1 @@ +#include "tst-mtx-timedlock.c" diff --git a/sysdeps/pthread/tst-rwlock14-time64.c b/sysdeps/pthread/tst-rwlock14-time64.c new file mode 100644 index 0000000000..ae9b1912cf --- /dev/null +++ b/sysdeps/pthread/tst-rwlock14-time64.c @@ -0,0 +1 @@ +#include "tst-rwlock14.c" diff --git a/sysdeps/pthread/tst-sem5-time64.c b/sysdeps/pthread/tst-sem5-time64.c new file mode 100644 index 0000000000..89c2a14f94 --- /dev/null +++ b/sysdeps/pthread/tst-sem5-time64.c @@ -0,0 +1 @@ +#include "tst-sem5.c" diff --git a/sysdeps/pthread/tst-thrd-sleep-time64.c b/sysdeps/pthread/tst-thrd-sleep-time64.c new file mode 100644 index 0000000000..02837bd19f --- /dev/null +++ b/sysdeps/pthread/tst-thrd-sleep-time64.c @@ -0,0 +1 @@ +#include "tst-thrd-sleep.c" diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index fc2a17307c..94ee85d124 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -115,6 +115,14 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-futimes tst-lutimes tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc +tests-time64 += \ + tst-futimes-time64\ + tst-futimens-time64 \ + tst-lutimes-time64 \ + tst-ppoll-time64 \ + tst-utime-time64 \ + tst-utimes-time64 \ + tst-timerfd-time64 CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index b53391f613..982b94e625 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -237,7 +237,9 @@ libc { __timegm64; __timespec_get64; __utimensat64; - __utimes64; + __utimes64; + __localtime64; + __localtime64_r; # misc __ntp_gettime64; __ntp_gettimex64; diff --git a/sysdeps/unix/sysv/linux/tst-futimens-time64.c b/sysdeps/unix/sysv/linux/tst-futimens-time64.c new file mode 100644 index 0000000000..88fcb38489 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-futimens-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-futimens.c" diff --git a/sysdeps/unix/sysv/linux/tst-futimens.c b/sysdeps/unix/sysv/linux/tst-futimens.c index 8f48cfee63..b5b240abf1 100644 --- a/sysdeps/unix/sysv/linux/tst-futimens.c +++ b/sysdeps/unix/sysv/linux/tst-futimens.c @@ -24,10 +24,14 @@ #include #include +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + static int temp_fd = -1; /* struct timespec array with Y2038 threshold minus 2 and 1 seconds. */ -const struct timespec t1[2] = { { 0x7FFFFFFE, 0 }, { 0x7FFFFFFF, 0 } }; +const static struct timespec t1[2] = { { 0x7FFFFFFE, 0 }, { 0x7FFFFFFF, 0 } }; /* struct timespec array with Y2038 threshold plus 1 and 2 seconds. */ const struct timespec t2[2] = { { 0x80000001ULL, 0 }, { 0x80000002ULL, 0 } }; @@ -46,7 +50,7 @@ do_prepare (int argc, char *argv[]) static int test_futimens_helper (const struct timespec *ts) { - struct stat64 st; + struct_stat st; int result; time_t t; diff --git a/sysdeps/unix/sysv/linux/tst-futimes-time64.c b/sysdeps/unix/sysv/linux/tst-futimes-time64.c new file mode 100644 index 0000000000..d489c265d1 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-futimes-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-futimes.c" diff --git a/sysdeps/unix/sysv/linux/tst-lutimes-time64.c b/sysdeps/unix/sysv/linux/tst-lutimes-time64.c new file mode 100644 index 0000000000..06caec0a91 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-lutimes-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-lutimes.c" diff --git a/sysdeps/unix/sysv/linux/tst-ppoll-time64.c b/sysdeps/unix/sysv/linux/tst-ppoll-time64.c new file mode 100644 index 0000000000..96ee2faee3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-ppoll-time64.c @@ -0,0 +1 @@ +#include "tst-ppoll.c" diff --git a/sysdeps/unix/sysv/linux/tst-timerfd-time64.c b/sysdeps/unix/sysv/linux/tst-timerfd-time64.c new file mode 100644 index 0000000000..bb17f48139 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-timerfd-time64.c @@ -0,0 +1 @@ +#include "tst-timerfd.c" diff --git a/sysdeps/unix/sysv/linux/tst-utime-time64.c b/sysdeps/unix/sysv/linux/tst-utime-time64.c new file mode 100644 index 0000000000..eb62f59126 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-utime-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-utime.c" diff --git a/sysdeps/unix/sysv/linux/tst-utime.c b/sysdeps/unix/sysv/linux/tst-utime.c index 6735421657..d413f130e8 100644 --- a/sysdeps/unix/sysv/linux/tst-utime.c +++ b/sysdeps/unix/sysv/linux/tst-utime.c @@ -26,6 +26,10 @@ #include #include +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + static int temp_fd = -1; char *testfile; @@ -49,7 +53,7 @@ do_prepare (int argc, char *argv[]) static int test_utime_helper (const struct utimbuf *ut) { - struct stat64 st; + struct_stat st; int result; time_t t; diff --git a/sysdeps/unix/sysv/linux/tst-utimes-time64.c b/sysdeps/unix/sysv/linux/tst-utimes-time64.c new file mode 100644 index 0000000000..234ec02541 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-utimes-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-utimes.c" diff --git a/sysdeps/unix/sysv/linux/tst-utimes.c b/sysdeps/unix/sysv/linux/tst-utimes.c index 8c7b006a22..c521c89dfa 100644 --- a/sysdeps/unix/sysv/linux/tst-utimes.c +++ b/sysdeps/unix/sysv/linux/tst-utimes.c @@ -25,6 +25,10 @@ #include #include +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + static int temp_fd = -1; char *testfile; @@ -50,7 +54,7 @@ do_prepare (int argc, char *argv[]) static int test_utime_helper (const struct timeval *tv) { - struct stat64 st; + struct_stat st; int result; time_t t; diff --git a/sysvipc/Makefile b/sysvipc/Makefile index a534791928..86911803b5 100644 --- a/sysvipc/Makefile +++ b/sysvipc/Makefile @@ -32,6 +32,8 @@ routines := ftok \ tests := test-sysvmsg test-sysvsem test-sysvshm +tests-time64 := test-sysvmsg-time64 test-sysvsem-time64 test-sysvshm-time64 + include ../Rules CFLAGS-msgrcv.c += -fexceptions -fasynchronous-unwind-tables diff --git a/sysvipc/test-sysvmsg-time64.c b/sysvipc/test-sysvmsg-time64.c new file mode 100644 index 0000000000..c23e0c337e --- /dev/null +++ b/sysvipc/test-sysvmsg-time64.c @@ -0,0 +1 @@ +#include "test-sysvmsg.c" diff --git a/sysvipc/test-sysvsem-time64.c b/sysvipc/test-sysvsem-time64.c new file mode 100644 index 0000000000..05c95068cd --- /dev/null +++ b/sysvipc/test-sysvsem-time64.c @@ -0,0 +1 @@ +#include "test-sysvsem.c" diff --git a/sysvipc/test-sysvshm-time64.c b/sysvipc/test-sysvshm-time64.c new file mode 100644 index 0000000000..8e2963f563 --- /dev/null +++ b/sysvipc/test-sysvshm-time64.c @@ -0,0 +1 @@ +#include "test-sysvshm.c" diff --git a/time/Makefile b/time/Makefile index f14022b334..fee206d3c7 100644 --- a/time/Makefile +++ b/time/Makefile @@ -51,6 +51,21 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \ tst-adjtime tst-ctime tst-difftime tst-mktime4 tst-itimer \ tst-gmtime tst-timegm tst-timespec_get +tests-time64 := \ + tst-adjtime-time64 \ + tst-clock-time64 \ + tst-clock2-time64 \ + tst-clock_nanosleep-time64 \ + tst-cpuclock1-time64 \ + tst-ctime-time64 \ + tst-difftime-time64 \ + tst-gmtime-time64 \ + tst-itimer-time64 \ + tst-mktime4-time64 \ + tst-timegm-time64 \ + tst-timespec_get-time64 \ + tst-y2039-time64 + include ../Rules ifeq ($(run-built-tests),yes) diff --git a/time/tst-adjtime-time64.c b/time/tst-adjtime-time64.c new file mode 100644 index 0000000000..097d6efc4b --- /dev/null +++ b/time/tst-adjtime-time64.c @@ -0,0 +1 @@ +#include diff --git a/time/tst-clock-time64.c b/time/tst-clock-time64.c new file mode 100644 index 0000000000..a1349678c8 --- /dev/null +++ b/time/tst-clock-time64.c @@ -0,0 +1 @@ +#include "tst-clock.c" diff --git a/time/tst-clock2-time64.c b/time/tst-clock2-time64.c new file mode 100644 index 0000000000..897f47b287 --- /dev/null +++ b/time/tst-clock2-time64.c @@ -0,0 +1 @@ +#include "tst-clock2.c" diff --git a/time/tst-clock_nanosleep-time64.c b/time/tst-clock_nanosleep-time64.c new file mode 100644 index 0000000000..c8638aa3d2 --- /dev/null +++ b/time/tst-clock_nanosleep-time64.c @@ -0,0 +1 @@ +#include "tst-clock_nanosleep.c" diff --git a/time/tst-cpuclock1-time64.c b/time/tst-cpuclock1-time64.c new file mode 100644 index 0000000000..5a7ffa27ac --- /dev/null +++ b/time/tst-cpuclock1-time64.c @@ -0,0 +1 @@ +#include "tst-cpuclock1.c" diff --git a/time/tst-ctime-time64.c b/time/tst-ctime-time64.c new file mode 100644 index 0000000000..24a5ae98ed --- /dev/null +++ b/time/tst-ctime-time64.c @@ -0,0 +1 @@ +#include "tst-ctime.c" diff --git a/time/tst-ctime.c b/time/tst-ctime.c index e89a906bf8..884d69bfa0 100644 --- a/time/tst-ctime.c +++ b/time/tst-ctime.c @@ -24,6 +24,7 @@ static int do_test (void) { char *str; + char strb[32]; time_t t; /* Use glibc time zone extension "TZ=:" to to guarantee that UTC @@ -36,11 +37,21 @@ do_test (void) str = ctime (&t); TEST_COMPARE_STRING (str, "Thu Jan 1 00:00:00 1970\n"); + /* Same as before but with ctime_r. */ + str = ctime_r (&t, strb); + TEST_VERIFY (str == strb); + TEST_COMPARE_STRING (str, "Thu Jan 1 00:00:00 1970\n"); + /* Check if the max time value for 32 bit time_t can be converted. */ t = 0x7fffffff; str = ctime (&t); TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n"); + /* Same as before but with ctime_r. */ + str = ctime_r (&t, strb); + TEST_VERIFY (str == strb); + TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n"); + /* Check if we run on port with 32 bit time_t size */ time_t tov; if (__builtin_add_overflow (t, 1, &tov)) @@ -50,6 +61,11 @@ do_test (void) str = ctime (&tov); TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n"); + /* Same as before but with ctime_r. */ + str = ctime_r (&tov, strb); + TEST_VERIFY (str == strb); + TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n"); + return 0; } diff --git a/time/tst-difftime-time64.c b/time/tst-difftime-time64.c new file mode 100644 index 0000000000..751ce6c483 --- /dev/null +++ b/time/tst-difftime-time64.c @@ -0,0 +1 @@ +#include "tst-difftime.c" diff --git a/time/tst-gmtime-time64.c b/time/tst-gmtime-time64.c new file mode 100644 index 0000000000..0df11c1913 --- /dev/null +++ b/time/tst-gmtime-time64.c @@ -0,0 +1 @@ +#include "tst-gmtime.c" diff --git a/time/tst-itimer-time64.c b/time/tst-itimer-time64.c new file mode 100644 index 0000000000..ddd2efa175 --- /dev/null +++ b/time/tst-itimer-time64.c @@ -0,0 +1 @@ +#include