From patchwork Tue Mar 23 13:44:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42744 X-Patchwork-Delegate: siddhesh@gotplt.org 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 65AE4385701F; Tue, 23 Mar 2021 13:45:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 65AE4385701F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507106; bh=iITdU5UJRcnj5UaGXfm1d09K085aRP4WTU9wcTQvjpo=; 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=iTQ7dtbw0WSMqXk+jAgR7vZlxwi+kzRlqOiAfsgrNoJlyMQMg3tpB4N1oRYKymaBA nQNr7VXQxWGlI4AEcq0sT/GUnqLW3rfQaRMiMe23GwvNNCShEQZnAXcgcBInIyKZCc Z1u6uV2N1ZcWb6xEvVad/40teiBmkLw0xxa+xlyY= 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 ECB18385BF9E for ; Tue, 23 Mar 2021 13:45:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ECB18385BF9E Received: by mail-qt1-x834.google.com with SMTP id g24so14880922qts.6 for ; Tue, 23 Mar 2021 06:45:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iITdU5UJRcnj5UaGXfm1d09K085aRP4WTU9wcTQvjpo=; b=McWbrGRKty0lIxteaVeXbk/bDOMWLpwx4aB+RkwKf5fMk4ZG5uGO7seRZe9+3Vkw8h DCBIqzphE5XiXnw/lCIfwTePGJp8jDKS1POOdeenEUhSYqJpMVTZRw8kh1jXYq/o8F/s veL0eUIbjJ+ur8DvjukTzgJ+uBxYQgZ9veY5r8HaH5BDmMGfLUV3lRKJD2x52XaYi8nE yy7ILPiPb6c/IPXMqFK7th8IU2gkYUcMFLUpiaqroNjg27c3LoJJ+fc3Qqwv297yT+hr HfVzlhyESaSKXDeG840diV//xIBfDbZnRHIB8G2ad1yK1cc9Wd/ySleNhl/tU+UgkvUy jqJw== X-Gm-Message-State: AOAM5339KouFBFMYffkBsG9bqPSas6xx6fSqsEj9pohkuTR2++0KFsN0 t/rgM+nuQ/FfHaoJ1mF+lakjTDBja2aR0g== X-Google-Smtp-Source: ABdhPJxW6YytukCVg3u6udgMnI0+lJvOCm+Bqa2fiHnkIzoHfspiIWonuRLtbNLPusuazn9dIA6IWw== X-Received: by 2002:ac8:4a18:: with SMTP id x24mr4328611qtq.33.1616507103384; Tue, 23 Mar 2021 06:45:03 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:03 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 01/15] io: Move file timestamps tests out of Linux Date: Tue, 23 Mar 2021 10:44:44 -0300 Message-Id: <20210323134458.2563022-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Now that libsupport abstract Linux possible missing support (either due FS limitation that can't handle 64 bit timestamp or architectures that do not handle values larger than unsigned 32 bit values) the tests can be turned generic. Checked on x86_64-linux-gnu and i686-linux-gnu. I also built the tests for i686-gnu. Reviewed-by: Siddhesh Poyarekar --- io/Makefile | 5 ++++- {sysdeps/unix/sysv/linux => io}/tst-futimens.c | 0 {sysdeps/unix/sysv/linux => io}/tst-utime.c | 0 {sysdeps/unix/sysv/linux => io}/tst-utimensat-skeleton.c | 0 {sysdeps/unix/sysv/linux => io}/tst-utimes.c | 0 sysdeps/unix/sysv/linux/Makefile | 2 +- 6 files changed, 5 insertions(+), 2 deletions(-) rename {sysdeps/unix/sysv/linux => io}/tst-futimens.c (100%) rename {sysdeps/unix/sysv/linux => io}/tst-utime.c (100%) rename {sysdeps/unix/sysv/linux => io}/tst-utimensat-skeleton.c (100%) rename {sysdeps/unix/sysv/linux => io}/tst-utimes.c (100%) diff --git a/io/Makefile b/io/Makefile index c9919d666f..3411573cf3 100644 --- a/io/Makefile +++ b/io/Makefile @@ -68,7 +68,10 @@ 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-stat tst-stat-lfs + tst-ftw-bz26353 tst-stat tst-stat-lfs \ + tst-utime \ + tst-utimes \ + tst-futimens \ # Likewise for statx, but we do not need static linking here. tests-internal += tst-statx diff --git a/sysdeps/unix/sysv/linux/tst-futimens.c b/io/tst-futimens.c similarity index 100% rename from sysdeps/unix/sysv/linux/tst-futimens.c rename to io/tst-futimens.c diff --git a/sysdeps/unix/sysv/linux/tst-utime.c b/io/tst-utime.c similarity index 100% rename from sysdeps/unix/sysv/linux/tst-utime.c rename to io/tst-utime.c diff --git a/sysdeps/unix/sysv/linux/tst-utimensat-skeleton.c b/io/tst-utimensat-skeleton.c similarity index 100% rename from sysdeps/unix/sysv/linux/tst-utimensat-skeleton.c rename to io/tst-utimensat-skeleton.c diff --git a/sysdeps/unix/sysv/linux/tst-utimes.c b/io/tst-utimes.c similarity index 100% rename from sysdeps/unix/sysv/linux/tst-utimes.c rename to io/tst-utimes.c diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index e42bc7f13b..aa1e4e991e 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -107,7 +107,7 @@ 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-clock_adjtime tst-adjtimex tst-ntp_adjtime # Test for the symbol version of fcntl that was replaced in glibc 2.28. From patchwork Tue Mar 23 13:44:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42745 X-Patchwork-Delegate: siddhesh@gotplt.org 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 60B173861037; Tue, 23 Mar 2021 13:45:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60B173861037 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507108; bh=OAROPPqUNinN9h0dI6i9cXQSu2l/+M7c7VaQpBW4n5k=; 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=NxHi74aazOu4qcxwKmDFc2hxiSHXMUDkzLoF7qgQZX5fisBFWDmXtv0gY4RxhrKPj fzu8liJ1Zm/wfNAGAHtrLM3QXTyFeSV8cZEJoEdO75aYj6WCRJoX/NVWMI5HXUMCMX /8ZOkPssR64QENpLxcBcMm7KyTpaP/nOKoJGV/Vo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by sourceware.org (Postfix) with ESMTPS id 12107385701F for ; Tue, 23 Mar 2021 13:45:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 12107385701F Received: by mail-qv1-xf2a.google.com with SMTP id d10so10459246qve.7 for ; Tue, 23 Mar 2021 06:45:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OAROPPqUNinN9h0dI6i9cXQSu2l/+M7c7VaQpBW4n5k=; b=mL+HNMjMaSroGifywPxIyFFgBkrFA9MrEkdJo6cNf3QnK6UzecsPaa46ISRKWVuxv9 Xokblie0eKWFJvQhuYqLHXfHlHjzpytCa1PRNoIqoT3O8HM2kg03VmtO//OP04QjtPU2 +nW03pw0Y13EssTWeHUAb3lZMES/ylVeKN4n2bmbGZOnHhZCSTWyPXM5HjC2+1kD5aSA FRZpxpwdj18IkO0I+GbFIRDMmJMRo5h0rIUdS6kbW2V0361LKmMJBuWijyTNC0pJSTix RVG7SnwIaa6tzr6DCreiP1q/hoTEz8Hnjypyj5SkXm1bDfb5oqIcHzcAOc6vNPBfBoD/ KzQw== X-Gm-Message-State: AOAM532YNW+KP6mYKBPTIdjY51hiOvU+PXCnnmKhhbxqVb9S3R70gVjm Te4ksguoIgKLb+K7i73WJ4b9qSMxrqgg+A== X-Google-Smtp-Source: ABdhPJxfW5B0IUhClrKSgLfZvMbFlHnQWuwTEc/JZ/mJwCBoGVXN+PROrTSylAmFfhWTcFCr897uxg== X-Received: by 2002:a0c:a99a:: with SMTP id a26mr4892208qvb.2.1616507104492; Tue, 23 Mar 2021 06:45:04 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:04 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 02/15] linux: Add futimes test Date: Tue, 23 Mar 2021 10:44:45 -0300 Message-Id: <20210323134458.2563022-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 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 Netto 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 x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Siddhesh Poyarekar --- io/Makefile | 1 + io/tst-futimes.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 io/tst-futimes.c diff --git a/io/Makefile b/io/Makefile index 3411573cf3..0002e108a6 100644 --- a/io/Makefile +++ b/io/Makefile @@ -71,6 +71,7 @@ tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ tst-ftw-bz26353 tst-stat tst-stat-lfs \ tst-utime \ tst-utimes \ + tst-futimes \ tst-futimens \ # Likewise for statx, but we do not need static linking here. diff --git a/io/tst-futimes.c b/io/tst-futimes.c new file mode 100644 index 0000000000..ea7ac7d5f8 --- /dev/null +++ b/io/tst-futimes.c @@ -0,0 +1,46 @@ +/* Test for futimes. + 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 + +static int +test_futimens_helper (const char *file, int fd, const struct timeval *tv) +{ + int r = futimes (fd, tv); + TEST_VERIFY_EXIT (r == 0); + + struct stat64 st; + xfstat (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; +} + +#define TEST_CALL(fname, fd, v1, v2) \ + test_futimens_helper (fname, fd, (struct timeval[]) { { v1, 0 }, \ + { v2, 0 } }) + +#include "tst-utimensat-skeleton.c" From patchwork Tue Mar 23 13:44:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42746 X-Patchwork-Delegate: siddhesh@gotplt.org 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 E51C4386103F; Tue, 23 Mar 2021 13:45:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E51C4386103F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507110; bh=ld42uF0BKX/CGdowJNRv5/+bAidDG2eTv2JsaCiKlIk=; 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=Iepmqdqtu5V7O5fiGsavJNgX4T4txBxiCVJrQKwf0Qi19JQQjK/kVhcjufTYbF381 ZWlmfI8IgGbnQulhCwC9ekV9OvFM+YbBwaML7Te7A0mSZD44VJIFhendk/IVotouyZ eQhVkCRmfxyK9gcLMYKC43LlvV3WkFOfX+ZTRc7E= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id 479653861027 for ; Tue, 23 Mar 2021 13:45:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 479653861027 Received: by mail-qk1-x730.google.com with SMTP id i9so14295985qka.2 for ; Tue, 23 Mar 2021 06:45:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ld42uF0BKX/CGdowJNRv5/+bAidDG2eTv2JsaCiKlIk=; b=ahBELKbF8qZ2vKaRQvYpJFwVGCgtaXrEuvzexSMBoZXlyhuhKxJ/CMfr6XRDXQBF3K QHrvu6meEcGTDyS1ssS9gPt3bQV2blpMxAN479DwxhpjU4HTnU1xzzze690eF4sN9a4t zAG2iwNqRDSqo5hbgxEhMZuoAc9Vs9EOJvjM4+nJPqlyA8J8bWCmAgw4M6tCrakvoIv9 t7M1qcR5rliPXN0M8H+3J2cJt3IRLvcjp3unAMwGZqBZ6OvcSjk3s3UY6d1TIBdCFU39 cEqZK+p/WoIU3FZeWT3mdMn7wBnhy9gtRzz/JinhZhjwOI+yDR9E09li86WgEPD4Qhgo OZgw== X-Gm-Message-State: AOAM531M4scxAJcxPTC7DI9B9gmdt/O+yz7NTHCuIjTXcrMpqDQUVl/i A//Htcepmr9JFNDKlNLs3RiNysJEku7J2Q== X-Google-Smtp-Source: ABdhPJxq4+q7/bY3cjNZf4BHr9YtFEpxxpi6AI+QYSvqiDuL3b5U2lDkY6BLwUL8xkTAABeWzAEI5w== X-Received: by 2002:a05:620a:a92:: with SMTP id v18mr5441831qkg.417.1616507105596; Tue, 23 Mar 2021 06:45:05 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:05 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 03/15] linux: Add lutimes test Date: Tue, 23 Mar 2021 10:44:46 -0300 Message-Id: <20210323134458.2563022-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.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 Netto 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 x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Siddhesh Poyarekar --- io/Makefile | 1 + io/tst-futimens.c | 2 +- io/tst-futimes.c | 2 +- io/tst-lutimes.c | 53 +++++++++++++++++++++++++++++++++++++ io/tst-utime.c | 2 +- io/tst-utimensat-skeleton.c | 7 ++++- io/tst-utimes.c | 2 +- 7 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 io/tst-lutimes.c diff --git a/io/Makefile b/io/Makefile index 0002e108a6..bec0e5871e 100644 --- a/io/Makefile +++ b/io/Makefile @@ -72,6 +72,7 @@ tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ tst-utime \ tst-utimes \ tst-futimes \ + tst-lutimes \ tst-futimens \ # Likewise for statx, but we do not need static linking here. diff --git a/io/tst-futimens.c b/io/tst-futimens.c index ac7a980017..b3e3f3137f 100644 --- a/io/tst-futimens.c +++ b/io/tst-futimens.c @@ -38,7 +38,7 @@ test_futimens_helper (const char *file, int fd, const struct timespec *ts) return 0; } -#define TEST_CALL(fname, fd, v1, v2) \ +#define TEST_CALL(fname, fd, lname, v1, v2) \ test_futimens_helper (fname, fd, (struct timespec[]) { { v1, 0 }, \ { v2, 0 } }) diff --git a/io/tst-futimes.c b/io/tst-futimes.c index ea7ac7d5f8..bdef38d7cb 100644 --- a/io/tst-futimes.c +++ b/io/tst-futimes.c @@ -39,7 +39,7 @@ test_futimens_helper (const char *file, int fd, const struct timeval *tv) return 0; } -#define TEST_CALL(fname, fd, v1, v2) \ +#define TEST_CALL(fname, fd, lname, v1, v2) \ test_futimens_helper (fname, fd, (struct timeval[]) { { v1, 0 }, \ { v2, 0 } }) diff --git a/io/tst-lutimes.c b/io/tst-lutimes.c new file mode 100644 index 0000000000..b2da3c5796 --- /dev/null +++ b/io/tst-lutimes.c @@ -0,0 +1,53 @@ +/* Test for lutimes. + 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 + +static int +test_lutimes_helper (const char *testfile, int fd, const char *testlink, + const struct timeval *tv) +{ + struct stat64 stfile_orig; + xlstat (testfile, &stfile_orig); + + TEST_VERIFY_EXIT (lutimes (testlink, tv) == 0); + + struct stat64 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 stat64 stfile; + xlstat (testfile, &stfile); + + TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime); + TEST_COMPARE (stfile_orig.st_mtime, stfile.st_mtime); + + return 0; +} + +#define TEST_CALL(fname, fd, lname, v1, v2) \ + test_lutimes_helper (fname, fd, lname, (struct timeval[]) { { v1, 0 }, \ + { v2, 0 } }) + +#include "tst-utimensat-skeleton.c" diff --git a/io/tst-utime.c b/io/tst-utime.c index c1c7e75a29..6269ef7929 100644 --- a/io/tst-utime.c +++ b/io/tst-utime.c @@ -39,7 +39,7 @@ test_utime_helper (const char *file, int fd, const struct utimbuf *ut) return 0; } -#define TEST_CALL(fname, fd, v1, v2) \ +#define TEST_CALL(fname, fd, lname, v1, v2) \ test_utime_helper (fname, fd, &(struct utimbuf) { (v1), (v2) }) #include "tst-utimensat-skeleton.c" diff --git a/io/tst-utimensat-skeleton.c b/io/tst-utimensat-skeleton.c index 3589146db5..ad9f6763c5 100644 --- a/io/tst-utimensat-skeleton.c +++ b/io/tst-utimensat-skeleton.c @@ -24,6 +24,7 @@ static int temp_fd = -1; static char *testfile; +static char *testlink; const static struct { int64_t v1; @@ -49,6 +50,10 @@ do_prepare (int argc, char *argv[]) { temp_fd = create_temp_file ("utime", &testfile); TEST_VERIFY_EXIT (temp_fd > 0); + + testlink = xasprintf ("%s-symlink", testfile); + xsymlink (testfile, testlink); + add_temp_file (testlink); } static int @@ -82,7 +87,7 @@ do_test (void) continue; } - TEST_CALL (testfile, temp_fd, tests[i].v1, tests[i].v2); + TEST_CALL (testfile, temp_fd, testlink, tests[i].v1, tests[i].v2); } return 0; diff --git a/io/tst-utimes.c b/io/tst-utimes.c index ba710508b7..991ab0c7d3 100644 --- a/io/tst-utimes.c +++ b/io/tst-utimes.c @@ -40,7 +40,7 @@ test_utimes_helper (const char *file, int fd, const struct timeval *tv) return 0; } -#define TEST_CALL(fname, fd, v1, v2) \ +#define TEST_CALL(fname, fd, lname, v1, v2) \ test_utimes_helper (fname, fd, (struct timeval[]) { { v1, 0 }, \ { v2, 0 } }) From patchwork Tue Mar 23 13:44:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42747 X-Patchwork-Delegate: siddhesh@gotplt.org 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 718C43850407; Tue, 23 Mar 2021 13:45:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 718C43850407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507110; bh=NxWuTzn8c4K4l6JQ25N9zvySgYS/5U28JtueM2AkQyo=; 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=je9Eg4YYS8q4P84u/FA2MCjbcO3FuPYDlD7H3c2ewmtaKdNko9Luns89DkrLe+JyG oXues/hXz3BCPjCUUExRoi8VVxlD47LkWWqAKrnptikIRr0u+9dUD9Es/0QHeuheZH N9TWIP3/6GZ3ChRecKx7G4krLkZq0r6QrRdUaqYo= 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 7C2BE3860C2E for ; Tue, 23 Mar 2021 13:45:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7C2BE3860C2E Received: by mail-qk1-x731.google.com with SMTP id q3so14313688qkq.12 for ; Tue, 23 Mar 2021 06:45:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NxWuTzn8c4K4l6JQ25N9zvySgYS/5U28JtueM2AkQyo=; b=tIUNYu8EgobD9MKpU9qHrJS3s3AcJtJzRQ61iliHRwEIbAdbn9oFLhgXFdUbtnrafq ajupkNvulv6VIopCXH1JhEg3BB85hk1aO0U9VNfVWN3l/MINEjZngegHx4ZYXrANC85a aK1WAvBkkJNQ9YwcVv8P+6EDtiszsQtooacvRK9U6/CnKmc2X6D7CmALdRfHpqfhR9a8 Y+e2nx6O6l1bLZ7avr1zp3FpT0NodDGohOn6ztYkWhqJEB4vdH9kDFoFW3apIbQFiktl VuIxjG8sPWzpyJn/VPCC0a6U4UcjTO+TONHyzOk/gGa0GntPX3L4+BtWxS4CJYKkI73/ tOAg== X-Gm-Message-State: AOAM532RvWztfngFlKiCisKc3WNCsQNA5m42wsa2H69AdijYo2Ec0q71 JgAnxuKye3nb2n56vDozNESGesZD57dgmw== X-Google-Smtp-Source: ABdhPJy4qETovLoRZsB71jxbeBmAyzdCa8qDcaxKk4e2c5r/vOyWLxwyiFPxTg+lk4pP83+hJcLfcA== X-Received: by 2002:a37:4396:: with SMTP id q144mr5135159qka.441.1616507106752; Tue, 23 Mar 2021 06:45:06 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:06 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 04/15] io: Add basic tests for utimensat Date: Tue, 23 Mar 2021 10:44:47 -0300 Message-Id: <20210323134458.2563022-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on x86_64-linux-gnu and i686-linux-gnu Reviewed-by: Siddhesh Poyarekar --- io/Makefile | 1 + io/tst-utimensat.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 io/tst-utimensat.c diff --git a/io/Makefile b/io/Makefile index bec0e5871e..0903804dfd 100644 --- a/io/Makefile +++ b/io/Makefile @@ -74,6 +74,7 @@ tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ tst-futimes \ tst-lutimes \ tst-futimens \ + 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..0c7c8470bc --- /dev/null +++ b/io/tst-utimensat.c @@ -0,0 +1,70 @@ +/* Test for utimensat. + 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 + +static int +test_utimesat_helper (const char *testfile, int fd, const char *testlink, + const struct timespec *ts) +{ + { + TEST_VERIFY_EXIT (utimensat (fd, testfile, ts, 0) == 0); + + struct stat64 st; + xfstat (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 stat64 stfile_orig; + xlstat (testfile, &stfile_orig); + + TEST_VERIFY_EXIT (utimensat (0 /* ignored */, testlink, ts, + AT_SYMLINK_NOFOLLOW) + == 0); + struct stat64 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 stat64 stfile; + xlstat (testfile, &stfile); + + TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime); + TEST_COMPARE (stfile_orig.st_mtime, stfile.st_mtime); + } + + return 0; +} + +#define TEST_CALL(fname, fd, lname, v1, v2) \ + test_utimesat_helper (fname, fd, lname, (struct timespec[]) { { v1, 0 }, \ + { v2, 0 } }) + +#include "tst-utimensat-skeleton.c" From patchwork Tue Mar 23 13:44:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42749 X-Patchwork-Delegate: siddhesh@gotplt.org 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 8F0D8385040C; Tue, 23 Mar 2021 13:45:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F0D8385040C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507113; bh=m8mljX+xYxvgqJIaJIzJ4Nhqd3AZ5psW7g+Dfrxtcgk=; 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=g6YcJGljtSZ5Nb9sxcdDbU3TJ0s6fSSJ5UMpMKyhZMavWBT1zevHQZCkqmz8BIoss aeps8mNp7/idiIHUv+BeZDZde9xpVTLpB7o4kFr8WAyybsEBrl0dSGZvGKKyh8v5La JBOpubHAc/HZ/5ogrNC2WYMJn9cLb57oDTWuHVMo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by sourceware.org (Postfix) with ESMTPS id 085C8386103E for ; Tue, 23 Mar 2021 13:45:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 085C8386103E Received: by mail-qk1-x732.google.com with SMTP id c3so14314057qkc.5 for ; Tue, 23 Mar 2021 06:45:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m8mljX+xYxvgqJIaJIzJ4Nhqd3AZ5psW7g+Dfrxtcgk=; b=fyRq6Dvor+M/34t54HeAWDRbt0L8KCL5qoSC1mv9RCdVCW7pCsRsTH5QyLV2pzW5Ki fCsHBZcZKV6se/tWGkxXWphqD0AcxPKQJrjYygl/ej5TCbsf9NXT6RlmeGXjzbkLMU7y nViOLqVFkpG6MwqyE9JAvlBC/JzFys70sZgY6UGRRihQNLiHnsrO+mEABuQWFrs8cdbx jUTv9UpC6h0rbudhxhRE66VxcccjfJ8L1DHiaBm9GPbAbRzjcwN2QamowdQLYHC1OW+F qGTxfyYyUNaqHi3OauIYTDZfxVvXZt3Tchm9M3cNaUPMNMzhOoy1KJwBBcaC54CR7ZYW XCQQ== X-Gm-Message-State: AOAM5319chjRi6oEliVdknFatcPGLDfGFalX4g7mitvZ5/LDzrJLuAxM mymHZeJWPL3dYOLs27LX5atmMzv78aiwnA== X-Google-Smtp-Source: ABdhPJxMr/ct/38/kSAv8gGFJLShfN52pVH+0kk6db/of+cF6v3mDHXGNwAHXipKprVF2EVx2K4Fyg== X-Received: by 2002:a05:620a:16d4:: with SMTP id a20mr5442512qkn.410.1616507108076; Tue, 23 Mar 2021 06:45:08 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:07 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 05/15] io: Use temporary directory and file for ftwtest-sh Date: Tue, 23 Mar 2021 10:44:48 -0300 Message-Id: <20210323134458.2563022-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Instead of creating files on glibc source dir. It also allows run in parallel. Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar --- io/ftwtest-sh | 242 +++++++++++++++++++++++++------------------------- 1 file changed, 119 insertions(+), 123 deletions(-) diff --git a/io/ftwtest-sh b/io/ftwtest-sh index a9ae33ff30..b0d1389a73 100644 --- a/io/ftwtest-sh +++ b/io/ftwtest-sh @@ -43,15 +43,11 @@ export LC_ALL # First create our scenario: tmp=${objpfx}io -tmpdir=$tmp/ftwtest.d +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 -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: 42748 X-Patchwork-Delegate: siddhesh@gotplt.org 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 0C7D33850405; Tue, 23 Mar 2021 13:45:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C7D33850405 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507113; bh=OY9WMHeQzpfDUfyJkl/M9wzlkaSNBo6bfed6b1VMAdI=; 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=c5uHNs6sdEUpvx28lrqlojf2Wtqxe2Ny8pQHf+RyUC8qvlD4VOWk8poHh15gni+5R SmYU8ykayTP98Z3D23ir7X9gENkWUeOxsTdr9I6XqGr2h/WgI+2C0EUcnSGtiGF71L FaeF0bZT31c1IefaPiVgdG3QmfLjCL6TkwHDLZ3g= 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 14D973850404 for ; Tue, 23 Mar 2021 13:45:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 14D973850404 Received: by mail-qk1-x734.google.com with SMTP id z10so14308804qkz.13 for ; Tue, 23 Mar 2021 06:45:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OY9WMHeQzpfDUfyJkl/M9wzlkaSNBo6bfed6b1VMAdI=; b=ePngc43b+xHSmOiJaFa99E++ZqWLmn1trGPV2yzyEoysgVUvkta6MF9iycrrWaVaO0 4VQix6R8grodf8muchv9WT7UVnen9fLOxsBoKF1C7f3ELwkIl6mRnKYuHBfeQPBPup7Z P8hyOR62BpK2XI84xZFFOJZNinoVcPgMe+r8fN261PUkwqBQUKcIlsUCM1CehDLIT5RA XhZljjSTQIL86tb64AnDbDTFApLtSuWiMFO5yZ9agrEzpWE5Vpw3y6/r9httqgk2tkg5 naUXBB4FS6jYvRlR+6bsARB6vhPFQoxB8czonR4Aqw+9pGZzbY9cANxXyY/mxDeWbGCi ccnw== X-Gm-Message-State: AOAM531Y/V4dgnd9gPtqWhwaQEZSSSP4GQR3rWQ7LCGGd55BoW6J2Cnu SnS/5h9wY/SSONn9Ey0arKCGPZIW50xXng== X-Google-Smtp-Source: ABdhPJw6UpHfJmxNqjFle2Ug9QXavGrbAF7t0CVG9QBNZSMrObeqtCrg1Dep54qMK3WaUzlz8l1Rjg== X-Received: by 2002:ae9:eb58:: with SMTP id b85mr5452704qkg.168.1616507109250; Tue, 23 Mar 2021 06:45:09 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:09 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 06/15] time: Add getitimer and setitimer basic tests Date: Tue, 23 Mar 2021 10:44:49 -0300 Message-Id: <20210323134458.2563022-7-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 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 Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on i686-linux-gnu and x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar --- 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 99b5d42666..91cb02a003 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-clock_settime \ - tst-settimeofday + tst-settimeofday 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 Tue Mar 23 13:44:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42750 X-Patchwork-Delegate: siddhesh@gotplt.org 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 96A3A385040A; Tue, 23 Mar 2021 13:45:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96A3A385040A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507115; bh=e0j4mjqYNOP0rlyLNmxRznfrXQPveLBUa8/Xuis88Js=; 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=nd6o9MveSwTjfS8OPRR9HeRPi4sA650f2z3Xehk2+nUo/sDLKdJcNmd2dBxx5+8ge 8TSsHzM6/Uc/XcB57pEirlWrmwckoB9JFpdlZkXM7vKlfYYPKXPZo231cDooOPzayI mAuXsb0q3Xdp9uTk51dNSQHifGJ0jdwhVtGHU4M8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by sourceware.org (Postfix) with ESMTPS id 4C169385040A for ; Tue, 23 Mar 2021 13:45:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4C169385040A Received: by mail-qk1-x72c.google.com with SMTP id z10so14308887qkz.13 for ; Tue, 23 Mar 2021 06:45:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e0j4mjqYNOP0rlyLNmxRznfrXQPveLBUa8/Xuis88Js=; b=Pq1FSo1M6Q/u9G8DNIrAEHH2m/juunS9trbjmvjTadvau/fIynXxCydYLylzS6rbja uROgEqMyHmWLbnvtHwt7gdHr8PQ96VuReK2NW865+EzvKSL10MreeBrd5oLd8PE3N/JG a9zpjY98X050+eXPlNf72eR7nwKvGCkcYMvxYJL+augzEvwA0a0RVQinHP3XigLIfOcK vK+SMf8hnojQg70ioJ7rCCzjd7vC4Hb8xRgd4YfZ85x5zGgB7PxmBssRyUbAiij/iMAl rouK9U/gROjFgeWhUQQw6WEX9KCVrfox+OdM0xuauK+1EicuG5jcGpkwOm68hyp7x55B RvPw== X-Gm-Message-State: AOAM533ewJffQOo/QfV9fa2REaMCXLPL27EgOOC4C2s5w9exWV/lMQg9 Nn9gepzzhX4EYczfozMx1ixm/5mwfkMGoQ== X-Google-Smtp-Source: ABdhPJyZWruMitI1OnowNyvmj2FYWknRjw6k8W9IbbfiqYpDiXOz2ccrbJ/a8ZSsIISLbpKTwI1OKA== X-Received: by 2002:a05:620a:22b5:: with SMTP id p21mr5568516qkh.196.1616507110397; Tue, 23 Mar 2021 06:45:10 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:10 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 07/15] time: Add gmtime/gmtime_r tests Date: Tue, 23 Mar 2021 10:44:50 -0300 Message-Id: <20210323134458.2563022-8-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 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 Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Siddhesh Poyarekar --- time/Makefile | 2 +- time/tst-gmtime.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 time/tst-gmtime.c diff --git a/time/Makefile b/time/Makefile index 91cb02a003..a503297527 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-clock_settime \ - tst-settimeofday tst-itimer + tst-settimeofday 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 Tue Mar 23 13:44:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42751 X-Patchwork-Delegate: siddhesh@gotplt.org 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 2A9C7385041F; Tue, 23 Mar 2021 13:45:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A9C7385041F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507116; bh=NXLoWGYjyhtEfPiQq/GOnzGwsHebw6qxqubie6F6fVA=; 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=nr0TOOgf3m52p7FXyYkLI0S7ETW7a5LOoE6EZwAsOphAgDQef8cMiChJS4/LST9M+ gG9Gb0n1W1VVg93WvA2afE3rRX1FN8Y/cxpzWMenX4EyUGZi5JVhDpgWTGepMZ/8b0 gqidiyYD8PLY/J/3Lr9MG27AY7Uk6Av3S8K+sOLM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by sourceware.org (Postfix) with ESMTPS id A7308386103E for ; Tue, 23 Mar 2021 13:45:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A7308386103E Received: by mail-qk1-x733.google.com with SMTP id v70so14310739qkb.8 for ; Tue, 23 Mar 2021 06:45:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NXLoWGYjyhtEfPiQq/GOnzGwsHebw6qxqubie6F6fVA=; b=E92sMuQOkBeYTUCqNgKzjukg7j1Cw/6HptmEz+ATNknRCE4M0qL2crOu8SI8/bZw3B 1XeOvU3m5lxsndP/J/DNf44bTDF+VvTtHz3IDRPP83QDQue4lIiZX3VXosokJ2LpbkNN 1TxdBYLAUc9MOAQoTlcQYW86x6VwFFMbT+2IW7G6PqbVQ/e6EZZP9vxuMNa3QYMf6MLW SaYUbcyLJI8+aTDCXsHu5AxYuWjIABaAhsJ044/PQCPBnY5NX9liO17LSoTp0Bx7+/iQ Utrk88Tu92MkmL+30ownPH1Nxa6fDYZyy5IJHrmaSy4zSW0jjeKR/QXe+WzhMNls6Gzv aWYw== X-Gm-Message-State: AOAM530vaxwkA/VwSIQaYkjYUnsPcOXV9Sc8wokUnma3IOeFkB19bfr2 HOBJksf+XhGET/RApy004JusKGAq7I4odw== X-Google-Smtp-Source: ABdhPJy68fmaoNXeowiDbLCeafoB6HeRMXHd08omuhdiiGBddfTu2xbsDBiCq0EP+DPnaTxs3JZNug== X-Received: by 2002:ae9:ebc3:: with SMTP id b186mr5238718qkg.335.1616507111676; Tue, 23 Mar 2021 06:45:11 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:11 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 08/15] time: Add timegm/timelocal basic tests Date: Tue, 23 Mar 2021 10:44:51 -0300 Message-Id: <20210323134458.2563022-9-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 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 Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked i686-linux-gnu and x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar --- 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 a503297527..5fcd40ccbb 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-clock_settime \ - tst-settimeofday tst-itimer tst-gmtime + tst-settimeofday tst-itimer 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 Tue Mar 23 13:44:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42752 X-Patchwork-Delegate: siddhesh@gotplt.org 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 AD7B3385040B; Tue, 23 Mar 2021 13:45:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD7B3385040B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507116; bh=ErkowY/a5TuQSIk48GrYP10Y5oNRE1MLqeKSAAefhgU=; 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=IAgDBM7AWfUCABGQc8YoA9Qt+44NjM5QwOt9BjG2CMtfE9/CbmtZ53f3RNta5+PyO BXRFUfz0x/6v5fcQv+Iic3EJHIu+SjFX5jZ0ows2cZkFUmDZsMZDbd1ftjGROcvkTR OMmxa4k9Au9zl7cTvUnSGbFYhHJTMTfCC740DOkY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by sourceware.org (Postfix) with ESMTPS id 605E6385040A for ; Tue, 23 Mar 2021 13:45:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 605E6385040A Received: by mail-qv1-xf2d.google.com with SMTP id cx5so10436095qvb.10 for ; Tue, 23 Mar 2021 06:45:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ErkowY/a5TuQSIk48GrYP10Y5oNRE1MLqeKSAAefhgU=; b=bxl3T+s19onBa6kOYaKtffi2Gm4ozlGTGQiT7T5HixLlCS6sduMwRNp7AoZGKKA8CP TuF4NFyABbEBre3mOWiEi8nMiZGcOsuHBEal2+Ges2NyAgnznPTiZMlT0n7egZMG5EhQ cR5SFCcUnH74x35i94ENmcgSTfvrg0pakpD7huwUQNFBbB1+jMwp3EXovxKfQ7HsQrkk gDYLLp7hhnWgs9dOgRJFYkvKKM4QjJvqU6YXLDRbr1+D739jC2v7AQEHNprxDHaqp9uP elNXtIUd6L5evh7mCgoiw7PRxyfJGye0og4bCEBg5sMJhir4XSj6/QCKe5yGKW2L0NaS 4rKA== X-Gm-Message-State: AOAM533dZp+UwpOYfv2gzO8IhQTp1GmoYG+P034ku/B27sQTY7VYGAOF gAaRdd/lFzgVzkIoPH9/hskqIvShyP7rGA== X-Google-Smtp-Source: ABdhPJy27zdlm9w4g8Oay6dfzKoZm2fs2PQoUZx4X4FCd+OlDFSxZSPdVjxxjE/NGdVIpS0hdxpbsA== X-Received: by 2002:a0c:b59d:: with SMTP id g29mr4758893qve.39.1616507112785; Tue, 23 Mar 2021 06:45:12 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:12 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 09/15] time: Add basic timespec_get tests Date: Tue, 23 Mar 2021 10:44:52 -0300 Message-Id: <20210323134458.2563022-10-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 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 Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checkec on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Siddhesh Poyarekar --- time/Makefile | 3 ++- time/tst-timespec_get.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 time/tst-timespec_get.c diff --git a/time/Makefile b/time/Makefile index 5fcd40ccbb..e1faeb3921 100644 --- a/time/Makefile +++ b/time/Makefile @@ -49,7 +49,8 @@ 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-clock_settime \ - tst-settimeofday tst-itimer tst-gmtime tst-timegm + tst-settimeofday tst-itimer 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 Tue Mar 23 13:44:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42753 X-Patchwork-Delegate: siddhesh@gotplt.org 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 421283850416; Tue, 23 Mar 2021 13:45:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 421283850416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507119; bh=wGXne2vQdGUdiIVFUqzvCh54BsiqNpMjAqqAuStCoE4=; 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=yLiL9GGMOaXu3hlglv0H1x9wT0Z9Mbu7rDPzcJ0r2TgHjap1GFP5apZUL2hKIVE6Q 2IMbWnmDpagw8Ev5tCoGBWK99KNtHVt4ncwx+tKoUK5jEy041SpnhNHmxOa2b/lnRQ 6D1UeHAYk4niai+AXvRYKEJeYb3FcEmw4twq3TTw= 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 9D7C83850417 for ; Tue, 23 Mar 2021 13:45:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9D7C83850417 Received: by mail-qv1-xf35.google.com with SMTP id d10so10459575qve.7 for ; Tue, 23 Mar 2021 06:45:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wGXne2vQdGUdiIVFUqzvCh54BsiqNpMjAqqAuStCoE4=; b=hZ9E3G8ZtevS4u/vFDc4+sMYhAYE8vf91x1YcbI8ZIAUXTGon96+nnDT84IpbRK1MW PJn62wRWr87kZUxcNQ9CX2aMTiUYNJGVju23ev+aW1AEJTetDzSlTgi9EJO31drqmDdf TK3qBLDgwLe3k92Bb8h/TzWH+Ne4/3SBRd1KLFEd07f3U53FYTgXvifP9os1FEBvCsdq NyvD5RxCAA/rZu4bBxV9VldjuOqBN6HQTpcKbvjBJaXgnfGGDuWT1yYZ/rBtSbQuzJOu sznOwED2mKL+35trlYfARI/iSEonZaewsEaN68G3lmzucxq2Qdo/JR+xJSQmDGpYOdtR cYCQ== X-Gm-Message-State: AOAM531HyKXRTH58A1bRHn0EipjIPFgW4Beu7TT20LdMTW5ame9zzIMk Zv2h3Qh5ziFnarBoCl00G/762Pr88WQCJg== X-Google-Smtp-Source: ABdhPJwor3jvxb+w4CdJhLzSG92AjD4VBVN0QQEHrTnA4YV2Chx37xwDBH5fQLr9gGxniRJaK7811Q== X-Received: by 2002:a05:6214:1391:: with SMTP id g17mr4769527qvz.51.1616507113914; Tue, 23 Mar 2021 06:45:13 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:13 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 10/15] time: Add 64 bit tests for getdate / getdate_r Date: Tue, 23 Mar 2021 10:44:53 -0300 Message-Id: <20210323134458.2563022-11-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 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 Netto 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. Reviewed-by: Siddhesh Poyarekar --- 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 Tue Mar 23 13:44:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42754 X-Patchwork-Delegate: siddhesh@gotplt.org 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 C19003850427; Tue, 23 Mar 2021 13:45:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C19003850427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507119; bh=yZU9oglykHjh7jxvxSJZSuA2xa3swvB0/Srtfl0eC50=; 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=YReODI2oV6AnNu3tZ0st6L7jGd2ApwYr7BHNByLNoeF4MpfT30rTs6y5G1V7M3rhm uPnITsrlHKcmw9aT/TsafbgJoxtFUaPT737OEI2RgXWhIyMIR5H1Pd44A8OplREHra poymD4Q3HI7qywObWFqoB025xuMSUrlJOxM7xYnU= 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 250D1385041D for ; Tue, 23 Mar 2021 13:45:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 250D1385041D Received: by mail-qt1-x82a.google.com with SMTP id c6so14910302qtc.1 for ; Tue, 23 Mar 2021 06:45:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yZU9oglykHjh7jxvxSJZSuA2xa3swvB0/Srtfl0eC50=; b=AmLmHzOSiI6b8p/CRYk1E0Lx5JSmNc2SU3rwi+1Bw3ZCJPnA4x2cB9X4hbXYGbhewX Pt0/ESg4DbpEzNAFQrcanL22zOEgCsXJbdLAPJD8EqzePBPlWC2pvPUUqyRt0mqBe8Wg WOFxJNkY+o9C71FJ33UrvKmxuTKQFS/A45sVLGKqlJD1BduSHzYWnz/NGJ5QuOE0xQDQ FP8iDzE6NrP/b6jQEO9sm8mekO3eW2B0bk2Nf5dABrB/tlqLlBgrvrmUlzjZURi9LyM7 XU79LHh/b534EBTarhNTlY265XYAQJEqVqNLmnryOkSvup4hnzqKuUzaT2dPmaIJrJ2/ 8SNw== X-Gm-Message-State: AOAM530vCs179xTt7Yx9PjLgBh3le066AZt9UAf1i3khueLolBQjJ4KQ RKUeB6q1AHcMOcLCvMUbhUu8xDFeyV0oHw== X-Google-Smtp-Source: ABdhPJzA76WSAsH9f+Sy1NY3sGssyVEgK4oPQ7dqKSCKOefrGMwKzFGtXOLYLI/HIOtXY/EJgfQ/Kg== X-Received: by 2002:ac8:5a42:: with SMTP id o2mr4444070qta.191.1616507115110; Tue, 23 Mar 2021 06:45:15 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:14 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 11/15] posix: Add wait3 tests Date: Tue, 23 Mar 2021 10:44:54 -0300 Message-Id: <20210323134458.2563022-12-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 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 Netto 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. Reviewed-by: Siddhesh Poyarekar --- 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 be0c72f0bb..64494557f1 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 Tue Mar 23 13:44:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42755 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 4E5BC3850418; Tue, 23 Mar 2021 13:45:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E5BC3850418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507121; bh=UaGvjnsy0kyw3jRgGZkbU21oN5IDc8PuS0VVPCmsrxY=; 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=yJkhkZqZj1GJFcGsmgcAIjXPHQgH0sQWhlwmho+XOBKe5zIWgNNleiJhGWXZXerwk JGBV3yErgPc4jx3opmyQmQh6mX5TNFHyaAfk0S3U71Z6KOoMjel+Y4HIjK58dJ29Cr u2lqMwnia3ps5wy81qcT6ctXXkysgQx2iXf2SEKU= 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 9BB4D3850404 for ; Tue, 23 Mar 2021 13:45:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9BB4D3850404 Received: by mail-qv1-xf2b.google.com with SMTP id g8so10467482qvx.1 for ; Tue, 23 Mar 2021 06:45:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UaGvjnsy0kyw3jRgGZkbU21oN5IDc8PuS0VVPCmsrxY=; b=Iyhgsxj7mcyKChkyxOtHnbHhgoxAb5oaFyF5JAbRiaBB+KytXSeFJS0LBZOgkkgJGS 9aWa19qsVxvtfjOTUT005McMNw8te4sgEDwZnokh5G2cLsLpoatso6Alqe8mq5EHU0IS UnU7tSzKfypkEsI/dLq5uZ91iCvQqVtWqHvEW/fxuFbaYR9xpzJ46Ieeh6uA3P29vDiL /xUdO7mYYlXNJjr+B3CMqCnioYdRhvcuKCfeRxDMb5UTfWW803KKLr6XegM8m5tC2Nsa MeY32w4KbeMJ/zrLOn/0OhQzSSMBSEm5RPPSA0rduLNR3aSl6EQZsZfcuUDw0WRQo9lp CqVQ== X-Gm-Message-State: AOAM5316hro5OSk7mjxdQ36VpCRV/HwVDKXxJWN68R0KxxvTVMjs7iA/ g3hHniIenFV0hLyaOAK6VMs3SAw9dMXl3Q== X-Google-Smtp-Source: ABdhPJx0B/HH7OGDnu9nGsZN2ltLdNX9FrU3KQTHVXI5EbYt5krKPOxnrDQrvV2QDTlrXpweSSi1lg== X-Received: by 2002:a0c:fec8:: with SMTP id z8mr4699137qvs.59.1616507116324; Tue, 23 Mar 2021 06:45:16 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:16 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 12/15] linux: mips: Split libpthread.abilist in n32 and n64 Date: Tue, 23 Mar 2021 10:44:55 -0300 Message-Id: <20210323134458.2563022-13-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 Netto 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 | 214 ++++++++++++++++++ 2 files changed, 214 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..9c35d0da80 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libpthread.abilist @@ -0,0 +1,214 @@ +GLIBC_2.0 _IO_flockfile F +GLIBC_2.0 _IO_ftrylockfile F +GLIBC_2.0 _IO_funlockfile F +GLIBC_2.0 __errno_location 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 __send F +GLIBC_2.0 __sigaction 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 flockfile F +GLIBC_2.0 ftrylockfile F +GLIBC_2.0 funlockfile F +GLIBC_2.0 longjmp F +GLIBC_2.0 lseek F +GLIBC_2.0 open 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 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 sigaction F +GLIBC_2.0 siglongjmp 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 Tue Mar 23 13:44:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42756 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 D3643385042A; Tue, 23 Mar 2021 13:45:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3643385042A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507121; bh=b1wGhaTlCCnUyhlrvnVlLpwfB6SMNrVwvcuJf6nvcXY=; 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=U6LShg+DspluH25Hn7D5rMCC0hpbpvZ4vToftGRZao4hdwvs9mcwXL/Eb8wC7kwoX W6DBjThbiwKZ3Lc0HQfnNsg6ZSGMtKpX0p9EUVzQuMOLUgZsAN6TohlAuRc2nPZkKc An9cPM3YS6/Jgny6hJKh8qgYj2k7auN96AgoOj7E= 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 5E23F3850418 for ; Tue, 23 Mar 2021 13:45:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5E23F3850418 Received: by mail-qt1-x835.google.com with SMTP id 94so14941499qtc.0 for ; Tue, 23 Mar 2021 06:45:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b1wGhaTlCCnUyhlrvnVlLpwfB6SMNrVwvcuJf6nvcXY=; b=WE2U4FNHvkD0ZArocPslkqHsyheOLlmxAQQ4MYC8S7HwIJc710Vcd+lGS8HG+8JTW0 Yhr11SGrnDXbhghDulugae8g0A+QlvY6YFXCPo+J650MhELeCc91R++xkBmVMnMY0lR2 v9Yj8b/t/OyOE90O7887R8k0breejCgXK7lTybOoA4Dce2nNgxW+DYM57KOP9OHpgyeC drCxtEv8GSfZu9TXHYETN4/i0uIYR6t4LubX7dfQmTNSCZVt9pWFJvHil+I+jW8+lC03 3rLQLjmpDXovjeW+0VrdZ5QQYdAMdJH4VAPm3i06X1/8IHiA4jojK107QerzZW79NvGA XDkw== X-Gm-Message-State: AOAM532ZFBc/pcpryIFwokdAAvyrRrnhTpao1AUdXPZlXzxaTHFa/8wT hUuBmx1MSPfsMYnIzYxA5e0Eg/J349bBOw== X-Google-Smtp-Source: ABdhPJxFi6kygZgQfKdDmjNoqEBZBUyUEOQm9zb+qP15uxXCGNDElRNYpoC5xXhLAXmhT5ev0gvthg== X-Received: by 2002:a05:622a:8a:: with SMTP id o10mr4248941qtw.50.1616507117871; Tue, 23 Mar 2021 06:45:17 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:17 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 13/15] linux: mips: Split librt.abilist in n32 and n64 Date: Tue, 23 Mar 2021 10:44:56 -0300 Message-Id: <20210323134458.2563022-14-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 Netto 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 Tue Mar 23 13:44:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42757 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 66368385042E; Tue, 23 Mar 2021 13:45:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66368385042E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507122; bh=Fzg2aK+LZmlsT5aaOOiLeREDQIMXr5jf0pBFptesRs4=; 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=Z3N2L8yAgRQaiu9MOARMmtMGVTvmDXIm73Km9N6nIwq1faHOJAChz0QGbH6OvUEiu Bl7LarzLjIufe1bc07flqMxSN6uG2cNNCg+Os+g5nAlt3S4546tWrbOz5zL7tEFL6p tZ+YfSRLFpeu/nPeVKAwTakoxMGtX+iFRepWJ7xM= 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 ABA203850426 for ; Tue, 23 Mar 2021 13:45:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ABA203850426 Received: by mail-qv1-xf32.google.com with SMTP id t5so10456511qvs.5 for ; Tue, 23 Mar 2021 06:45:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fzg2aK+LZmlsT5aaOOiLeREDQIMXr5jf0pBFptesRs4=; b=dW/mhuk/ip+MlNa4mnnXoxGF2qblW41TUkPHv9T+4SouDg7WfSVxQ8jBBgYWOkiUPW YSvMYEejYCb6p1WvmNa8eHuuA7fpduA16eU/gY4rGF2bUfUj9PN3NXcwEDY+amj5qu72 myYAn12WjVfDI052Lv3VDoAWEAEbwMe+WWEmeEn0nK9JyJfkowmJhm9139+B/r8d3U9q 0BbwV7BBLZZD6gJInBmQfOdLJtTsp9c2lWPMXP19PY5cBq1UMoYt5WQSojv+ZZLp7PRd zvryipbjz9C8cQHTI1K+4UXTw1X73t9MdcoecGYEKuhfFp0kQgyPzz/Rg3Un5YbWg62f Hi9w== X-Gm-Message-State: AOAM530ohqPI6HHrPWyDV3AUQY3QAp+dR6w+P++4jdQlEYLQ/PDiBtqA YkW3GRJXxZrhFF30jjo2GmVLMY0GxBll7A== X-Google-Smtp-Source: ABdhPJzpDqFNviBkvmp6VYiyfg83SUuYhRzyg/JqtUxF7suBgBNDjD/0Ebwdla7jiw3J9+zwr2PVWQ== X-Received: by 2002:a05:6214:d47:: with SMTP id 7mr4861164qvr.48.1616507119152; Tue, 23 Mar 2021 06:45:19 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:18 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 14/15] linux: mips: Split libanl.abilist in n32 and n64 Date: Tue, 23 Mar 2021 10:44:57 -0300 Message-Id: <20210323134458.2563022-15-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 Netto 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 Tue Mar 23 13:44:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42758 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 689943850438; Tue, 23 Mar 2021 13:45:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 689943850438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1616507124; bh=C9gwu7RwNmVLGNVOyNe0FQxQC72DKJeNZjvV0XiDijQ=; 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=NEkUmrWDIxs25oAxg44dUJZ+5SP+DTHYWQ8ium2YK3tTGkFP0sXlp1lb1wshGc03V 12jdXWJFYW4Ddi14zDnIU9AinUMyjnTdbseb/aeqkrlNPOxFHkKnn+jX+0rhhxDUZB CxgHSxlDY3+/LdItKK7OqWuYcH7x40tQPwzeJ1bM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id D42463854805 for ; Tue, 23 Mar 2021 13:45:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D42463854805 Received: by mail-qk1-x730.google.com with SMTP id g20so14305763qkk.1 for ; Tue, 23 Mar 2021 06:45:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C9gwu7RwNmVLGNVOyNe0FQxQC72DKJeNZjvV0XiDijQ=; b=p5AyRtE5u8dlKQov/YixplKyUgZuVvo+z0gdtXPcU3219jvELNqHn9slh+myh9KX65 24/PSRbRWPP8+xJZ871FIOWxx8A+ZKgmzz1EMcRh3JDRkdwfxrN3ufNzc0ggOJsop4fU 8q3kYrXEuf8I/7YWRq5Q/k9wUFJSADtSXPorNC5PP/Wcxk5Pggwkaf40TDYVWTmYQZaL Oo58uPC4bIKp8HU4zBWe/vypmuKupGoyIx4H/uExwjyAVJ2VaB1MxelLQpdsRxOjkkeO Dssd48Ox0vUXfk1aZk0SdeTtaAs7leoORdQ1ccdIvjNENKlYe7qXRrCqWRLjh3Kgmtm2 1S+A== X-Gm-Message-State: AOAM531ODOyTHtqIhYYVYYGKn1HphRxdhSMr9Gn4C5aXfrXNucVUcgaI r/jQWkErSuHVHZNBHJIo08Vledp/l5/qMg== X-Google-Smtp-Source: ABdhPJxDrs9oI4Jx4USVGutf4AxLkNUu4psY+dX93bnhfyARgYkXCrmyey9BQfEjtRsIFFDjGc6QMw== X-Received: by 2002:a05:620a:141a:: with SMTP id d26mr5397874qkj.363.1616507120317; Tue, 23 Mar 2021 06:45:20 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id z24sm12783384qkz.65.2021.03.23.06.45.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 06:45:20 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 15/15] linux: s390: Add libanl.abilist in s390 and s390x Date: Tue, 23 Mar 2021 10:44:58 -0300 Message-Id: <20210323134458.2563022-16-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> References: <20210323134458.2563022-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" 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