From patchwork Mon Jun 7 20:35: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: 43751 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 BBB43388A83A for ; Mon, 7 Jun 2021 20:36:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BBB43388A83A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098206; bh=l+V2Bkgf6uh+SguwSr4i+rOUfzLK41c9RXw0dkhNO0M=; 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=t3Yib8XkOrksrQlSHwlmyINCjz5GbpvHkNQru26VP9Q1mZzR/y/4UYqSW53DQaScp AQxKmTilONcdYMTm1nEdaDE5XOrLaA+Woq65Zjm86vOBSOLEhDE0Vx0ic7moH4QfJs HnyqRDxwj31Q85qchWie/X4LKw0sxTfX8ngK0vd4= 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 62125389853F for ; Mon, 7 Jun 2021 20:36:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 62125389853F Received: by mail-qv1-xf32.google.com with SMTP id x2so8965076qvo.8 for ; Mon, 07 Jun 2021 13:36:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l+V2Bkgf6uh+SguwSr4i+rOUfzLK41c9RXw0dkhNO0M=; b=oIDnTbA42jbjTAuYYe9iLlSDeoRS3fv20jeSO6gCSjlIL4LWon3U0nuD7dMBkYrfQH RIyLKo+AgYedHtJu/iZVQrD2lCoIwrzR6qAA92NnISe18MAFIYaJOYwFR2EY7YnY3LO9 1LLi12C6z9pAcD7VRy7GjB9EDU9Ka2GkaaqWd4Pv+hJwzOpndT1IuY6TUyDfMDoq1kks SMNDLUNanlmcZ2cgbIdtP3jThGcJ6Iar6VakOb9nBvMTle/5f59vDNd4lrGYnixl4cGQ DDLo0OKgFlbTwKUfPkrypI0z2J0xGjze56DCG5YOWtLLNlkxfyNHdJfgTAW7XbSRWyzW Xjiw== X-Gm-Message-State: AOAM530H5kTstp+rfPtLtSkEpFllmad8o6d+SDEKNuwmuEcFEMu/rKlH ZPy0Vwuw45t9c1kDBKZyMzxRmcBo+SZ20g== X-Google-Smtp-Source: ABdhPJxnQUukMn6+lYobXRl4ytk0DFKJ6kDSIhtDuLohzOrRRNcWnoXIYa9fnBNhNx5O6JfcyuTxJw== X-Received: by 2002:a05:6214:e82:: with SMTP id hf2mr20040357qvb.22.1623098180804; Mon, 07 Jun 2021 13:36:20 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:20 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 01/24] linux: mips: Split librt.abilist in n32 and n64 Date: Mon, 7 Jun 2021 17:35:50 -0300 Message-Id: <20210607203613.282543-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The n32 will require the 64-bit time symbols for y2038 support. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- .../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 Mon Jun 7 20:35: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: 43753 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 8CC9238A28BF for ; Mon, 7 Jun 2021 20:38:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8CC9238A28BF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098302; bh=Yr4Z1RXA7kNsAe7JrkZaZONfLIsZL02NBBabe2pcGP0=; 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=UPWfCDJwhmZInvPdKrgAR3OeBn3eKoD6Wxl0NNOyc0Xa5IdGB+yylbvHDTtP/ffCR CT9xr9vVFCeEhcTQoBnu0mE4k+oemQPdJUtpMN0WebBArEAI10hT1D9tzXU2FaCAhm IbwESAsI7bIHZOLBNmOn1TssIw7eXzmW9zeuPj3I= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id 05A48389853F for ; Mon, 7 Jun 2021 20:36:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 05A48389853F Received: by mail-qt1-x831.google.com with SMTP id p21so1889777qtw.6 for ; Mon, 07 Jun 2021 13:36:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yr4Z1RXA7kNsAe7JrkZaZONfLIsZL02NBBabe2pcGP0=; b=ZOwbyU4SQabP4ObYjPOSyEL0r7Koj0dTxFp0OU7LTlGyTWdlBLfwdy2oVGVrqEMnvK ZU9u2L50oFU+sCPLI1MvAvFN+KFkUqLXi/XECQ9R4dPzmHCW0+jP8yEo3Ri/chsa9OGx 7RVs4PT/CngHYnmY65u6i0iYFx9xEbA+lEgfMMPbh0z9biZ73PwE+pgXYAUwiDuIh9rt QMtQi+1RFvEumCbZjdo93Qxnn1esIYYhl1zFTTfL+kusH+SGQ7Gt/iyOLlA1yxlvurym TgxvcW/ryJPM9W6uY3lNMdcdMrknLyD+w26bPxy1ihofWK/qGcQk0j2lOYDugTXTeJm2 d5FQ== X-Gm-Message-State: AOAM531SOByqAkZw5GYN7VvxbZjHlMGCiX8SelmRpqzyOk8Elp44CuOc PKcJmyyviLC6MwveyQorCVoDTSFxNtWoIQ== X-Google-Smtp-Source: ABdhPJw3grUxst1MxYbh8JMuXlywGtcXLmJp2jMnuvRcyUQvBQoze5EOktAPRQFcUsZE5Z4L530crg== X-Received: by 2002:a05:622a:392:: with SMTP id j18mr4751274qtx.283.1623098182451; Mon, 07 Jun 2021 13:36:22 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:22 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 02/24] linux: mips: Split libanl.abilist in n32 and n64 Date: Mon, 7 Jun 2021 17:35:51 -0300 Message-Id: <20210607203613.282543-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The n32 will require the 64-bit time symbols for y2038 support. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- 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 Mon Jun 7 20:35: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: 43754 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 5D94A3938C09 for ; Mon, 7 Jun 2021 20:39:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D94A3938C09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098346; bh=NI3/Y6WePoVOPvqDUZrdh31ZnBT9IVLFL4AsbFx3rG4=; 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=CApgNVbl8KakFuej+reNA0HHaDyj0qSmoGadg7kdxQh9I0P2mRlay4sjfDt67IYUe ZhLna1KP186kRbE5+kb9NGh+bi3BHvIEEn7MOiUzNji0fkXKcnEFP8VyaP8huX7pQM UYuWJwBOd9oZQU5V1VQ/1LqWI+uBfr6i3drf31TU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by sourceware.org (Postfix) with ESMTPS id 90566389853F for ; Mon, 7 Jun 2021 20:36:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 90566389853F Received: by mail-qt1-x82d.google.com with SMTP id g12so1293639qtb.2 for ; Mon, 07 Jun 2021 13:36:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NI3/Y6WePoVOPvqDUZrdh31ZnBT9IVLFL4AsbFx3rG4=; b=mgzfsU6aDR/1X1U2zOo0wNIhxOAPk7wHXHqyFUQqkeV3S9K9z54cBItRO4sxr8Vu2L OlC7a4XOC+fOfj8wSIrWqwfRddfb4wJHn3a9CclXF4x5AhWWPRBFplEEhachEJxScDwd UG1s8AKCx9efhR8iLJLAz7fyKVBL+J1OWQiogAcSHnUwgcxYZdO/ibX+/qV2J22KZ76l qI7w+D5sibXHOKC85YwnkPHG37vozf93KVVKeTp9osNt9274GZkf7nHwBdLOP28Rvsig q/rmOUUzvx0oPUhHJL2HVZQpbfwuSoRy/dnrnbYzt5XkjBeOjH0R5wmI3OC4YtO7fm52 z73w== X-Gm-Message-State: AOAM531CbaE2RH/otUBzO59DINuZ1zkV5b7/OYlY83k305cX7YuWmi8C 8aBmnE8m/BXyDMJQ/Km/D5cOJT7APgbMXQ== X-Google-Smtp-Source: ABdhPJw+HqzjCoun5bZXz7KVy51XQaYymMQLtZUgeMW/Ds4wZ37fPkq5Jcz34Wa3vi6EwqlX6XrvHg== X-Received: by 2002:a05:622a:28c:: with SMTP id z12mr3171787qtw.104.1623098184031; Mon, 07 Jun 2021 13:36:24 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:23 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 03/24] linux: s390: Add libanl.abilist in s390 and s390x Date: Mon, 7 Jun 2021 17:35:52 -0300 Message-Id: <20210607203613.282543-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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, 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The s390 will require the 64-bit time symbols for y2038 support. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist | 0 sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist | 4 ++++ 2 files changed, 4 insertions(+) rename sysdeps/unix/sysv/linux/s390/{ => s390-32}/libanl.abilist (100%) create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist diff --git a/sysdeps/unix/sysv/linux/s390/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist similarity index 100% rename from sysdeps/unix/sysv/linux/s390/libanl.abilist rename to sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist new file mode 100644 index 0000000000..d9a5ed015d --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libanl.abilist @@ -0,0 +1,4 @@ +GLIBC_2.2.3 gai_cancel F +GLIBC_2.2.3 gai_error F +GLIBC_2.2.3 gai_suspend F +GLIBC_2.2.3 getaddrinfo_a F From patchwork Mon Jun 7 20:35: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: 43755 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 36556388A432 for ; Mon, 7 Jun 2021 20:39:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36556388A432 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098390; bh=vwT8K1nwtixvWik0XHUOGBTQ2KzDJ/DgJxbpe/WURcc=; 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=Z580/NksGQzAQLTgloMkIhITG/myOTMqxSfVbffst3kcReZgZaJYwCb5QtTvWR+tO lT5SSkNUF1LKpqPZmoVVqElyWd/uc8kjwPm0GZyCRGZfetslCkedOi3wXqH2Oc5z5p to90O44LUtEILSplXHRFHEy6OVbMaLE0W5wYTnaI= 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 51AB93938396 for ; Mon, 7 Jun 2021 20:36:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 51AB93938396 Received: by mail-qt1-x82a.google.com with SMTP id p21so1889910qtw.6 for ; Mon, 07 Jun 2021 13:36:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vwT8K1nwtixvWik0XHUOGBTQ2KzDJ/DgJxbpe/WURcc=; b=DNGnaGCmOOapUgUntUMao+6SJGTPsdZ54Y4i6d3M0sWFfTeFkk7Xc/RUV113Df5EA/ gRAdv8hmP/RNFyA7TtmnrordszIrgJk4xxqsU+UPUptKBWhqpqu+m4zpDm9J8XgxIepK lsUnqy+Jx1lEcKhVC+P7invIqISgctnrK2Bv3sDtXuNSE38bs67Fuwg4YLMSrr3NGPbX resbHCPpmecfGD/cojbMWtCD3kKqL/sh86k5/g3ytebfud8q5bnKfwY+I658WzoQpcw9 g/luE5N8wOKLOpVhxYNPBR4mu1pyFaJcGKfbehJuJILniDdwCrSiqXET/eNtVNtFKGzc 8StA== X-Gm-Message-State: AOAM530IG3lrVfYlDXldNURpn9G7sJt4v1nisRHkX852+YyG3HTneFwM kS5yLNuVXIOt6CBdZibdeH8Z3J4tVonhVg== X-Google-Smtp-Source: ABdhPJyxfPAkMiS0jb4/frw9ydk+J750YuQiLI00eECXvrPC6Bi8trsEInbuIqdZhVUrgdc9S72KQA== X-Received: by 2002:ac8:5784:: with SMTP id v4mr17989309qta.264.1623098185649; Mon, 07 Jun 2021 13:36:25 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:25 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 04/24] linux: Add fallback for 64-bit time_t SO_{RCV, SND}TIMEO Date: Mon, 7 Jun 2021 17:35:53 -0300 Message-Id: <20210607203613.282543-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The constant values will be changed for __TIMESIZE=64, so binaries built with 64-bit time support might fail to work properly on old kernels. Both {get,set}sockopt will retry the syscall with the old constant values and the timeout value adjusted when kernel returns ENOTPROTOPT. It also adds an internal only SO_{RCV,SND}TIMEO where COMPAT_SO_{RCV,SND}TIMEO_OLD indicates pre 32 bit time support and COMPAT_SO_{RCV,SND}TIMEO_NEW indicates time64 support. It allows to refer to constant independently of the time_t ABI and kernel version used. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Carlos O'Donell Tested-by: carlos O'Donell --- sysdeps/unix/sysv/linux/getsockopt.c | 70 ++++++++++++++++-- .../sysv/linux/hppa/socket-constants-time64.h | 30 ++++++++ .../sysv/linux/mips/socket-constants-time64.h | 30 ++++++++ .../linux/powerpc/socket-constants-time64.h | 30 ++++++++ sysdeps/unix/sysv/linux/setsockopt.c | 71 ++++++++++++++++--- .../unix/sysv/linux/socket-constants-time64.h | 30 ++++++++ .../linux/sparc/socket-constants-time64.h | 30 ++++++++ 7 files changed, 276 insertions(+), 15 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h create mode 100644 sysdeps/unix/sysv/linux/mips/socket-constants-time64.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h create mode 100644 sysdeps/unix/sysv/linux/socket-constants-time64.h create mode 100644 sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h diff --git a/sysdeps/unix/sysv/linux/getsockopt.c b/sysdeps/unix/sysv/linux/getsockopt.c index 76ee8a94d6..688a7de087 100644 --- a/sysdeps/unix/sysv/linux/getsockopt.c +++ b/sysdeps/unix/sysv/linux/getsockopt.c @@ -15,16 +15,15 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - +#include +#include #include -#include -#include +#include -int -__getsockopt (int fd, int level, int optname, void *optval, socklen_t *len) +static int +getsockopt_syscall (int fd, int level, int optname, void *optval, + socklen_t *len) { #ifdef __ASSUME_GETSOCKOPT_SYSCALL return INLINE_SYSCALL (getsockopt, 5, fd, level, optname, optval, len); @@ -32,4 +31,61 @@ __getsockopt (int fd, int level, int optname, void *optval, socklen_t *len) return SOCKETCALL (getsockopt, fd, level, optname, optval, len); #endif } + +#ifndef __ASSUME_TIME64_SYSCALLS +static int +getsockopt32 (int fd, int level, int optname, void *optval, + socklen_t *len) +{ + int r = -1; + + if (level != SOL_SOCKET) + return r; + + switch (optname) + { + case COMPAT_SO_RCVTIMEO_NEW: + case COMPAT_SO_SNDTIMEO_NEW: + { + if (optname == COMPAT_SO_RCVTIMEO_NEW) + optname = COMPAT_SO_RCVTIMEO_OLD; + if (optname == COMPAT_SO_SNDTIMEO_NEW) + optname = COMPAT_SO_SNDTIMEO_OLD; + + struct __timeval32 tv32; + r = getsockopt_syscall (fd, level, optname, &tv32, + (socklen_t[]) { sizeof tv32 }); + if (r < 0) + break; + + /* POSIX states that if the size of the option value is greater than + then option length, the option value argument shall be silently + truncated. */ + if (*len >= sizeof (struct __timeval64)) + { + struct __timeval64 *tv64 = (struct __timeval64 *) optval; + *tv64 = valid_timeval32_to_timeval64 (tv32); + *len = sizeof (*tv64); + } + else + memcpy (optval, &tv32, sizeof tv32); + } + } + + return r; +} +#endif + +int +__getsockopt (int fd, int level, int optname, void *optval, socklen_t *len) +{ + int r = getsockopt_syscall (fd, level, optname, optval, len); + +#ifndef __ASSUME_TIME64_SYSCALLS + if (r == -1 && errno == ENOPROTOOPT) + r = getsockopt32 (fd, level, optname, optval, len); +#endif + + return r; +} weak_alias (__getsockopt, getsockopt) diff --git a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h new file mode 100644 index 0000000000..9fe7576aaa --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h @@ -0,0 +1,30 @@ +/* Compat socket constants used in 64-bit compat code. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SOCKET_CONSTANTS_TIME64_H +#define _SOCKET_CONSTANTS_TIME64_H + +/* The compat code requires the SO_* constants used for both 32 and 64-bit + time_t, however they were only added on v5.1 kernel. */ + +#define COMPAT_SO_RCVTIMEO_OLD 4102 +#define COMPAT_SO_SNDTIMEO_OLD 4101 +#define COMPAT_SO_RCVTIMEO_NEW 16448 +#define COMPAT_SO_SNDTIMEO_NEW 16449 + +#endif diff --git a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h new file mode 100644 index 0000000000..1252a8a23b --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h @@ -0,0 +1,30 @@ +/* Compat socket constants used in 64-bit compat code. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SOCKET_CONSTANTS_TIME64_H +#define _SOCKET_CONSTANTS_TIME64_H + +/* The compat code requires the SO_* constants used for both 32 and 64-bit + time_t, however they were only added on v5.1 kernel. */ + +#define COMPAT_SO_RCVTIMEO_OLD 4102 +#define COMPAT_SO_SNDTIMEO_OLD 4101 +#define COMPAT_SO_RCVTIMEO_NEW 66 +#define COMPAT_SO_SNDTIMEO_NEW 67 + +#endif diff --git a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h new file mode 100644 index 0000000000..26e8b710ab --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h @@ -0,0 +1,30 @@ +/* Compat socket constants used in 64-bit compat code. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SOCKET_CONSTANTS_TIME64_H +#define _SOCKET_CONSTANTS_TIME64_H + +/* The compat code requires the SO_* constants used for both 32 and 64-bit + time_t, however they were only added on v5.1 kernel. */ + +#define COMPAT_SO_RCVTIMEO_OLD 18 +#define COMPAT_SO_SNDTIMEO_OLD 19 +#define COMPAT_SO_RCVTIMEO_NEW 66 +#define COMPAT_SO_SNDTIMEO_NEW 67 + +#endif diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c index 12fd7bdcde..6505202265 100644 --- a/sysdeps/unix/sysv/linux/setsockopt.c +++ b/sysdeps/unix/sysv/linux/setsockopt.c @@ -15,21 +15,76 @@ License along with the GNU C Library; if not, see . */ -#include -#include #include - +#include +#include #include -#include -#include +#include -int -setsockopt (int fd, int level, int optname, const void *optval, socklen_t len) +static int +setsockopt_syscall (int fd, int level, int optname, const void *optval, + socklen_t len) { #ifdef __ASSUME_SETSOCKOPT_SYSCALL - return INLINE_SYSCALL (setsockopt, 5, fd, level, optname, optval, len); + return INLINE_SYSCALL_CALL (setsockopt, fd, level, optname, optval, len); #else return SOCKETCALL (setsockopt, fd, level, optname, optval, len); #endif } + +#ifndef __ASSUME_TIME64_SYSCALLS +static int +setsockopt32 (int fd, int level, int optname, const void *optval, + socklen_t len) +{ + int r = -1; + + if (level != SOL_SOCKET) + return r; + + switch (optname) + { + case COMPAT_SO_RCVTIMEO_NEW: + case COMPAT_SO_SNDTIMEO_NEW: + { + if (len < sizeof (struct __timeval64)) + { + __set_errno (EINVAL); + break; + } + + struct __timeval64 *tv64 = (struct __timeval64 *) optval; + if (! in_time_t_range (tv64->tv_sec)) + { + __set_errno (EOVERFLOW); + break; + } + + if (optname == COMPAT_SO_RCVTIMEO_NEW) + optname = COMPAT_SO_RCVTIMEO_OLD; + if (optname == COMPAT_SO_SNDTIMEO_NEW) + optname = COMPAT_SO_SNDTIMEO_OLD; + + struct __timeval32 tv32 = valid_timeval64_to_timeval32 (*tv64); + + r = setsockopt_syscall (fd, level, optname, &tv32, sizeof (tv32)); + } + } + + return r; +} +#endif + +int +setsockopt (int fd, int level, int optname, const void *optval, socklen_t len) +{ + int r = setsockopt_syscall (fd, level, optname, optval, len); + +#ifndef __ASSUME_TIME64_SYSCALLS + if (r == -1 && errno == ENOPROTOOPT) + r = setsockopt32 (fd, level, optname, optval, len); +#endif + + return r; +} weak_alias (setsockopt, __setsockopt) diff --git a/sysdeps/unix/sysv/linux/socket-constants-time64.h b/sysdeps/unix/sysv/linux/socket-constants-time64.h new file mode 100644 index 0000000000..d09c39d6c2 --- /dev/null +++ b/sysdeps/unix/sysv/linux/socket-constants-time64.h @@ -0,0 +1,30 @@ +/* Compat socket constants used in 64-bit compat code. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SOCKET_CONSTANTS_TIME64_H +#define _SOCKET_CONSTANTS_TIME64_H + +/* The compat code requires the SO_* constants used for both 32 and 64-bit + time_t, however they were only added on v5.1 kernel. */ + +#define COMPAT_SO_RCVTIMEO_OLD 20 +#define COMPAT_SO_SNDTIMEO_OLD 21 +#define COMPAT_SO_RCVTIMEO_NEW 66 +#define COMPAT_SO_SNDTIMEO_NEW 67 + +#endif diff --git a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h new file mode 100644 index 0000000000..f4668db537 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h @@ -0,0 +1,30 @@ +/* Compat socket constants used in 64-bit compat code. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SOCKET_CONSTANTS_TIME64_H +#define _SOCKET_CONSTANTS_TIME64_H + +/* The compat code requires the SO_* constants used for both 32 and 64-bit + time_t, however they were only added on v5.1 kernel. */ + +#define COMPAT_SO_RCVTIMEO_OLD 8192 +#define COMPAT_SO_SNDTIMEO_OLD 16384 +#define COMPAT_SO_RCVTIMEO_NEW 68 +#define COMPAT_SO_SNDTIMEO_NEW 69 + +#endif From patchwork Mon Jun 7 20:35: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: 43756 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 912253938C09 for ; Mon, 7 Jun 2021 20:40:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 912253938C09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098434; bh=KfNA3rISOTaaxQ6XiFzBI0+s8t9Q5QFs9TlSluYTOZQ=; 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=xXSYuUpzN6jpdg2S5/imTKT/ZpJtzplqCBTovRNM+/bx2qdQthMQVUqPDtbO3rRpd 0Q7ONd8xHgANrl98gT+6JIZZL2CTmlhn204V5hkwbtLu/aDxVtB5X7mAw3Rz7wWf4S lT4uSJrXGzqhbBskuwWjeeAM5HRroS2gqX1tYH8E= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by sourceware.org (Postfix) with ESMTPS id D91653899078 for ; Mon, 7 Jun 2021 20:36:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D91653899078 Received: by mail-qt1-x82e.google.com with SMTP id t20so13645407qtx.8 for ; Mon, 07 Jun 2021 13:36:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KfNA3rISOTaaxQ6XiFzBI0+s8t9Q5QFs9TlSluYTOZQ=; b=keh5PPoc5gQ842DTZ2qh2thm+5Ik+jsMLSJ+GpGYvbuSo0AXfGW99Drj2XzNRVE/WC K7FOB0KZ1RTEd2vtTqVuoHxW0PhnL4DG0RCmbzULXo5FJQOrK++k5JKutHSoK54WeyNj I6CAIxq6MFG4P/ZLuBIst4I8nCCmyYVDG5WQZMe84UjMuDlw2k5fEeunFCdeLaNWHQo9 +2qVzNfLex+8VXgpR/hA6XkLVr/vT3SUo9jJPMzLFJdzJNpMn9S1z5LdnA657N+YNWqc 3Puw6eaH6ITOkS3O7Oc7T1MBw826WH3+vcLC0en5ty1eN7HvLPkIwbpwddjH5cxatT2Z RKrQ== X-Gm-Message-State: AOAM532ME9z2yBd9P83GacL1RfkY4BJ504Zln0AvANopBBEMIpRcrRte 1dljWnfRDMM+6Rd3coNdY74zYOxXL1WcsA== X-Google-Smtp-Source: ABdhPJwkYRW8L3TnVufmP7LgiNyqzOMNnhn+XIqsv3OALHRZRVli2l33N9pHNuKNC2YZOVXa3pXrog== X-Received: by 2002:a05:622a:10:: with SMTP id x16mr17918018qtw.185.1623098187270; Mon, 07 Jun 2021 13:36:27 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:27 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 05/24] linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS} Date: Mon, 7 Jun 2021 17:35:54 -0300 Message-Id: <20210607203613.282543-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The recvmsg handling is more complicated because it requires check the returned kernel control message and make some convertions. For !__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP or SO_TIMESTAMPNS and appends it to the control buffer if has extra space or returns MSG_CTRUNC otherwise. The 32-bit time field is kept as-is. Calls with __TIMESIZE=32 will see the converted 64-bit time control messages as spurious control message of unknown type. Calls with __TIMESIZE=64 running on pre-time64 kernels will see the original message as a spurious control ones of unknown typ while running on kernel with native 64-bit time support will only see the time64 version of the control message. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- include/sys/socket.h | 5 + sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/Versions | 1 + .../unix/sysv/linux/convert_scm_timestamps.c | 96 +++++++++++++++++++ sysdeps/unix/sysv/linux/getsockopt.c | 12 +++ .../sysv/linux/hppa/socket-constants-time64.h | 5 + .../sysv/linux/mips/socket-constants-time64.h | 5 + .../linux/powerpc/socket-constants-time64.h | 5 + sysdeps/unix/sysv/linux/recvmsg.c | 23 +++-- sysdeps/unix/sysv/linux/setsockopt.c | 12 +++ .../unix/sysv/linux/socket-constants-time64.h | 5 + .../linux/sparc/socket-constants-time64.h | 5 + 12 files changed, 169 insertions(+), 7 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/convert_scm_timestamps.c diff --git a/include/sys/socket.h b/include/sys/socket.h index 0e39dd2a3a..15d4a62b26 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -164,5 +164,10 @@ libc_hidden_proto (__libc_sa_len) libc_hidden_proto (__cmsg_nxthdr) +#ifndef __ASSUME_TIME64_SYSCALLS +extern void __convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize) ; +libc_hidden_proto (__convert_scm_timestamps) +#endif + #endif #endif diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index bc14f20274..36d5ae020c 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -64,7 +64,7 @@ sysdep_routines += adjtimex clone umount umount2 readahead sysctl \ time64-support pselect32 \ xstat fxstat lxstat xstat64 fxstat64 lxstat64 \ fxstatat fxstatat64 \ - xmknod xmknodat + xmknod xmknodat convert_scm_timestamps CFLAGS-gethostid.c = -fexceptions CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index c864ad38ca..4637fd651d 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -194,6 +194,7 @@ libc { __pread64_nocancel; __close_nocancel; __sigtimedwait; + __convert_scm_timestamps; # functions used by nscd __netlink_assert_response; } diff --git a/sysdeps/unix/sysv/linux/convert_scm_timestamps.c b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c new file mode 100644 index 0000000000..3c123c28ce --- /dev/null +++ b/sysdeps/unix/sysv/linux/convert_scm_timestamps.c @@ -0,0 +1,96 @@ +/* Socket timestamp conversion routines. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#ifndef __ASSUME_TIME64_SYSCALLS +# include +# include +# include +# include + +/* It converts the first SO_TIMESTAMP or SO_TIMESTAMPNS with 32-bit time and + appends it to the control buffer. The 32-bit time field is kept as-is. + + Calls with __TIMESIZE=32 will see the converted 64-bit time control + messages as spurious control message of unknown type. + + Calls with __TIMESIZE=64 running on pre-time64 kernels will see the + original message as a spurious control ones of unknown typ while running + on kernel with native 64-bit time support will only see the time64 version + of the control message. */ +void +__convert_scm_timestamps (struct msghdr *msg, socklen_t msgsize) +{ + if (msg->msg_control == NULL || msg->msg_controllen == 0) + return; + + /* The returned control message format for SO_TIMESTAMP_NEW is a + 'struct __kernel_sock_timeval' while for SO_TIMESTAMPNS_NEW is a + 'struct __kernel_timespec'. In either case it is two uint64_t + members. */ + uint64_t tvts[2]; + + struct cmsghdr *cmsg, *last = NULL; + int type = 0; + + for (cmsg = CMSG_FIRSTHDR (msg); + cmsg != NULL; + cmsg = CMSG_NXTHDR (msg, cmsg)) + { + if (cmsg->cmsg_level != SOL_SOCKET) + continue; + + switch (cmsg->cmsg_type) + { + case COMPAT_SO_TIMESTAMP_OLD: + if (type != 0) + break; + type = COMPAT_SO_TIMESTAMP_NEW; + goto common; + + case COMPAT_SO_TIMESTAMPNS_OLD: + type = COMPAT_SO_TIMESTAMPNS_NEW; + + /* fallthrough */ + common: + memcpy (tvts, CMSG_DATA (cmsg), sizeof (tvts)); + break; + } + + last = cmsg; + } + + if (last == NULL || type == 0) + return; + + if (CMSG_SPACE (sizeof tvts) > msgsize - msg->msg_controllen) + { + msg->msg_flags |= MSG_CTRUNC; + return; + } + + msg->msg_controllen += CMSG_SPACE (sizeof tvts); + cmsg = CMSG_NXTHDR(msg, last); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = type; + cmsg->cmsg_len = CMSG_LEN (sizeof tvts); + memcpy (CMSG_DATA (cmsg), tvts, sizeof tvts); +} +libc_hidden_def (__convert_scm_timestamps) +#endif diff --git a/sysdeps/unix/sysv/linux/getsockopt.c b/sysdeps/unix/sysv/linux/getsockopt.c index 688a7de087..f86b06dec6 100644 --- a/sysdeps/unix/sysv/linux/getsockopt.c +++ b/sysdeps/unix/sysv/linux/getsockopt.c @@ -70,6 +70,18 @@ getsockopt32 (int fd, int level, int optname, void *optval, else memcpy (optval, &tv32, sizeof tv32); } + break; + + case COMPAT_SO_TIMESTAMP_NEW: + case COMPAT_SO_TIMESTAMPNS_NEW: + { + if (optname == COMPAT_SO_TIMESTAMP_NEW) + optname = COMPAT_SO_TIMESTAMP_OLD; + if (optname == COMPAT_SO_TIMESTAMPNS_NEW) + optname = COMPAT_SO_TIMESTAMPNS_OLD; + r = getsockopt_syscall (fd, level, optname, optval, len); + } + break; } return r; diff --git a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h index 9fe7576aaa..0a48990ad8 100644 --- a/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h +++ b/sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h @@ -27,4 +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 16448 #define COMPAT_SO_SNDTIMEO_NEW 16449 +#define COMPAT_SO_TIMESTAMP_OLD 0x4012 +#define COMPAT_SO_TIMESTAMPNS_OLD 0x4013 +#define COMPAT_SO_TIMESTAMP_NEW 0x4038 +#define COMPAT_SO_TIMESTAMPNS_NEW 0x4039 + #endif diff --git a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h index 1252a8a23b..728f7aa456 100644 --- a/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h +++ b/sysdeps/unix/sysv/linux/mips/socket-constants-time64.h @@ -27,4 +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 66 #define COMPAT_SO_SNDTIMEO_NEW 67 +#define COMPAT_SO_TIMESTAMP_OLD 29 +#define COMPAT_SO_TIMESTAMPNS_OLD 35 +#define COMPAT_SO_TIMESTAMP_NEW 63 +#define COMPAT_SO_TIMESTAMPNS_NEW 64 + #endif diff --git a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h index 26e8b710ab..c231b7285a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h +++ b/sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h @@ -27,4 +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 66 #define COMPAT_SO_SNDTIMEO_NEW 67 +#define COMPAT_SO_TIMESTAMP_OLD 29 +#define COMPAT_SO_TIMESTAMPNS_OLD 35 +#define COMPAT_SO_TIMESTAMP_NEW 63 +#define COMPAT_SO_TIMESTAMPNS_NEW 64 + #endif diff --git a/sysdeps/unix/sysv/linux/recvmsg.c b/sysdeps/unix/sysv/linux/recvmsg.c index b209b4ad99..a2a600228b 100644 --- a/sysdeps/unix/sysv/linux/recvmsg.c +++ b/sysdeps/unix/sysv/linux/recvmsg.c @@ -19,16 +19,27 @@ #include #include #include -#include ssize_t __libc_recvmsg (int fd, struct msghdr *msg, int flags) { -# ifdef __ASSUME_RECVMSG_SYSCALL - return SYSCALL_CANCEL (recvmsg, fd, msg, flags); -# else - return SOCKETCALL_CANCEL (recvmsg, fd, msg, flags); -# endif + ssize_t r; +#ifndef __ASSUME_TIME64_SYSCALLS + socklen_t orig_controllen = msg->msg_controllen; +#endif + +#ifdef __ASSUME_RECVMSG_SYSCALL + r = SYSCALL_CANCEL (recvmsg, fd, msg, flags); +#else + r = SOCKETCALL_CANCEL (recvmsg, fd, msg, flags); +#endif + +#ifndef __ASSUME_TIME64_SYSCALLS + if (r >= 0) + __convert_scm_timestamps (msg, orig_controllen); +#endif + + return r; } weak_alias (__libc_recvmsg, recvmsg) weak_alias (__libc_recvmsg, __recvmsg) diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c index 6505202265..a4780a9d33 100644 --- a/sysdeps/unix/sysv/linux/setsockopt.c +++ b/sysdeps/unix/sysv/linux/setsockopt.c @@ -69,6 +69,18 @@ setsockopt32 (int fd, int level, int optname, const void *optval, r = setsockopt_syscall (fd, level, optname, &tv32, sizeof (tv32)); } + break; + + case COMPAT_SO_TIMESTAMP_NEW: + case COMPAT_SO_TIMESTAMPNS_NEW: + { + if (optname == COMPAT_SO_TIMESTAMP_NEW) + optname = COMPAT_SO_TIMESTAMP_OLD; + if (optname == COMPAT_SO_TIMESTAMPNS_NEW) + optname = COMPAT_SO_TIMESTAMPNS_OLD; + r = setsockopt_syscall (fd, level, optname, NULL, 0); + } + break; } return r; diff --git a/sysdeps/unix/sysv/linux/socket-constants-time64.h b/sysdeps/unix/sysv/linux/socket-constants-time64.h index d09c39d6c2..6cb249cc32 100644 --- a/sysdeps/unix/sysv/linux/socket-constants-time64.h +++ b/sysdeps/unix/sysv/linux/socket-constants-time64.h @@ -27,4 +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 66 #define COMPAT_SO_SNDTIMEO_NEW 67 +#define COMPAT_SO_TIMESTAMP_OLD 29 +#define COMPAT_SO_TIMESTAMPNS_OLD 35 +#define COMPAT_SO_TIMESTAMP_NEW 63 +#define COMPAT_SO_TIMESTAMPNS_NEW 64 + #endif diff --git a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h index f4668db537..4242cb6d19 100644 --- a/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h +++ b/sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h @@ -27,4 +27,9 @@ #define COMPAT_SO_RCVTIMEO_NEW 68 #define COMPAT_SO_SNDTIMEO_NEW 69 +#define COMPAT_SO_TIMESTAMP_OLD 0x001d +#define COMPAT_SO_TIMESTAMPNS_OLD 0x0021 +#define COMPAT_SO_TIMESTAMP_NEW 0x0046 +#define COMPAT_SO_TIMESTAMPNS_NEW 0x0042 + #endif From patchwork Mon Jun 7 20:35: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: 43757 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 CBAC43938C15 for ; Mon, 7 Jun 2021 20:41:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBAC43938C15 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098478; bh=VZ/JpD5uw1HH7nsRq1OYseaNJxklVnQ/8o3G9x6lvjs=; 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=G6LJ8s25rrKiKKEl8pO6WIZQz+Biwum9KMi9QMSKcqE4i7DUBe0mn8taFAQkJBlx9 xloTRaNXXJGcIla0r96CzWJxnVSjUQrki7u0Re2YSK5NUULHGg8Z0hywuQpE6t6kjz cqwCHY40ZCGnc/ZRsnanWfoqlzQ3pshd6EBNFE7M= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by sourceware.org (Postfix) with ESMTPS id 753EF3898536 for ; Mon, 7 Jun 2021 20:36:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 753EF3898536 Received: by mail-qt1-x833.google.com with SMTP id t20so13645466qtx.8 for ; Mon, 07 Jun 2021 13:36:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VZ/JpD5uw1HH7nsRq1OYseaNJxklVnQ/8o3G9x6lvjs=; b=f8q7HcWhlVw206Q+CHlxB33Zc+0kR7xyaiJIojSlWu4zrBYteeaKHDgifj4YUVc9// dBmAxc+pVnGhMP28cvLwK3owotq+xrdbrmB8ecpp9SrPvwNeMWOU3h31N1fEWQsiLubt BJ3bsDIWWTDBKMGRJJ5bfiCcjYuWHJznden3t0/AchDFPPbwiHryK3RLRn+v2dJvwqvF gyJtqN3owQIc3b4invCTgWcUJxN5TLo5UeB5IqmgSl6i9FPbYOI+vtz7a+GpgbxuaHPw uS4pJNB5KfYkDl10ituitOFuaOwq1uctTUVPa3Cul2+XZcIqq+DeOS/RMh4fHRKg2Dwb vZUA== X-Gm-Message-State: AOAM5335Q2bsH6P2Dy26wbbpeetBjmYNrUDv4L+hRy3AKGz23ixZTfL4 nqzuo1564dqUI47MBAibnEvtGzl9y+x2zQ== X-Google-Smtp-Source: ABdhPJyNF9opOXmx3Dc5DsAvfFlxK6wY7NJ57zBWVpoAGgwL+bhGp7EmXboM6IoIPa566WAuoSJ6rA== X-Received: by 2002:a05:622a:2d2:: with SMTP id a18mr17974194qtx.296.1623098188869; Mon, 07 Jun 2021 13:36:28 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:28 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 06/24] linux: Add recvvmsg fallback for 64-bit time_t SO_TIMESTAMP{NS} Date: Mon, 7 Jun 2021 17:35:55 -0300 Message-Id: <20210607203613.282543-7-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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, 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Handle the SO_TIMESTAMP{NS} similar to recvmsg: for !__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP or SO_TIMESTAMPNS and appends it to the control buffer if has extra space or returns MSG_CTRUNC otherwise. The 32-bit time field is kept as-is. Also for !__ASSUME_TIME64_SYSCALLS it limits the maximum number of 'struct mmsghdr *' to IOV_MAX (and also increases the stack size requirement to IOV_MAX times sizeof (socklen_t)). The Linux imposes a similar limit to sendmmsg, so bound the array size on recvmmsg is not unreasonable. And this will be used only on older when building with 32-bit time support. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/recvmmsg.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c b/sysdeps/unix/sysv/linux/recvmmsg.c index 672ba20332..5cd107ffa9 100644 --- a/sysdeps/unix/sysv/linux/recvmmsg.c +++ b/sysdeps/unix/sysv/linux/recvmmsg.c @@ -44,13 +44,26 @@ __recvmmsg64 (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, ts32 = valid_timespec64_to_timespec (*timeout); pts32 = &ts32; } + + socklen_t csize[IOV_MAX]; + if (vlen > IOV_MAX) + vlen = IOV_MAX; + for (int i = 0; i < vlen; i++) + csize[i] = vmessages[i].msg_hdr.msg_controllen; + # ifdef __ASSUME_RECVMMSG_SYSCALL r = SYSCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, pts32); # else r = SOCKETCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, pts32); # endif - if (r >= 0 && timeout != NULL) - *timeout = valid_timespec_to_timespec64 (ts32); + if (r >= 0) + { + if (timeout != NULL) + *timeout = valid_timespec_to_timespec64 (ts32); + + for (int i=0; i < r; i++) + __convert_scm_timestamps (&vmessages[i].msg_hdr, csize[i]); + } #endif /* __ASSUME_TIME64_SYSCALLS */ return r; } From patchwork Mon Jun 7 20:35: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: 43758 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 080BE389682A for ; Mon, 7 Jun 2021 20:42:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 080BE389682A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098529; bh=V+QeuoM/PrfFaV5DF1lG/9HsWHOhXz117YOg6/FxKL8=; 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=KdYTMkix9v8XXFV87AGdYmJ32B6FBot5kS0rvNJlHZ6bRDDA0QfQqOVWbJWH6tyTs tqcF9qKWGslj+QulfrEZl+KSiGOCFceTijTrc0/SUKh+/DHDcgSoowORiNEQWMSTjF gf37jBGz+n9g/LsyswyJiD7gn9xD1vAbKSeX9xJs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by sourceware.org (Postfix) with ESMTPS id E3B033938C0B for ; Mon, 7 Jun 2021 20:36:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E3B033938C0B Received: by mail-qt1-x832.google.com with SMTP id g12so1293869qtb.2 for ; Mon, 07 Jun 2021 13:36:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V+QeuoM/PrfFaV5DF1lG/9HsWHOhXz117YOg6/FxKL8=; b=P0SlFYzTRjo+2lgv1QYYOQFpO/B63MflYGOLWb29/Tc/SQWcNkHDeAalLOVvG2MHCJ DGNe7pV/IXb4wH9xg8Mqu5yrI4OYzlRLowGZJLQmoKldivPUi7zN6SqvSpXT77iI6Fxl x4aBNSBMUugc1HvDA+u9wRUyXa0uFDywmT3rcNiRZTV1yeRuCjmM6eOAxuBGOLd6wez9 Ef9r+sRKwnpwte/c4iUI9iIAgJJomqQ8wwCM26A779uJLRkqRGJOYSRypWEe33ZCQPeJ SKzaVr4RNmg/eK3HeohCkiTSLixKIAI56hDVe34Cp9IXYfWhSVMXcVjvRApJ9e6EavU/ v0Zw== X-Gm-Message-State: AOAM533VlAvhgHynXR/xy2siL7YnwI03AhjBmqUODDRUGH8BrFNoxO+E PSE6ZpFnO8vmUIvZ/EIiHdyfuV9rgz9EEw== X-Google-Smtp-Source: ABdhPJw5qOukMzyTVG6dyYHhtK8tfhRYUkFZs6qQxlQWnDbrv1AZuXALpZ1cHi4wY3H3aZ6AkH2qlw== X-Received: by 2002:a05:622a:13d0:: with SMTP id p16mr18643418qtk.30.1623098190427; Mon, 07 Jun 2021 13:36:30 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:30 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 07/24] y2038: Add __USE_TIME_BITS64 support for time_t Date: Mon, 7 Jun 2021 17:35:56 -0300 Message-Id: <20210607203613.282543-8-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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, 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The __USE_TIME_BITS64 is not defined internally yet. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- time/bits/types/time_t.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/time/bits/types/time_t.h b/time/bits/types/time_t.h index ab8287c6fe..84d67f6ac3 100644 --- a/time/bits/types/time_t.h +++ b/time/bits/types/time_t.h @@ -4,6 +4,10 @@ #include /* Returned by `time'. */ +#ifdef __USE_TIME_BITS64 +typedef __time64_t time_t; +#else typedef __time_t time_t; +#endif #endif From patchwork Mon Jun 7 20:35: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: 43759 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 202EF3938C16 for ; Mon, 7 Jun 2021 20:42:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 202EF3938C16 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098573; bh=qCjgCgChdLZ0qOFAGfnDWwFC+RpUdTjyFZATWC3sVn4=; 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=JntfSeY0QrjvVTSmIDuLSngv5X28IN6MP17q48cDBulnYTZyGYaSqWPPmySKxYyi/ 7y+C8szI9W0IcgUO0hd3Jghh9R2On/Lv7YMhrE9zDVPX092wZlDWjPxJrZzsmbs/yL N6Vb+B/RIpgNNntYYDXKRPIPYs0zkR27O3WbL3mc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by sourceware.org (Postfix) with ESMTPS id 8B4C03896C08 for ; Mon, 7 Jun 2021 20:36:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8B4C03896C08 Received: by mail-qv1-xf2c.google.com with SMTP id t6so3749035qvp.5 for ; Mon, 07 Jun 2021 13:36:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qCjgCgChdLZ0qOFAGfnDWwFC+RpUdTjyFZATWC3sVn4=; b=reZs5YFtXyrnJPiBL5RVbyNkie23HQg1uLtik9X+fkHEFE66wz5pDrV6+Ep4GiEwOl dSCriraRGW2UPZV6zIEWYNI3JZINpJkUv1c/Q3wzgEfyHXvUgUim0XGzQ/Pz0UImDlVm zAwBTTMiRjmvXIt9WsUSOocyFLmp/us9G/usjQcpq0YNKVynRdU8Enk0nwXhwZXGVIhX mR7XYU4K+MX70MKaK54eojBpJS87UCGrOlDKnzUP+ejUvg6BsUUXtV7UH+0qG4lTKafM WdwyqqJJEAMakiVc1MJ5liTWWZIO8Uwp/wDBtch0y0Ik4nGXcKpeLZchV0K3WQ1shAJl xVOQ== X-Gm-Message-State: AOAM531GEgvwRLGOprbUM3vZI6xE36xfO10kJJ3Vdo0xrJubNUif5zLa D3PRq9kHvZrWGxm+oWHiz9MWZxqjDj9ufg== X-Google-Smtp-Source: ABdhPJzW6Exj/Q5TOaIF5ees19GiU+buaHE1QDFtNW7VbCWvvfmpa37YRXhTsnySquKNLmTqmhX3tw== X-Received: by 2002:ad4:4704:: with SMTP id k4mr20025350qvz.13.1623098192013; Mon, 07 Jun 2021 13:36:32 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:31 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 08/24] y2038: Add __USE_TIME_BITS64 support for struct timeval Date: Mon, 7 Jun 2021 17:35:57 -0300 Message-Id: <20210607203613.282543-9-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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, 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The __USE_TIME_BITS64 is not defined internally yet. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- time/bits/types/struct_timeval.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/time/bits/types/struct_timeval.h b/time/bits/types/struct_timeval.h index 70394ce886..3466137c35 100644 --- a/time/bits/types/struct_timeval.h +++ b/time/bits/types/struct_timeval.h @@ -7,7 +7,12 @@ microsecond but also has a range of years. */ struct timeval { +#ifdef __USE_TIME_BITS64 + __time64_t tv_sec; /* Seconds. */ + __suseconds64_t tv_usec; /* Microseconds. */ +#else __time_t tv_sec; /* Seconds. */ __suseconds_t tv_usec; /* Microseconds. */ +#endif }; #endif From patchwork Mon Jun 7 20:35: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: 43760 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 2A723388CC15 for ; Mon, 7 Jun 2021 20:43:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A723388CC15 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098617; bh=gqB+BCcWS1tW7LvDU2FDD3palGM3nb12JwH6uqcc6yM=; 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=PLM04EuH6WkS/LR1BSXYMydZVEITBTtVeWpaZifwyOU6WHddQglkw1sTrhAPaLuaQ gd1UIUZDr/+s20tKyX1LI0xlVaypAIsj2kdwZw0EIjJHUjMunkqj6D7GvA8TuZYGtK HNWE+rQZ1DtbsTFm4WGAiSMkmhJThcYE450C/UJE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by sourceware.org (Postfix) with ESMTPS id 23EEC3938C0E for ; Mon, 7 Jun 2021 20:36:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 23EEC3938C0E Received: by mail-qt1-x82f.google.com with SMTP id t17so13615042qta.11 for ; Mon, 07 Jun 2021 13:36:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gqB+BCcWS1tW7LvDU2FDD3palGM3nb12JwH6uqcc6yM=; b=e2SVLDIwR9LYMckLUkhP3X6OZL2dYahYWH67yopxFkYP5mDg0OjKzVwLeqyJNCBgAd Fd0XRwB4Si7XRpSoPlFTHw+k+PgTLR5jGMgNxY0MkFZR6UoxNtUN5UflqOd/tjwfoHKk t3SouhK6Cvhj1ern9LnKftC4TEpUl9qi7kLaA2A4/7GNOp1WjzpWrdBqlRXTSZUK1C1X BEkXePhlm9SvyPA+rgiVvkh7Bh+AKsTEhed89zKLZeytA+eaufY9zvkE5D/MhgMpKK7h jZVEdkQf/Tpix91XmFQtm6lYb6NX+mwr7plpFy3Hg9XPYhiZ/b0OmoWGCFvJxzZuKq8/ ulug== X-Gm-Message-State: AOAM533wESxwbYCgmnEFq1dUiyXhbGsrRuagRPYS07J1BUxS8duF/UxS wpr88zh4eXW1dZlmTL0fIDF4pIE5uvJ4hQ== X-Google-Smtp-Source: ABdhPJzZ1X/up+GVdJgAUKkEdceC0SviLkRW55cfr+xNWvkyKzeDyt6LAyMcvR84prgnnkpZK/22WQ== X-Received: by 2002:ac8:714b:: with SMTP id h11mr18134863qtp.225.1623098193582; Mon, 07 Jun 2021 13:36:33 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:33 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 09/24] y2038: Add __USE_TIME_BITS64 support for struct timespec Date: Mon, 7 Jun 2021 17:35:58 -0300 Message-Id: <20210607203613.282543-10-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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, 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The __USE_TIME_BITS64 is not defined internally yet. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- time/bits/types/struct_timespec.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h index d11c69cfd3..4fe47a0d25 100644 --- a/time/bits/types/struct_timespec.h +++ b/time/bits/types/struct_timespec.h @@ -1,18 +1,22 @@ -/* NB: Include guard matches what uses. */ -#ifndef _STRUCT_TIMESPEC -#define _STRUCT_TIMESPEC 1 +#ifndef __struct_timespec_defined +#define __struct_timespec_defined 1 #include #include +#include /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { +#ifdef __USE_TIME_BITS64 + __time64_t tv_sec; /* Seconds. */ +#else __time_t tv_sec; /* Seconds. */ +#endif #if __WORDSIZE == 64 \ || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \ - || __TIMESIZE == 32 + || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64) __syscall_slong_t tv_nsec; /* Nanoseconds. */ #else # if __BYTE_ORDER == __BIG_ENDIAN From patchwork Mon Jun 7 20:35:59 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: 43761 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 233C13938C02 for ; Mon, 7 Jun 2021 20:44:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 233C13938C02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098661; bh=F7rUg+SKuRK1WZu4s24XbHhI2uAtJJEMBmX0E2CBYAY=; 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=ejSy9ywU+ws82L8J2tT8vdLMh9DbGeyyZAsVEUi5Q5p2X/IGDSaUgKL4Fkx48nmlh SbSS1Bg7jws9RutbAfp8L8IjvDHO4wsDR2tcZn20To9ONWT+QIKYIqdOHQBRbr4MZF 7V70Gw5I4Mlms2piL6J5Vkbwn+4GJ72v4MQ/LFf8= 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 BD5FE3938C0E for ; Mon, 7 Jun 2021 20:36:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD5FE3938C0E Received: by mail-qv1-xf2a.google.com with SMTP id x6so4712558qvx.4 for ; Mon, 07 Jun 2021 13:36:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F7rUg+SKuRK1WZu4s24XbHhI2uAtJJEMBmX0E2CBYAY=; b=tPngPafWzq72RPvJgjB6vI/U/uDcqUWD6450o5+eFJDkXjnQuEcwJRFDnr3xNJf71Y vmSRwLaTj7yhnpyC4ykkXq2jSFXtgdx9x8qIqGoO9Azb/Vatn4RUp3q4zCxamJ5Elx+J 4RMr8yH9aCqfvmF0pZ12mcxQ4qWu/nswydY84FMDy7B5CIuxveDHGl/D3EYhnkYbJ0el PGqHrVPN8q7yzH4YZkgFa6/dnkTYvphp3LX6KMcgNjwIa3wy6eBQWo+96zML+EZGTEr4 dZPk8fk58JmN1N4aAdJNy1w4ft/agfxKfO3dS3uI2/1LbSc79dYqPLywAYCXZ37UxoB7 9bqw== X-Gm-Message-State: AOAM532HS83o67UOhkAVcseJUbADCnhJhB2IXhpSaSvbEHaXs9tXemyG KAfXPA3MI8c4yg4Ki2nU/LGEb7UxHEWxVw== X-Google-Smtp-Source: ABdhPJxEkL4p0BuCsxSBNNuuekg/lncrNy96tkRXv/Mr9yxXDBQa6/y7qH8rK5YP0lBaFwo6WDKgww== X-Received: by 2002:ad4:4084:: with SMTP id l4mr15049519qvp.37.1623098195236; Mon, 07 Jun 2021 13:36:35 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:34 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 10/24] y2038: Add __USE_TIME_BITS64 support for struct utimbuf Date: Mon, 7 Jun 2021 17:35:59 -0300 Message-Id: <20210607203613.282543-11-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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, 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The __USE_TIME_BITS64 is not defined internally yet. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- io/utime.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/io/utime.h b/io/utime.h index df2299e406..c7612d0838 100644 --- a/io/utime.h +++ b/io/utime.h @@ -35,8 +35,13 @@ __BEGIN_DECLS /* Structure describing file times. */ struct utimbuf { +#ifdef __USE_TIME_BITS64 + __time64_t actime; /* Access time. */ + __time64_t modtime; /* Modification time. */ +#else __time_t actime; /* Access time. */ __time_t modtime; /* Modification time. */ +#endif }; /* Set the access and modification times of FILE to those given in From patchwork Mon Jun 7 20:36:00 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: 43762 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 01555388A432 for ; Mon, 7 Jun 2021 20:45:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01555388A432 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098705; bh=DqzCVacZAjAgBcdyiYAhCoGlWOUUp32v+6IPu7I5tBs=; 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=DlAhpx0cGcCTHlHiu1Hn8PuYW2WjHncd6eRjlScUT7XUL6g/lhI9Y1yvpa7Cu9C74 UPo9JHdUcskpoaW3cK+JP/OIXESaHF7zNEqSRhnhBrGwc7qrZctaWArbOhEiXCto/x BBllVjlQZt4K396F5Pu47vUzhEFtGTp/ZmLozV7Y= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by sourceware.org (Postfix) with ESMTPS id 5F79D3938C09 for ; Mon, 7 Jun 2021 20:36:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F79D3938C09 Received: by mail-qv1-xf33.google.com with SMTP id u14so6726514qvq.6 for ; Mon, 07 Jun 2021 13:36:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DqzCVacZAjAgBcdyiYAhCoGlWOUUp32v+6IPu7I5tBs=; b=tOcEMYysQGNrgpfAK8ti9zrW+VIUFGV1BEKEeeK5OISrwf3wja99ip76bUqP8AUa4R JwjI4Ivilm+wERpLDOCTeNwHEjCzFeg4Mde64a7TPOek3SmgbKK5BkkUwgr49uB0mI1x d82JurhoPl/MyHty5+AjpEhxCYUCg8OFvi6ZIGSimSqJ7X7q/vjDAbhO97OPp/TgrGeX /Gt8cGka/RCeg0dmZ9ELl751MC/QgjQJRjLMQY2lV6IVlgKMg4PzthNDiP4WEAZItRDn 3mEJ7/SFjF+EsFQdCsoLQOieXPfVl2LaLZqubptrrRGQPKYXgX9vCVVchBoMfrBM9PmC 0q1g== X-Gm-Message-State: AOAM533pQl54jjqWrkp6iAL2E6GH4QfBsW6w+46n5x2sUbHyiXEchMgx /hEL8HFzjyu7pvTuLsKoxPU4nNGJIgLT6w== X-Google-Smtp-Source: ABdhPJx2jSM+2LSOMBhK4UuB3lEIDX4iBiXRkvaGuZ7C2iNglcG4Rzcd6XkZkR2qs0p9bPesJ/HjKg== X-Received: by 2002:a0c:f1c2:: with SMTP id u2mr12196917qvl.1.1623098196847; Mon, 07 Jun 2021 13:36:36 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:36 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 11/24] y2038: linux: Add __USE_TIME_BITS64 support for struct timex Date: Mon, 7 Jun 2021 17:36:00 -0300 Message-Id: <20210607203613.282543-12-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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, 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The __USE_TIME_BITS64 is not defined internally yet. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/bits/timex.h | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sysdeps/unix/sysv/linux/bits/timex.h b/sysdeps/unix/sysv/linux/bits/timex.h index 9b2e30f3e0..ee37694e8f 100644 --- a/sysdeps/unix/sysv/linux/bits/timex.h +++ b/sysdeps/unix/sysv/linux/bits/timex.h @@ -25,6 +25,36 @@ struct timex { +# ifdef __USE_TIME_BITS64 + unsigned int modes; /* mode selector */ + int :32; /* pad */ + long long offset; /* time offset (usec) */ + long long freq; /* frequency offset (scaled ppm) */ + long long maxerror; /* maximum error (usec) */ + long long esterror; /* estimated error (usec) */ + int status; /* clock command/status */ + int :32; /* pad */ + long long constant; /* pll time constant */ + long long precision; /* clock precision (usec) (read only) */ + long long tolerance; /* clock frequency tolerance (ppm) (ro) */ + struct timeval time; /* (read only, except for ADJ_SETOFFSET) */ + long long tick; /* (modified) usecs between clock ticks */ + long long ppsfreq; /* pps frequency (scaled ppm) (ro) */ + long long jitter; /* pps jitter (us) (ro) */ + int shift; /* interval duration (s) (shift) (ro) */ + int :32; /* pad */ + long long stabil; /* pps stability (scaled ppm) (ro) */ + long long jitcnt; /* jitter limit exceeded (ro) */ + long long calcnt; /* calibration intervals (ro) */ + long long errcnt; /* calibration errors (ro) */ + long long stbcnt; /* stability limit exceeded (ro) */ + + int tai; /* TAI offset (ro) */ + + int :32; int :32; int :32; int :32; + int :32; int :32; int :32; int :32; + int :32; int :32; int :32; +# else unsigned int modes; /* mode selector */ __syscall_slong_t offset; /* time offset (usec) */ __syscall_slong_t freq; /* frequency offset (scaled ppm) */ @@ -51,6 +81,7 @@ struct timex int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; +# endif }; /* Mode codes (timex.mode) */ From patchwork Mon Jun 7 20:36:01 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: 43764 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 A76AA389364F for ; Mon, 7 Jun 2021 20:46:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A76AA389364F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098799; bh=TWvonoffZCHaWPhVpfdeMkDEyRzHkOKNq6Z5LXrgXzM=; 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=ccGeuPbVyPgjT6T7VRDGRcpBwcEjH6f59ETzvezq1jTageO6ZYd8I+0SMLVJfYmNV txMcLebBRdwIQy7y1jHGFuZ22KVKexHCX3TTwHG1HllBNVBV8xlGFOkb/C45c3z1aJ aLGZQ4LCgdGb0Y4jYqrNZRQtvCNVQdQ+cQytgAiA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by sourceware.org (Postfix) with ESMTPS id 845BE3938C0A for ; Mon, 7 Jun 2021 20:36:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 845BE3938C0A Received: by mail-qk1-x72b.google.com with SMTP id c18so2989056qkc.11 for ; Mon, 07 Jun 2021 13:36:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TWvonoffZCHaWPhVpfdeMkDEyRzHkOKNq6Z5LXrgXzM=; b=THrBOPYrf2/juaFktIJ4VdO2YcDVngmMr503pZGjvQvyWynQguJxrZsck9t2JVsHVe j3fUuE7x1rw+GsXxOoOmQaTdQp8+2qAlG3Ak1j9YvjyQh0S/mLV9sqdBMTBkRRtH2Wpu ldHXUWVhYqcSNI8moXNU8C5PlwhXrmnGF28rMHn/R1y0ViC4JDR1Mq26o4tMMSSaJUqk NgLY48Egqh3IvGE+m3QSYnGO/wmBr9El9GGJoEGR9I03qNv7EZpj57bOCply4W9OZ8Aq Y/r3hFOudt9IPGeGxfESZm1SmPZ1+dVbRUAaDyIjUG67a2k3fKm+EAsuW4Osl13PtJs3 3lvg== X-Gm-Message-State: AOAM531oiepDDcyD2kg1oCEVBfJ8HW1pg7HxJX30ECWECp7PhSLaZHE7 ejP2NE0p+LWINafhF56vhgZNwW8/F5vbjQ== X-Google-Smtp-Source: ABdhPJyEfkZKTUEyqEt4MtRDqppbJ6IijNt3y5HSMToyohGbOVkj1cBuggugGpowUylg00ESumfw1w== X-Received: by 2002:a05:620a:2111:: with SMTP id l17mr11419688qkl.19.1623098198658; Mon, 07 Jun 2021 13:36:38 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:38 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 12/24] y2038: Use a common definition for stat Date: Mon, 7 Jun 2021 17:36:01 -0300 Message-Id: <20210607203613.282543-13-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" From: Lukasz Majewski Instead of replicate the same definitions from struct_stat_time64.h on the multiple struct_stat.h, use a common header which is included when required (struct_stat_time64_helper.h). The 64-bit time support is added only for LFS support. The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit stat implementations. Reviewed-by: Carlos O'Donell Tested-by: carlos O'Donell --- sysdeps/unix/sysv/linux/Makefile | 3 +- sysdeps/unix/sysv/linux/bits/struct_stat.h | 50 ++++++----- .../linux/bits/struct_stat_time64_helper.h | 66 ++++++++++++++ .../unix/sysv/linux/m68k/bits/struct_stat.h | 50 ++++++----- .../sysv/linux/microblaze/bits/struct_stat.h | 48 ++++++---- .../unix/sysv/linux/mips/bits/struct_stat.h | 89 ++++++++++-------- .../sysv/linux/powerpc/bits/struct_stat.h | 52 ++++++----- .../unix/sysv/linux/s390/bits/struct_stat.h | 56 +++++++----- sysdeps/unix/sysv/linux/struct_stat_time64.h | 59 +----------- .../unix/sysv/linux/x86/bits/struct_stat.h | 90 ++++++++++--------- 10 files changed, 320 insertions(+), 243 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 36d5ae020c..c343d8c7d0 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -100,7 +100,8 @@ sysdep_headers += sys/mount.h sys/acct.h \ bits/types/struct_msqid_ds.h \ bits/types/struct_shmid_ds.h \ bits/ipc-perm.h \ - bits/struct_stat.h + bits/struct_stat.h \ + bits/struct_stat_time64_helper.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat.h b/sysdeps/unix/sysv/linux/bits/struct_stat.h index b852ee256e..298418966f 100644 --- a/sysdeps/unix/sysv/linux/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/bits/struct_stat.h @@ -28,32 +28,35 @@ struct stat { +#ifdef __USE_TIME_BITS64 +# include +#else __dev_t st_dev; /* Device. */ unsigned short int __pad1; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ -#else +# else __ino_t __st_ino; /* 32bit file serial number. */ -#endif +# endif __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ __dev_t st_rdev; /* Device number, if device. */ unsigned short int __pad2; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ -#else +# else __off64_t st_size; /* Size of file, in bytes. */ -#endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -#else +# else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#endif -#ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -63,28 +66,32 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif -#ifndef __USE_FILE_OFFSET64 +# endif +# ifndef __USE_FILE_OFFSET64 unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -#else +# else __ino64_t st_ino; /* File serial number. */ -#endif +# endif +#endif /* __USE_TIME_BITS64 */ }; #ifdef __USE_LARGEFILE64 struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ unsigned int __pad1; @@ -99,7 +106,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -109,15 +116,16 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# else +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif __ino64_t st_ino; /* File serial number. */ +# endif /* __USE_TIME_BITS64 */ }; #endif diff --git a/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h new file mode 100644 index 0000000000..04e0ca7386 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/struct_stat_time64_helper.h @@ -0,0 +1,66 @@ +/* Definition for helper to define struct stat with 64-bit time. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + + /* Content of internal __stat64_t64 struct. */ + __dev_t st_dev; /* Device. */ + __ino64_t st_ino; /* file serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group. */ + __dev_t st_rdev; /* Device number, if device. */ + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +#ifdef __USE_XOPEN2K8 +# ifndef __struct_timespec +# define __struct_timespec struct timespec +# endif + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + __struct_timespec st_atim; + __struct_timespec st_mtim; + __struct_timespec st_ctim; +# define st_atime st_atim.tv_sec +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# undef __struct_timespec +#else +/* The definition should be equal to the 'struct __timespec64' internal + layout. */ +# if __BYTE_ORDER == __BIG_ENDIAN +# define __fieldts64(name) \ + __time64_t name; __int32_t :32; __int32_t name ## nsec +# else +# define __fieldts64(name) \ + __time64_t name; __int32_t name ## nsec; __int32_t :32 +# endif + + __fieldts64 (st_atime); + __fieldts64 (st_mtime); + __fieldts64 (st_ctime); + + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; + +# undef __fieldts64 +#endif diff --git a/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h b/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h index 4ae7506eb5..0512ecc3bc 100644 --- a/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/m68k/bits/struct_stat.h @@ -25,32 +25,35 @@ struct stat { +#ifdef __USE_TIME_BITS64 +# include +#else __dev_t st_dev; /* Device. */ unsigned short int __pad1; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ -#else +# else __ino_t __st_ino; /* 32bit file serial number. */ -#endif +# endif __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ __dev_t st_rdev; /* Device number, if device. */ unsigned short int __pad2; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ -#else +# else __off64_t st_size; /* Size of file, in bytes. */ -#endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -#else +# else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#endif -#ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -60,28 +63,32 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif -#ifndef __USE_FILE_OFFSET64 +# endif +# ifndef __USE_FILE_OFFSET64 unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -#else +# else __ino64_t st_ino; /* File serial number. */ -#endif +# endif +#endif /* __USE_TIME_BITS64 */ }; #ifdef __USE_LARGEFILE64 struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ unsigned short int __pad1; @@ -96,7 +103,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -106,15 +113,16 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# else +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif __ino64_t st_ino; /* File serial number. */ +# endif /* __USE_TIME_BITS64 */ }; #endif diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h index be1bdc3557..0284d4b2b2 100644 --- a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h @@ -26,6 +26,9 @@ #ifndef __USE_FILE_OFFSET64 struct stat { +#ifdef __USE_TIME_BITS64 +# include +#else __dev_t st_dev; /* Device. */ __ino_t st_ino; /* File serial number. */ __mode_t st_mode; /* File mode. */ @@ -38,7 +41,7 @@ struct stat __blksize_t st_blksize; /* Optimal block size for I/O. */ int __pad3; __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format * equivalent to 'struct timespec'. This is the type used * whenever possible but the Unix namespace rules do not allow the @@ -48,19 +51,20 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif unsigned int __glibc_reserved4; unsigned int __glibc_reserved5; +#endif /* __USE_TIME_BITS64 */ }; #else /* __USE_FILE_OFFSET64 */ /* MS: If __USE_FILE_OFFSET64 is setup then struct stat should match stat64 @@ -70,6 +74,9 @@ struct stat * create one ifdef to separate stats structures. */ struct stat { +#ifdef __USE_TIME_BITS64 +# include +#else unsigned long long st_dev; /* Device. */ __ino64_t st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ @@ -82,7 +89,7 @@ struct stat __blksize_t st_blksize; /* Optimal block size for I/O. */ int __pad3; __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_MISC +# ifdef __USE_MISC /* Nanosecond resolution timestamps are stored in a format * equivalent to 'struct timespec'. This is the type used * whenever possible but the Unix namespace rules do not allow the @@ -92,25 +99,29 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif unsigned int __glibc_reserved4; unsigned int __glibc_reserved5; +# endif /* __USE_TIME_BITS64 */ }; #endif /* __USE_FILE_OFFSET64 */ #ifdef __USE_LARGEFILE64 struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else unsigned long long st_dev; /* Device. */ __ino64_t st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ @@ -123,7 +134,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ int __pad3; __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format * equivalent to 'struct timespec'. This is the type used * whenever possible but the Unix namespace rules do not allow the @@ -133,19 +144,20 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif unsigned int __glibc_reserved4; unsigned int __glibc_reserved5; +# endif /* __USE_TIME_BITS64 */ }; #endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h b/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h index 7ae4c10827..ab9f474cbc 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/mips/bits/struct_stat.h @@ -29,28 +29,31 @@ /* Structure describing file characteristics. */ struct stat { +# ifdef __USE_TIME_BITS64 +# include +# else unsigned long int st_dev; long int st_pad1[3]; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ -#else +# else __ino64_t st_ino; /* File serial number. */ -#endif +# endif __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ unsigned long int st_rdev; /* Device number, if device. */ -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 long int st_pad2[2]; __off_t st_size; /* Size of file, in bytes. */ /* SVR4 added this extra long to allow for expansion of off_t. */ long int st_pad3; -#else +# else long int st_pad2[3]; __off64_t st_size; /* Size of file, in bytes. */ -#endif -#ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -60,30 +63,34 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ -#else +# else long int st_pad4; __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ -#endif +# endif long int st_pad5[14]; +# endif /* __USE_TIME_BITS64 */ }; -#ifdef __USE_LARGEFILE64 +# ifdef __USE_LARGEFILE64 struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else unsigned long int st_dev; long int st_pad1[3]; __ino64_t st_ino; /* File serial number. */ @@ -94,7 +101,7 @@ struct stat64 unsigned long int st_rdev; /* Device number, if device. */ long int st_pad2[3]; __off64_t st_size; /* Size of file, in bytes. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -104,44 +111,47 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# else +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ long int st_pad3; __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ long int st_pad4[14]; +# endif /* __USE_TIME_BITS64 */ }; -#endif -#else +# endif /* __USE_LARGEFILE64 */ + +#else /* _MIPS_SIM != _ABIO32 */ + struct stat { __dev_t st_dev; int st_pad1[3]; /* Reserved for st_dev expansion */ -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __ino_t st_ino; -#else +# else __ino64_t st_ino; -#endif +# endif __mode_t st_mode; __nlink_t st_nlink; __uid_t st_uid; __gid_t st_gid; __dev_t st_rdev; -#if !defined __USE_FILE_OFFSET64 +# if !defined __USE_FILE_OFFSET64 unsigned int st_pad2[2]; /* Reserved for st_rdev expansion */ __off_t st_size; int st_pad3; -#else +# else unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ __off64_t st_size; -#endif -#ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -151,24 +161,24 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif +# endif __blksize_t st_blksize; unsigned int st_pad4; -#ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; -#else +# else __blkcnt64_t st_blocks; -#endif +# endif int st_pad5[14]; }; @@ -185,7 +195,7 @@ struct stat64 __dev_t st_rdev; unsigned int st_pad2[3]; /* Reserved for st_rdev expansion */ __off64_t st_size; -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -195,20 +205,21 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# else +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif __blksize_t st_blksize; unsigned int st_pad3; __blkcnt64_t st_blocks; int st_pad4[14]; }; #endif + #endif /* Tell code we have these members. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h index 12caab2790..f55eb658a2 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/struct_stat.h @@ -26,35 +26,37 @@ #include #if __WORDSIZE == 32 - struct stat { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ -# ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 unsigned short int __pad1; __ino_t st_ino; /* File serial number. */ -# else +# else __ino64_t st_ino; /* File serial number. */ -# endif +# endif __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ __dev_t st_rdev; /* Device number, if device. */ unsigned short int __pad2; -# ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ -# else +# else __off64_t st_size; /* Size of file, in bytes. */ -# endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -# ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -# else +# else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# endif -# ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -64,25 +66,28 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; +# endif /* __USE_TIME_BITS64 */ }; - # ifdef __USE_LARGEFILE64 struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ __ino64_t st_ino; /* File serial number. */ __mode_t st_mode; /* File mode. */ @@ -94,7 +99,7 @@ struct stat64 __off64_t st_size; /* Size of file, in bytes. */ __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -104,19 +109,20 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; +# endif /* __USE_TIME_BITS64 */ }; # endif /* __USE_LARGEFILE64 */ diff --git a/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h b/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h index a733622cf5..f2933b8b12 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/s390/bits/struct_stat.h @@ -65,32 +65,35 @@ struct stat #else struct stat { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ unsigned int __pad1; -# ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ -# else +# else __ino_t __st_ino; /* 32bit file serial number. */ -# endif +# endif __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ __dev_t st_rdev; /* Device number, if device. */ unsigned int __pad2; -# ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ -# else +# else __off64_t st_size; /* Size of file, in bytes. */ -# endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -# ifndef __USE_FILE_OFFSET64 +# ifndef __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -# else +# else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# endif -# ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -100,25 +103,26 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif -# ifndef __USE_FILE_OFFSET64 +# endif +# ifndef __USE_FILE_OFFSET64 unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# else +# else __ino64_t st_ino; /* File serial number. */ +# endif # endif }; -#endif +# endif #ifdef __USE_LARGEFILE64 # if __WORDSIZE == 64 @@ -162,6 +166,9 @@ struct stat64 # else struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ unsigned int __pad1; @@ -176,7 +183,7 @@ struct stat64 __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -186,18 +193,19 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ -# endif +# endif __ino64_t st_ino; /* File serial number. */ +# endif }; # endif #endif diff --git a/sysdeps/unix/sysv/linux/struct_stat_time64.h b/sysdeps/unix/sysv/linux/struct_stat_time64.h index f0a29d7fe5..260d1812be 100644 --- a/sysdeps/unix/sysv/linux/struct_stat_time64.h +++ b/sysdeps/unix/sysv/linux/struct_stat_time64.h @@ -22,64 +22,13 @@ #if __TIMESIZE == 64 # define __stat64_t64 stat64 #else -# ifdef __USE_LARGEFILE64 -# include - -/* The definition should be equal to the 'struct __timespec64' internal - layout. */ -# if BYTE_ORDER == BIG_ENDIAN -# define __fieldts64(name) \ - __time64_t name; __int32_t :32; __int32_t name ## nsec -# else -# define __fieldts64(name) \ - __time64_t name; __int32_t name ## nsec; __int32_t :32 -# endif - -/* Workaround for the definition from struct_stat.h */ -# undef st_atime -# undef st_mtime -# undef st_ctime +# include struct __stat64_t64 { - __dev_t st_dev; /* Device. */ - __ino64_t st_ino; /* file serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __off64_t st_size; /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct __timespec64 st_atim; /* Time of last access. */ - struct __timespec64 st_mtim; /* Time of last modification. */ - struct __timespec64 st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -# else - __fieldts64 (st_atime); - __fieldts64 (st_mtime); - __fieldts64 (st_ctime); -# endif /* __USE_XOPEN2K8 */ +# define __struct_timespec struct __timespec64 +# include }; - -# define _STATBUF_ST_BLKSIZE -# define _STATBUF_ST_RDEV -# define _STATBUF_ST_NSEC - -# undef __fieldts64 - -# endif /* __USE_LARGEFILE64 */ - -# endif /* __TIMESIZE == 64 */ +#endif /* __TIMESIZE == 64 */ #endif /* _BITS_STRUCT_STAT_TIME64_H */ diff --git a/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h b/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h index 6ddd01db46..01ee7ff6b3 100644 --- a/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h +++ b/sysdeps/unix/sysv/linux/x86/bits/struct_stat.h @@ -25,43 +25,46 @@ struct stat { +#ifdef __USE_TIME_BITS64 +# include +#else __dev_t st_dev; /* Device. */ -#ifndef __x86_64__ +# ifndef __x86_64__ unsigned short int __pad1; -#endif -#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 +# endif +# if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __ino_t st_ino; /* File serial number. */ -#else +# else __ino_t __st_ino; /* 32bit file serial number. */ -#endif -#ifndef __x86_64__ +# endif +# ifndef __x86_64__ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ -#else +# else __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ -#endif +# endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ -#ifdef __x86_64__ +# ifdef __x86_64__ int __pad0; -#endif +# endif __dev_t st_rdev; /* Device number, if device. */ -#ifndef __x86_64__ +# ifndef __x86_64__ unsigned short int __pad2; -#endif -#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 +# endif +# if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __off_t st_size; /* Size of file, in bytes. */ -#else +# else __off64_t st_size; /* Size of file, in bytes. */ -#endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ -#if defined __x86_64__ || !defined __USE_FILE_OFFSET64 +# if defined __x86_64__ || !defined __USE_FILE_OFFSET64 __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */ -#else +# else __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ -#endif -#ifdef __USE_XOPEN2K8 +# endif +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -71,58 +74,62 @@ struct stat struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +# else __time_t st_atime; /* Time of last access. */ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ -#endif -#ifdef __x86_64__ +# endif +# ifdef __x86_64__ __syscall_slong_t __glibc_reserved[3]; -#else -# ifndef __USE_FILE_OFFSET64 +# else +# ifndef __USE_FILE_OFFSET64 unsigned long int __glibc_reserved4; unsigned long int __glibc_reserved5; -# else +# else __ino64_t st_ino; /* File serial number. */ +# endif # endif -#endif +#endif /* __USE_TIME_BITS64 */ }; #ifdef __USE_LARGEFILE64 /* Note stat64 has the same shape as stat for x86-64. */ struct stat64 { +# ifdef __USE_TIME_BITS64 +# include +# else __dev_t st_dev; /* Device. */ -# ifdef __x86_64__ +# ifdef __x86_64__ __ino64_t st_ino; /* File serial number. */ __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ -# else +# else unsigned int __pad1; __ino_t __st_ino; /* 32bit file serial number. */ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ -# endif +# endif __uid_t st_uid; /* User ID of the file's owner. */ __gid_t st_gid; /* Group ID of the file's group.*/ -# ifdef __x86_64__ +# ifdef __x86_64__ int __pad0; __dev_t st_rdev; /* Device number, if device. */ __off_t st_size; /* Size of file, in bytes. */ -# else +# else __dev_t st_rdev; /* Device number, if device. */ unsigned int __pad2; __off64_t st_size; /* Size of file, in bytes. */ -# endif +# endif __blksize_t st_blksize; /* Optimal block size for I/O. */ __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ -# ifdef __USE_XOPEN2K8 +# ifdef __USE_XOPEN2K8 /* Nanosecond resolution timestamps are stored in a format equivalent to 'struct timespec'. This is the type used whenever possible but the Unix namespace rules do not allow the @@ -132,19 +139,20 @@ struct stat64 struct timespec st_atim; /* Time of last access. */ struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ -# else +# else __time_t st_atime; /* Time of last access. */ __syscall_ulong_t st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ __syscall_ulong_t st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ __syscall_ulong_t st_ctimensec; /* Nsecs of last status change. */ -# endif -# ifdef __x86_64__ +# endif +# ifdef __x86_64__ __syscall_slong_t __glibc_reserved[3]; -# else +# else __ino64_t st_ino; /* File serial number. */ -# endif +# endif +# endif /* __USE_TIME_BITS64 */ }; #endif From patchwork Mon Jun 7 20:36:02 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: 43763 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 E9A5A3938C31 for ; Mon, 7 Jun 2021 20:45:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9A5A3938C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098749; bh=uTWLtcvxWCzG0bdZx2/R95K43qLSL5PfTQGE3WOY5rk=; 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=izNeiqPlx88k0j19t8+IN+0C19NRimcM0uu/b/mc6S/V7bkpGIkIZFcde3+nWMr2s RfVE+bnHupUo14fLihMzOsMmVPbxRLbHyZC51vkz8ERX+H29CNAlyGP2d6OjSeQNu6 dHnW6s8gaD/ZG+wTpdkJU9WpLfo87NNDis6sg7Wg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id E2D44388A83A for ; Mon, 7 Jun 2021 20:36:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E2D44388A83A Received: by mail-qt1-x831.google.com with SMTP id s12so13653834qta.3 for ; Mon, 07 Jun 2021 13:36:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uTWLtcvxWCzG0bdZx2/R95K43qLSL5PfTQGE3WOY5rk=; b=BVNwDo5/cB1gSWzqcZXyaG7OWyG6e5qTQsqQUuxgYxWIQCTY6Ejgli54KHgsn/3gL1 Ssw5b+uWz16DkYFxAbDsOhBxhlx+EhF2bkX6RcXJUqL8FWK1tvg9gLTaAl6X9xb7HtRh gYO1ICs5INF42Y876x7Xn6E3soZ822yTH3WINcDuzvAkVoZU4vzHyY+TjXBC6jcfqJHh OHmHc8Uec72taYMxepu0NlHjJkuBH3AjYzEge+a5JUh3uhFLKVmNk/dGyTH/KaYotkI/ hTTedqqQt62uqUCK6oqWQv7B32/JQYQ6aaLRawq26Tu71MrmZeoGGn86fBXaSx4v9Oyc oiPg== X-Gm-Message-State: AOAM532ToFbJhZIHb/kvJeJrvqz5hsxNUzcDUk4spLCBxFO+QuQRlJXo IvOwgJSAhL0bGyJTOColKTeXUMrfL7Zn7g== X-Google-Smtp-Source: ABdhPJyKY6ymEzX8s+bAdJhgexrRLYOS4tABAS9YnVGhToBz9a4pdO1AdHJAQzw8yfPXQUXKLRdHYg== X-Received: by 2002:ac8:4654:: with SMTP id f20mr8481656qto.144.1623098200292; Mon, 07 Jun 2021 13:36:40 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:39 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 13/24] y2038: Use a common definition for msqid_ds Date: Mon, 7 Jun 2021 17:36:02 -0300 Message-Id: <20210607203613.282543-14-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" From: Lukasz Majewski Instead of replicate the same definitions from struct_msqid64_ds.h on the multiple struct_msqid_ds.h, use a common header which is included when required (struct_msqid64_ds_helper.h). The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit stat implementations. Reviewed-by: Carlos O'Donell Tested-by: carlos O'Donell --- sysdeps/unix/sysv/linux/Makefile | 3 +- .../sysv/linux/bits/types/struct_msqid64_ds.h | 10 +------ .../bits/types/struct_msqid64_ds_helper.h | 30 +++++++++++++++++++ .../sysv/linux/bits/types/struct_msqid_ds.h | 12 ++++++-- .../linux/hppa/bits/types/struct_msqid_ds.h | 12 ++++++-- .../linux/mips/bits/types/struct_msqid_ds.h | 18 +++++++---- .../powerpc/bits/types/struct_msqid_ds.h | 12 ++++++-- .../linux/sparc/bits/types/struct_msqid_ds.h | 12 ++++++-- 8 files changed, 81 insertions(+), 28 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index c343d8c7d0..6715a4b623 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -101,7 +101,8 @@ sysdep_headers += sys/mount.h sys/acct.h \ bits/types/struct_shmid_ds.h \ bits/ipc-perm.h \ bits/struct_stat.h \ - bits/struct_stat_time64_helper.h + bits/struct_stat_time64_helper.h \ + bits/types/struct_msqid64_ds_helper.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h index 43e8cd7cfc..992734914a 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds.h @@ -25,14 +25,6 @@ #else struct __msqid64_ds { - struct ipc_perm msg_perm; /* structure describing operation permission */ - __time64_t msg_stime; /* time of last msgsnd command */ - __time64_t msg_rtime; /* time of last msgsnd command */ - __time64_t msg_ctime; /* time of last change */ - __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ - msgqnum_t msg_qnum; /* number of messages currently on queue */ - msglen_t msg_qbytes; /* max number of bytes allowed on queue */ - __pid_t msg_lspid; /* pid of last msgsnd() */ - __pid_t msg_lrpid; /* pid of last msgrcv() */ +# include }; #endif diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h new file mode 100644 index 0000000000..58da9f223b --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid64_ds_helper.h @@ -0,0 +1,30 @@ +/* Common definitions for struct msqid_ds with 64-bit time. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + + /* Content of internal __msqid64_ds. */ + struct ipc_perm msg_perm; /* structure describing operation permission */ + __time64_t msg_stime; /* time of last msgsnd command */ + __time64_t msg_rtime; /* time of last msgsnd command */ + __time64_t msg_ctime; /* time of last change */ + __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ + msgqnum_t msg_qnum; /* number of messages currently on queue */ + msglen_t msg_qbytes; /* max number of bytes allowed on queue */ + __pid_t msg_lspid; /* pid of last msgsnd() */ + __pid_t msg_lrpid; /* pid of last msgrcv() */ + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h index 1ed041ae30..ae10a48452 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_msqid_ds.h @@ -20,23 +20,28 @@ # error "Never use directly; include instead." #endif +#include + /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm msg_perm; /* structure describing operation permission */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_stime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_ctime; /* time of last change */ unsigned long int __msg_ctime_high; -#else +# else __time_t msg_stime; /* time of last msgsnd command */ __time_t msg_rtime; /* time of last msgsnd command */ __time_t msg_ctime; /* time of last change */ -#endif +# endif __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ @@ -44,4 +49,5 @@ struct msqid_ds __pid_t msg_lrpid; /* pid of last msgrcv() */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; +#endif }; diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h index d943edeb78..5b82dd7f5e 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_msqid_ds.h @@ -20,23 +20,28 @@ # error "Never use directly; include instead." #endif +#include + /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm msg_perm; /* structure describing operation permission */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __msg_stime_high; __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_ctime_high; __time_t msg_ctime; /* time of last change */ -#else +# else __time_t msg_stime; /* time of last msgsnd command */ __time_t msg_rtime; /* time of last msgsnd command */ __time_t msg_ctime; /* time of last change */ -#endif +# endif __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ @@ -44,4 +49,5 @@ struct msqid_ds __pid_t msg_lrpid; /* pid of last msgrcv() */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; +#endif }; diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h index bdca5e5fe2..00c1804245 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h +++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_msqid_ds.h @@ -20,32 +20,37 @@ # error "Never use directly; include instead." #endif +#include + /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm msg_perm; /* structure describing operation permission */ -#if __TIMESIZE == 32 -# ifdef __MIPSEL__ +# if __TIMESIZE == 32 +# ifdef __MIPSEL__ __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_stime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_ctime; /* time of last change */ unsigned long int __msg_ctime_high; -# else +# else unsigned long int __msg_stime_high; __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_ctime_high; __time_t msg_ctime; /* time of last change */ -# endif -#else +# endif +# else __time_t msg_stime; /* time of last msgsnd command */ __time_t msg_rtime; /* time of last msgsnd command */ __time_t msg_ctime; /* time of last change */ -#endif +# endif __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ @@ -53,4 +58,5 @@ struct msqid_ds __pid_t msg_lrpid; /* pid of last msgrcv() */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; +#endif }; diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h index 72842ed747..8c296d2342 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_msqid_ds.h @@ -20,23 +20,28 @@ # error "Never use directly; include instead." #endif +#include + /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm msg_perm; /* structure describing operation permission */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __msg_stime_high; __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_ctime_high; __time_t msg_ctime; /* time of last change */ -#else +# else __time_t msg_stime; /* time of last msgsnd command */ __time_t msg_rtime; /* time of last msgsnd command */ __time_t msg_ctime; /* time of last change */ -#endif +# endif __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ @@ -44,4 +49,5 @@ struct msqid_ds __pid_t msg_lrpid; /* pid of last msgrcv() */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; +#endif }; diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h index 22e1839de1..3c1b68ccc0 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_msqid_ds.h @@ -20,23 +20,28 @@ # error "Never use directly; include instead." #endif +#include + /* Structure of record for one message inside the kernel. The type `struct msg' is opaque. */ struct msqid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm msg_perm; /* structure describing operation permission */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __msg_stime_high; __time_t msg_stime; /* time of last msgsnd command */ unsigned long int __msg_rtime_high; __time_t msg_rtime; /* time of last msgsnd command */ unsigned long int __msg_ctime_high; __time_t msg_ctime; /* time of last change */ -#else +# else __time_t msg_stime; /* time of last msgsnd command */ __time_t msg_rtime; /* time of last msgsnd command */ __time_t msg_ctime; /* time of last change */ -#endif +# endif __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ msgqnum_t msg_qnum; /* number of messages currently on queue */ msglen_t msg_qbytes; /* max number of bytes allowed on queue */ @@ -44,4 +49,5 @@ struct msqid_ds __pid_t msg_lrpid; /* pid of last msgrcv() */ __syscall_ulong_t __glibc_reserved4; __syscall_ulong_t __glibc_reserved5; +#endif }; From patchwork Mon Jun 7 20:36:03 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: 43765 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 4B95E3938C1C for ; Mon, 7 Jun 2021 20:47:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B95E3938C1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098844; bh=WVD3ZWieTFWHd4YggxkRdkjd9PgOZ1zJcrASO+L1Iu0=; 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=UZuwRfxLuNeBjj04V3gRNI5BrAgqPzWaZvooxjsVZrYMLD4O9kfW24jHBOGZMYF9Z 1D5MqGqx2gksbOo26dw+JBU5ZvZbx+1JF7jtxqImEGNXZ+2W6Id5DhAUgy1RebGGxS Ft+L5doDEwEvwnpoYmurDhcwJNknV+f7RQSSkHAY= 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 893CE3938C0B for ; Mon, 7 Jun 2021 20:36:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 893CE3938C0B Received: by mail-qt1-x82a.google.com with SMTP id p21so1890564qtw.6 for ; Mon, 07 Jun 2021 13:36:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WVD3ZWieTFWHd4YggxkRdkjd9PgOZ1zJcrASO+L1Iu0=; b=UO7LiPAQ63Rt4IYGeKvpZj4MewKU693nNqj1NP7k5R/cfCamPfdAPlhTRbqnDebm72 X8lbUbKvJXw4ucx6q0CX1di4weZnunOx0rzoxXI847Ux7g+8jTEzQDqd7idL5mGMBqHU aoLkVDdI1GzU1K1WA1r4iAr+FS9kK45VMlo0tfdvwkxCAcppyzEIEnp0V3UIw6Ory9n2 Xs6R58lJFJ/KOYEqugTmFp1ceNH9nZyV2jAXMYaUo/CT+DC8lr7jMR2soGGFQB0m8ctN ZpoSguV4toVeEpffsIpf+CM/8fKcHmHqy30Jvwbz9/Ko5glTSswUueNZByWsYFkNA5mK ftqw== X-Gm-Message-State: AOAM531hPWzq17lU7CmUXeMkcCFJPLCzuj6UTbNxDTGrGKYFHdfLQUn7 +ilGTq6B1hgUvcaeZRwP3lAOQDB/gK0ZIw== X-Google-Smtp-Source: ABdhPJz6mDNR8Elu4Aj+tpbV8ODh/f0w6tV6JzgsKBSircXSyJ7UojM0ZRGPp1TNx1iHwOeTy1ShSw== X-Received: by 2002:ac8:7699:: with SMTP id g25mr11922163qtr.309.1623098201918; Mon, 07 Jun 2021 13:36:41 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:41 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 14/24] y2038: Use a common definition for semid_ds Date: Mon, 7 Jun 2021 17:36:03 -0300 Message-Id: <20210607203613.282543-15-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Instead of replicate the same definitions from struct_semid64_ds.h on the multiple struct_semid_ds.h, use a common header which is included when required (struct_semid64_ds_helper.h). The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit semctl implementation. Reviewed-by: Carlos O'Donell Tested-by: carlos O'Donell --- sysdeps/unix/sysv/linux/Makefile | 3 ++- .../sysv/linux/bits/types/struct_semid64_ds.h | 5 +--- .../bits/types/struct_semid64_ds_helper.h | 25 +++++++++++++++++++ .../sysv/linux/bits/types/struct_semid_ds.h | 10 +++++--- .../linux/hppa/bits/types/struct_semid_ds.h | 4 +++ .../linux/mips/bits/types/struct_semid_ds.h | 4 +++ .../powerpc/bits/types/struct_semid_ds.h | 10 +++++--- .../linux/sparc/bits/types/struct_semid_ds.h | 10 +++++--- .../linux/x86/bits/types/struct_semid_ds.h | 4 +++ 9 files changed, 61 insertions(+), 14 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 6715a4b623..b6abcb1365 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -102,7 +102,8 @@ sysdep_headers += sys/mount.h sys/acct.h \ bits/ipc-perm.h \ bits/struct_stat.h \ bits/struct_stat_time64_helper.h \ - bits/types/struct_msqid64_ds_helper.h + bits/types/struct_msqid64_ds_helper.h \ + bits/types/struct_semid64_ds_helper.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h index 7263e50bbf..adaee3eb9e 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds.h @@ -25,9 +25,6 @@ #else struct __semid64_ds { - struct ipc_perm sem_perm; /* operation permission struct */ - __time64_t sem_otime; /* last semop() time */ - __time64_t sem_ctime; /* last time changed by semctl() */ - __syscall_ulong_t sem_nsems; /* number of semaphores in set */ +# include }; #endif diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h new file mode 100644 index 0000000000..e6592e6c3f --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid64_ds_helper.h @@ -0,0 +1,25 @@ +/* Common definitions for struct semid_ds with 64-bit time. + Copyright (C) 2020-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + + /* Content of internal __semid64_ds. */ + struct ipc_perm sem_perm; /* operation permission struct */ + __time64_t sem_otime; /* last semop() time */ + __time64_t sem_ctime; /* last time changed by semctl() */ + __syscall_ulong_t sem_nsems; /* number of semaphores in set */ + unsigned long int __glibc_reserved3; + unsigned long int __glibc_reserved4; diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h index 2f32fa500e..a7b2c9022e 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h @@ -23,17 +23,21 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __time_t sem_otime; /* last semop() time */ __syscall_ulong_t __sem_otime_high; __time_t sem_ctime; /* last time changed by semctl() */ __syscall_ulong_t __sem_ctime_high; -#else +# else __time_t sem_otime; __time_t sem_ctime; -#endif +# endif __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; +#endif }; diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h index 16a9735e7b..5067fb1572 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h @@ -23,6 +23,9 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ __syscall_ulong_t __sem_otime_high; __time_t sem_otime; /* last semop() time */ @@ -31,4 +34,5 @@ struct semid_ds __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; +#endif }; diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h index 73587ea634..ee9a1e5e61 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_semid_ds.h @@ -23,10 +23,14 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ __time_t sem_otime; /* last semop() time */ __time_t sem_ctime; /* last time changed by semctl() */ __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __sem_otime_high; __syscall_ulong_t __sem_ctime_high; +#endif }; diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h index 8fdbc5d776..0c080fed61 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h @@ -23,17 +23,21 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __syscall_ulong_t __sem_otime_high; __time_t sem_otime; /* last semop() time */ __syscall_ulong_t __sem_ctime_high; __time_t sem_ctime; /* last time changed by semctl() */ -#else +# else __time_t sem_otime; /* last semop() time */ __time_t sem_ctime; /* last time changed by semctl() */ -#endif +# endif __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; +#endif }; diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h index 6b9b3639b2..76810427f6 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h @@ -23,17 +23,21 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __syscall_ulong_t __sem_otime_high; __time_t sem_otime; /* last semop() time */ __syscall_ulong_t __sem_ctime_high; __time_t sem_ctime; /* last time changed by semctl() */ -#else +# else __time_t sem_otime; /* last semop() time */ __time_t sem_ctime; /* last time changed by semctl() */ -#endif +# endif __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; +#endif }; diff --git a/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h index 90f03b2407..affd38b6bd 100644 --- a/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h +++ b/sysdeps/unix/sysv/linux/x86/bits/types/struct_semid_ds.h @@ -23,6 +23,9 @@ /* Data structure describing a set of semaphores. */ struct semid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm sem_perm; /* operation permission struct */ __time_t sem_otime; /* last semop() time */ __syscall_ulong_t __sem_otime_high; @@ -31,4 +34,5 @@ struct semid_ds __syscall_ulong_t sem_nsems; /* number of semaphores in set */ __syscall_ulong_t __glibc_reserved3; __syscall_ulong_t __glibc_reserved4; +#endif }; From patchwork Mon Jun 7 20:36:04 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: 43766 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 535E83938C37 for ; Mon, 7 Jun 2021 20:48:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 535E83938C37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098888; bh=qJVPzK60VuQyEz1Jcwwni0HK+P9bbHTBKyF6gkAFqRE=; 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=D1M0HCTupZVBMKR/q4TetE11EGh2iuO6qWGm1yMH/Aqf5JBJA0zsbaUGWUS6MhDYw nt/Nbu5e/JQcBRrEwxIUpVbaCSrXEiOfUjOr9nQ72NkGq49T4JP2vmoakBDuXi+Y1Z /e89TxIu6X8UUtJV2hIh8By4iuqpOsOdibJNzeIE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by sourceware.org (Postfix) with ESMTPS id 22BE8389850F for ; Mon, 7 Jun 2021 20:36:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 22BE8389850F Received: by mail-qt1-x82d.google.com with SMTP id t20so13646037qtx.8 for ; Mon, 07 Jun 2021 13:36:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qJVPzK60VuQyEz1Jcwwni0HK+P9bbHTBKyF6gkAFqRE=; b=E0YgBYi1FXVjBMnmAsZTE7doJvp0eD+vlwDmylXmU1RoHvLYFL5zyA6enz8K69FnHl k0l1NgVy5NMHv8CXh7vDj0VjyFkppcuLh5kGDZ62zvUsqQ3xeNxMRnjaFSu8CpVQegwH nz7vxW9D8LxlBlbjOWlXPLW09oPgE/o6H1IGkbXoZpIWdtDvg3Ih3q4y/IHbtVIbPpTo zLlkboVaj0lLeBLyWhv6iXGK/bSqEc5S/zKu4qC+KGjzw/eHKt2767lKd4M8sVZCwUim 11PkxlTVrPaIqcG4l6XMIn224vf6VNGE91aRpMet2yc6rCbH0n30huVlOdvF8h29bXFh zf0A== X-Gm-Message-State: AOAM531sGTnz5TJIuTE1B8oJ2atYbR+M8ieA7swsGr4RjKfI5ge2dkmM mOsVUDuLTbeMK4OMuzISXophrduZMgH8jQ== X-Google-Smtp-Source: ABdhPJy/HBFOEyY+Dzmqin6XI7fFpOxFdkgDdAj9SLhDtxn2sOLTL/xUHbsQ3WcWsCcO1nKm8h54Jw== X-Received: by 2002:ac8:7516:: with SMTP id u22mr5222615qtq.160.1623098203538; Mon, 07 Jun 2021 13:36:43 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:43 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 15/24] y2038: Use a common definition for shmid_ds Date: Mon, 7 Jun 2021 17:36:04 -0300 Message-Id: <20210607203613.282543-16-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Instead of replicate the same definitions from struct_shmid64_ds.h on the multiple struct_shmid_ds.h, use a common header which is included when required (struct_shmid64_ds_helper.h). The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit semctl implementation. Reviewed-by: Carlos O'Donell Tested-by: carlos O'Donell --- sysdeps/unix/sysv/linux/Makefile | 3 +- .../sysv/linux/bits/types/struct_shmid64_ds.h | 9 +----- .../bits/types/struct_shmid64_ds_helper.h | 28 +++++++++++++++++++ .../sysv/linux/bits/types/struct_shmid_ds.h | 10 +++++-- .../linux/hppa/bits/types/struct_shmid_ds.h | 10 +++++-- .../linux/mips/bits/types/struct_shmid_ds.h | 14 ++++++---- .../powerpc/bits/types/struct_shmid_ds.h | 10 +++++-- .../linux/sparc/bits/types/struct_shmid_ds.h | 10 +++++-- 8 files changed, 68 insertions(+), 26 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index b6abcb1365..8b4d3a6a54 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -103,7 +103,8 @@ sysdep_headers += sys/mount.h sys/acct.h \ bits/struct_stat.h \ bits/struct_stat_time64_helper.h \ bits/types/struct_msqid64_ds_helper.h \ - bits/types/struct_semid64_ds_helper.h + bits/types/struct_semid64_ds_helper.h \ + bits/types/struct_shmid64_ds_helper.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h index 71100db1b5..a4af8cc5f4 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds.h @@ -25,13 +25,6 @@ #else struct __shmid64_ds { - struct ipc_perm shm_perm; /* operation permission struct */ - size_t shm_segsz; /* size of segment in bytes */ - __time64_t shm_atime; /* time of last shmat() */ - __time64_t shm_dtime; /* time of last shmdt() */ - __time64_t shm_ctime; /* time of last change by shmctl() */ - __pid_t shm_cpid; /* pid of creator */ - __pid_t shm_lpid; /* pid of last shmop */ - shmatt_t shm_nattch; /* number of current attaches */ +# include }; #endif diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h new file mode 100644 index 0000000000..945e7ce63e --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid64_ds_helper.h @@ -0,0 +1,28 @@ +/* Common definitions for struct semid_ds with 64-bit time. + Copyright (C) 2020-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + + struct ipc_perm shm_perm; /* operation permission struct */ + size_t shm_segsz; /* size of segment in bytes */ + __time64_t shm_atime; /* time of last shmat() */ + __time64_t shm_dtime; /* time of last shmdt() */ + __time64_t shm_ctime; /* time of last change by shmctl() */ + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + unsigned long int __glibc_reserved5; + unsigned long int __glibc_reserved6; diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h index 2bd587d2b0..5f8ac6257b 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h @@ -23,23 +23,27 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm shm_perm; /* operation permission struct */ size_t shm_segsz; /* size of segment in bytes */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __time_t shm_atime; /* time of last shmat() */ unsigned long int __shm_atime_high; __time_t shm_dtime; /* time of last shmdt() */ unsigned long int __shm_dtime_high; __time_t shm_ctime; /* time of last change by shmctl() */ unsigned long int __shm_ctime_high; -#else +# else __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#endif +# endif __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ __syscall_ulong_t __glibc_reserved5; __syscall_ulong_t __glibc_reserved6; +#endif }; diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h index 47ff80ebb0..7831fd7340 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h @@ -23,8 +23,11 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm shm_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __shm_atime_high; __time_t shm_atime; /* time of last shmat() */ unsigned long int __shm_dtime_high; @@ -32,15 +35,16 @@ struct shmid_ds unsigned long int __shm_ctime_high; __time_t shm_ctime; /* time of last change by shmctl() */ unsigned long int __glibc_reserved4; -#else +# else __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#endif +# endif size_t shm_segsz; /* size of segment in bytes */ __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ __syscall_ulong_t __glibc_reserved5; __syscall_ulong_t __glibc_reserved6; +#endif }; diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h index 7f8f3b9c51..0691a610ae 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h +++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h @@ -23,27 +23,31 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm shm_perm; /* operation permission struct */ size_t shm_segsz; /* size of segment in bytes */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#else +# else __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#endif +# endif __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned short int __shm_atime_high; unsigned short int __shm_dtime_high; unsigned short int __shm_ctime_high; unsigned short int __glibc_reserved4; -#else +# else __syscall_ulong_t __glibc_reserved5; __syscall_ulong_t __glibc_reserved6; +# endif #endif }; diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h index d71bdf1ecf..316d43ec99 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h @@ -23,8 +23,11 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm shm_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __shm_atime_high; __time_t shm_atime; /* time of last shmat() */ unsigned long int __shm_dtime_high; @@ -32,15 +35,16 @@ struct shmid_ds unsigned long int __shm_ctime_high; __time_t shm_ctime; /* time of last change by shmctl() */ unsigned long int __glibc_reserved4; -#else +# else __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#endif +# endif size_t shm_segsz; /* size of segment in bytes */ __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ __syscall_ulong_t __glibc_reserved5; __syscall_ulong_t __glibc_reserved6; +#endif }; diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h index 767099803f..86f0cedac3 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h @@ -23,23 +23,27 @@ /* Data structure describing a shared memory segment. */ struct shmid_ds { +#ifdef __USE_TIME_BITS64 +# include +#else struct ipc_perm shm_perm; /* operation permission struct */ -#if __TIMESIZE == 32 +# if __TIMESIZE == 32 unsigned long int __shm_atime_high; __time_t shm_atime; /* time of last shmat() */ unsigned long int __shm_dtime_high; __time_t shm_dtime; /* time of last shmdt() */ unsigned long int __shm_ctime_high; __time_t shm_ctime; /* time of last change by shmctl() */ -#else +# else __time_t shm_atime; /* time of last shmat() */ __time_t shm_dtime; /* time of last shmdt() */ __time_t shm_ctime; /* time of last change by shmctl() */ -#endif +# endif size_t shm_segsz; /* size of segment in bytes */ __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ __syscall_ulong_t __glibc_reserved5; __syscall_ulong_t __glibc_reserved6; +#endif }; From patchwork Mon Jun 7 20:36:05 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: 43767 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 6FEE43939C2A for ; Mon, 7 Jun 2021 20:48:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FEE43939C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098938; bh=zKp/VX0XhbNhAHhF47iuzsp6ZdF2LBkj0sXBVlqvwU0=; 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=Phy7DStuOKTtlIfaivcOacFoOKt7Iu80oYFiea0zxkMgWMf+VtnyMnlOVupZF/L1L /lo9FS7cF3KU8Z6pKW/cQs15R0zvDIyFiKwFMptAlvtcJtRjwvK0tvScb7+koCN3X7 TmxsMWIpnyoNraUNEUdcLq0iEQoli3Rk/Lwue7aI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id A96FD3938C0A for ; Mon, 7 Jun 2021 20:36:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A96FD3938C0A Received: by mail-qt1-x836.google.com with SMTP id m13so13613484qtk.13 for ; Mon, 07 Jun 2021 13:36:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zKp/VX0XhbNhAHhF47iuzsp6ZdF2LBkj0sXBVlqvwU0=; b=kqA5AXRBXqc9/E4zY7P9cC8P8c2pZ3oTRwJpC2gFl6N2Cdp6wHpFjoSJKbgKp6uQLP 0ZC0rscW1yCekUxy+m1f+PGeyaPm634uMxWadEX+B03UOXNRcSABEhwzvKiW2cPPR1iG 61Ue4XhRCwHYfdAl7/oCAnqAI1tkPVmQDAtnZqQsHxneu9p9+4S6a1A+eaaTEXBvjfJ5 cQV62SCZcRb9TWyl02fwt2FhfwS/KLOqU0ip2Hs6E3DeXmoryggjOSnxsYJI8PWYDzBg 972CYP6+sNT3gxyLUeRCZtwAnjguzdEMDJtJgTlMoFBDS2DPMTgxQID2Hv/2gOGYY8sS V6hw== X-Gm-Message-State: AOAM531CC6mhK3GyRo4awuNK1f7sIh1t/kJyau6SsLQIgwPfKe5NCrWF 6vORlSz3lVNJZTgZn6W3lupQ7LvjA60VNw== X-Google-Smtp-Source: ABdhPJxgjCvS3dgFNAVMAfgWS04VuB5lW1MyXAp6qEINiwGlGHHwbLlgg3+GZFpPl1fJH4NXuzfsOw== X-Received: by 2002:a05:622a:1045:: with SMTP id f5mr17751892qte.392.1623098205115; Mon, 07 Jun 2021 13:36:45 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:44 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 16/24] y2038: Add __USE_TIME_BITS64 support for socket-constants.h Date: Mon, 7 Jun 2021 17:36:05 -0300 Message-Id: <20210607203613.282543-17-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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, 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" It is only used for !__USE_MISC, the default way uses the kernel headers. The patch also adds the SO_TIMESTAMP, SO_TIMESTAMPNS, and SO_TIMESTAMPING which uses new values for 64-bit time_t kernel interfaces. The __USE_TIME_BITS64 is not defined internally yet, although the internal header is used when building the 64-bit stat implementations. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- .../unix/sysv/linux/bits/socket-constants.h | 47 +++++++++++++++---- .../sysv/linux/hppa/bits/socket-constants.h | 36 +++++++++++++- .../sysv/linux/mips/bits/socket-constants.h | 36 +++++++++++++- .../linux/powerpc/bits/socket-constants.h | 36 +++++++++++++- .../sysv/linux/sparc/bits/socket-constants.h | 36 +++++++++++++- 5 files changed, 175 insertions(+), 16 deletions(-) diff --git a/sysdeps/unix/sysv/linux/bits/socket-constants.h b/sysdeps/unix/sysv/linux/bits/socket-constants.h index 84f7a333a2..c52e72bb73 100644 --- a/sysdeps/unix/sysv/linux/bits/socket-constants.h +++ b/sysdeps/unix/sysv/linux/bits/socket-constants.h @@ -32,19 +32,50 @@ #define SO_OOBINLINE 10 #define SO_RCVBUF 8 #define SO_RCVLOWAT 18 -#if (__TIMESIZE == 64 && __WORDSIZE == 32 \ - && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) -# define SO_RCVTIMEO 66 -#else -# define SO_RCVTIMEO 20 -#endif #define SO_REUSEADDR 2 #define SO_SNDBUF 7 #define SO_SNDLOWAT 19 +#define SO_TYPE 3 + #if (__TIMESIZE == 64 && __WORDSIZE == 32 \ && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) +# define SO_RCVTIMEO 66 # define SO_SNDTIMEO 67 +# define SO_TIMESTAMP 63 +# define SO_TIMESTAMPNS 64 +# define SO_TIMESTAMPING 65 #else -# define SO_SNDTIMEO 21 +# if __TIMESIZE == 64 +# define SO_RCVTIMEO 20 +# define SO_SNDTIMEO 21 +# define SO_TIMESTAMP 29 +# define SO_TIMESTAMPNS 35 +# define SO_TIMESTAMPING 37 +# else +# define SO_RCVTIMEO_OLD 20 +# define SO_SNDTIMEO_OLD 21 +# define SO_RCVTIMEO_NEW 66 +# define SO_SNDTIMEO_NEW 67 + +# define SO_TIMESTAMP_OLD 29 +# define SO_TIMESTAMPNS_OLD 35 +# define SO_TIMESTAMPING_OLD 37 +# define SO_TIMESTAMP_NEW 63 +# define SO_TIMESTAMPNS_NEW 64 +# define SO_TIMESTAMPING_NEW 65 + +# ifdef __USE_TIME_BITS64 +# define SO_RCVTIMEO SO_RCVTIMEO_NEW +# define SO_SNDTIMEO SO_SNDTIMEO_NEW +# define SO_TIMESTAMP SO_TIMESTAMP_NEW +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW +# define SO_TIMESTAMPING SO_TIMESTAMPING_NEW +# else +# define SO_RCVTIMEO SO_RCVTIMEO_OLD +# define SO_SNDTIMEO SO_SNDTIMEO_OLD +# define SO_TIMESTAMP SO_TIMESTAMP_OLD +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD +# define SO_TIMESTAMPING SO_TIMESTAMPING_OLD +# endif +# endif #endif -#define SO_TYPE 3 diff --git a/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h b/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h index b4fb65b9f1..68b42d4606 100644 --- a/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h +++ b/sysdeps/unix/sysv/linux/hppa/bits/socket-constants.h @@ -30,9 +30,41 @@ #define SO_OOBINLINE 256 #define SO_RCVBUF 4098 #define SO_RCVLOWAT 4100 -#define SO_RCVTIMEO 4102 #define SO_REUSEADDR 4 #define SO_SNDBUF 4097 #define SO_SNDLOWAT 4099 -#define SO_SNDTIMEO 4101 #define SO_TYPE 4104 + +#if __TIMESIZE == 64 +# define SO_RCVTIMEO 4102 +# define SO_SNDTIMEO 4101 +# define SO_TIMESTAMP 16402 +# define SO_TIMESTAMPNS 16403 +# define SO_TIMESTAMPING 16416 +#else +# define SO_RCVTIMEO_OLD 4102 +# define SO_SNDTIMEO_OLD 4101 +# define SO_RCVTIMEO_NEW 16448 +# define SO_SNDTIMEO_NEW 16449 + +# define SO_TIMESTAMP_OLD 0x4012 +# define SO_TIMESTAMPNS_OLD 0x4013 +# define SO_TIMESTAMPING_OLD 0x4020 +# define SO_TIMESTAMP_NEW 0x4038 +# define SO_TIMESTAMPNS_NEW 0x4039 +# define SO_TIMESTAMPING_NEW 0x403A + +# ifdef __USE_TIME_BITS64 +# define SO_RCVTIMEO SO_RCVTIMEO_NEW +# define SO_SNDTIMEO SO_SNDTIMEO_NEW +# define SO_TIMESTAMP SO_TIMESTAMP_NEW +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW +# define SO_TIMESTAMPING SO_TIMESTAMPING_NEW +# else +# define SO_RCVTIMEO SO_RCVTIMEO_OLD +# define SO_SNDTIMEO SO_SNDTIMEO_OLD +# define SO_TIMESTAMP SO_TIMESTAMP_OLD +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD +# define SO_TIMESTAMPING SO_TIMESTAMPING_OLD +# endif +#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h b/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h index a5264536e9..b18a854e99 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h +++ b/sysdeps/unix/sysv/linux/mips/bits/socket-constants.h @@ -30,9 +30,41 @@ #define SO_OOBINLINE 256 #define SO_RCVBUF 4098 #define SO_RCVLOWAT 4100 -#define SO_RCVTIMEO 4102 #define SO_REUSEADDR 4 #define SO_SNDBUF 4097 #define SO_SNDLOWAT 4099 -#define SO_SNDTIMEO 4101 #define SO_TYPE 4104 + +#if __TIMESIZE == 64 +# define SO_RCVTIMEO 4102 +# define SO_SNDTIMEO 4101 +# define SO_TIMESTAMP 29 +# define SO_TIMESTAMPNS 35 +# define SO_TIMESTAMPING 37 +#else +# define SO_RCVTIMEO_OLD 4102 +# define SO_SNDTIMEO_OLD 4101 +# define SO_RCVTIMEO_NEW 66 +# define SO_SNDTIMEO_NEW 67 + +# define SO_TIMESTAMP_OLD 29 +# define SO_TIMESTAMPNS_OLD 35 +# define SO_TIMESTAMPING_OLD 37 +# define SO_TIMESTAMP_NEW 63 +# define SO_TIMESTAMPNS_NEW 64 +# define SO_TIMESTAMPING_NEW 65 + +# ifdef __USE_TIME_BITS64 +# define SO_RCVTIMEO SO_RCVTIMEO_NEW +# define SO_SNDTIMEO SO_SNDTIMEO_NEW +# define SO_TIMESTAMP SO_TIMESTAMP_NEW +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW +# define SO_TIMESTAMPING SO_TIMESTAMPING_NEW +# else +# define SO_RCVTIMEO SO_RCVTIMEO_OLD +# define SO_SNDTIMEO SO_SNDTIMEO_OLD +# define SO_TIMESTAMP SO_TIMESTAMP_OLD +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD +# define SO_TIMESTAMPING SO_TIMESTAMPING_OLD +# endif +#endif diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h b/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h index f35488b375..c03141bb8c 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/socket-constants.h @@ -30,9 +30,41 @@ #define SO_OOBINLINE 10 #define SO_RCVBUF 8 #define SO_RCVLOWAT 16 -#define SO_RCVTIMEO 18 #define SO_REUSEADDR 2 #define SO_SNDBUF 7 #define SO_SNDLOWAT 17 -#define SO_SNDTIMEO 19 #define SO_TYPE 3 + +#if __TIMESIZE == 64 +# define SO_RCVTIMEO 18 +# define SO_SNDTIMEO 19 +# define SO_TIMESTAMP 29 +# define SO_TIMESTAMPNS 35 +# define SO_TIMESTAMPING 37 +#else +# define SO_RCVTIMEO_OLD 18 +# define SO_SNDTIMEO_OLD 19 +# define SO_RCVTIMEO_NEW 66 +# define SO_SNDTIMEO_NEW 67 + +# define SO_TIMESTAMP_OLD 29 +# define SO_TIMESTAMPNS_OLD 35 +# define SO_TIMESTAMPING_OLD 37 +# define SO_TIMESTAMP_NEW 63 +# define SO_TIMESTAMPNS_NEW 64 +# define SO_TIMESTAMPING_NEW 65 + +# ifdef __USE_TIME_BITS64 +# define SO_RCVTIMEO SO_RCVTIMEO_NEW +# define SO_SNDTIMEO SO_SNDTIMEO_NEW +# define SO_TIMESTAMP SO_TIMESTAMP_NEW +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW +# define SO_TIMESTAMPING SO_TIMESTAMPING_NEW +# else +# define SO_RCVTIMEO SO_RCVTIMEO_OLD +# define SO_SNDTIMEO SO_SNDTIMEO_OLD +# define SO_TIMESTAMP SO_TIMESTAMP_OLD +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD +# define SO_TIMESTAMPING SO_TIMESTAMPING_OLD +# endif +#endif diff --git a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h index a58d0b5f96..5c4ed76c8c 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/socket-constants.h @@ -30,9 +30,41 @@ #define SO_OOBINLINE 256 #define SO_RCVBUF 4098 #define SO_RCVLOWAT 2048 -#define SO_RCVTIMEO 8192 #define SO_REUSEADDR 4 #define SO_SNDBUF 4097 #define SO_SNDLOWAT 4096 -#define SO_SNDTIMEO 16384 #define SO_TYPE 4104 + +#if __TIMESIZE == 64 +# define SO_RCVTIMEO 8192 +# define SO_SNDTIMEO 16384 +# define SO_TIMESTAMP 29 +# define SO_TIMESTAMPNS 33 +# define SO_TIMESTAMPING 35 +#else +# define SO_RCVTIMEO_OLD 8192 +# define SO_SNDTIMEO_OLD 16384 +# define SO_RCVTIMEO_NEW 68 +# define SO_SNDTIMEO_NEW 69 + +# define SO_TIMESTAMP_OLD 0x001d +# define SO_TIMESTAMPNS_OLD 0x0021 +# define SO_TIMESTAMPING_OLD 0x0023 +# define SO_TIMESTAMP_NEW 0x0046 +# define SO_TIMESTAMPNS_NEW 0x0042 +# define SO_TIMESTAMPING_NEW 0x0043 + +# ifdef __USE_TIME_BITS64 +# define SO_RCVTIMEO SO_RCVTIMEO_NEW +# define SO_SNDTIMEO SO_SNDTIMEO_NEW +# define SO_TIMESTAMP SO_TIMESTAMP_NEW +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_NEW +# define SO_TIMESTAMPING SO_TIMESTAMPING_NEW +# else +# define SO_RCVTIMEO SO_RCVTIMEO_OLD +# define SO_SNDTIMEO SO_SNDTIMEO_OLD +# define SO_TIMESTAMP SO_TIMESTAMP_OLD +# define SO_TIMESTAMPNS SO_TIMESTAMPNS_OLD +# define SO_TIMESTAMPING SO_TIMESTAMPING_OLD +# endif +#endif From patchwork Mon Jun 7 20:36:06 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: 43768 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 EA3463938C36 for ; Mon, 7 Jun 2021 20:49:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA3463938C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623098988; bh=FDDNmb0/sQCffXC+DpT3zQx/mFPoYkXzwJOoojloz1k=; 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=fEES8xlO0t5H+PirAhD2Z53C7LDVPZ79HFeogBYBvBsmp3ZRInULbQ5ZutEC7hIve woAhzr6lCtV/sIPg/GrbJhNQUILimM38bcRVqUyRx72rpHCj3zYhSF0UniTRE6DN0X egA2R4zt9vhZkVqfiapPSOpaHzcknNmRpG+mg9w0= 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 35EB33938396 for ; Mon, 7 Jun 2021 20:36:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 35EB33938396 Received: by mail-qv1-xf2b.google.com with SMTP id e18so9600081qvm.10 for ; Mon, 07 Jun 2021 13:36:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FDDNmb0/sQCffXC+DpT3zQx/mFPoYkXzwJOoojloz1k=; b=rlULDNWNytRXwdAEXv1yuUcdnLnIXc5S/QnFGtuvTbHS2RLTb9K+EdzpBEfbOHTdKM iQsLiigdhrv7LfWZC5J87UgBycrAuNwGnzDPxDmXU39EknkJGjRc0H4jLUwvS4D0TrER 6WZULr+hvinHqEhgfL0Yrjpaos8Bkl6FaOAJsQWItkCZgW/1M43KyA657eGAQxysCio/ KMk8uqCRptNP1VCGnSYOJzxkHnpJ+ZIkLyjbiYYkuP6oau4QjuvDCHzCawv0unQoMHlb 1DCziFX5GVkityxAzS3EZIdgzCLmFfcWQrPhXiJZu+urRFkNgUO7UbaiPKKOH6K2GjgJ V93g== X-Gm-Message-State: AOAM531QgTiXR/MqNATBCyDPVqfrTeUHP6KnWYPY2si+g/LfHT44SyBO B67X5MCi2Jjaouva8r4mbZMJw8QCxuN7og== X-Google-Smtp-Source: ABdhPJyOH9UmBPQvu434KmFP7KmURvDFJ70l71i+L4XGxTQwCM0mRKfXaYPiWVVS4wYvhVgutK8T5Q== X-Received: by 2002:a0c:f80d:: with SMTP id r13mr10320453qvn.39.1623098206668; Mon, 07 Jun 2021 13:36:46 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:46 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 17/24] time: Add 64-bit time support for getdate Date: Mon, 7 Jun 2021 17:36:06 -0300 Message-Id: <20210607203613.282543-18-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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, 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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The getdate is basically a wrapper localtime and mktime. The 64-bit time support is done calling the 64-bit internal functions, there is no need to add a new symbol version. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- include/sys/stat.h | 2 +- include/time.h | 12 ++++++++++-- time/getdate.c | 22 ++++++++++------------ time/tst-getdate.c | 14 ++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/sys/stat.h b/include/sys/stat.h index b4c9344628..13e777b3c7 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -46,7 +46,7 @@ hidden_proto (__lstat64) hidden_proto (__fstatat64) # endif -# if __TIMESIZE == 64 +# if __TIMESIZE == 64 || defined NO_RTLD_HIDDEN # define __stat64_time64 __stat64 # define __fstat64_time64 __fstat64 # define __lstat64_time64 __lstat64 diff --git a/include/time.h b/include/time.h index 4372bfbd96..980c6bd924 100644 --- a/include/time.h +++ b/include/time.h @@ -283,8 +283,8 @@ hidden_proto (__nanosleep64) #endif -extern int __getdate_r (const char *__string, struct tm *__resbufp) - attribute_hidden; +extern int __getdate_r (const char *__string, struct tm *__resbufp); +libc_hidden_proto (__getdate_r); /* Determine CLK_TCK value. */ @@ -509,6 +509,14 @@ time_now (void) return ts.tv_sec; } +static inline __time64_t +time64_now (void) +{ + struct __timespec64 ts; + __clock_gettime64 (TIME_CLOCK_GETTIME_CLOCKID, &ts); + return ts.tv_sec; +} + #define NSEC_PER_SEC 1000000000L /* Nanoseconds per second. */ #define USEC_PER_SEC 1000000L /* Microseconds per second. */ #define NSEC_PER_USEC 1000L /* Nanoseconds per microsecond. */ diff --git a/time/getdate.c b/time/getdate.c index 6e2f75566b..cdcc898517 100644 --- a/time/getdate.c +++ b/time/getdate.c @@ -112,16 +112,16 @@ __getdate_r (const char *string, struct tm *tp) size_t len; char *datemsk; char *result = NULL; - time_t timer; + __time64_t timer; struct tm tm; - struct stat64 st; - int mday_ok = 0; + struct __stat64_t64 st; + bool mday_ok = false; datemsk = getenv ("DATEMSK"); if (datemsk == NULL || *datemsk == '\0') return 1; - if (__stat64 (datemsk, &st) < 0) + if (__stat64_time64 (datemsk, &st) < 0) return 3; if (!S_ISREG (st.st_mode)) @@ -219,8 +219,8 @@ __getdate_r (const char *string, struct tm *tp) return 7; /* Get current time. */ - timer = time_now (); - __localtime_r (&timer, &tm); + timer = time64_now (); + __localtime64_r (&timer, &tm); /* If only the weekday is given, today is assumed if the given day is equal to the current day and next week if it is less. */ @@ -230,7 +230,7 @@ __getdate_r (const char *string, struct tm *tp) tp->tm_year = tm.tm_year; tp->tm_mon = tm.tm_mon; tp->tm_mday = tm.tm_mday + (tp->tm_wday - tm.tm_wday + 7) % 7; - mday_ok = 1; + mday_ok = true; } /* If only the month is given, the current month is assumed if the @@ -242,7 +242,7 @@ __getdate_r (const char *string, struct tm *tp) if (tp->tm_year == INT_MIN) tp->tm_year = tm.tm_year + (((tp->tm_mon - tm.tm_mon) < 0) ? 1 : 0); tp->tm_mday = first_wday (tp->tm_year, tp->tm_mon, tp->tm_wday); - mday_ok = 1; + mday_ok = true; } /* If no hour, minute and second are given the current hour, minute @@ -285,15 +285,13 @@ __getdate_r (const char *string, struct tm *tp) call normalizes the struct tm. */ if ((!mday_ok && !check_mday (TM_YEAR_BASE + tp->tm_year, tp->tm_mon, tp->tm_mday)) - || mktime (tp) == (time_t) -1) + || __mktime64 (tp) == (time_t) -1) return 8; return 0; } -#ifdef weak_alias weak_alias (__getdate_r, getdate_r) -#endif - +libc_hidden_def (__getdate_r) struct tm * getdate (const char *string) diff --git a/time/tst-getdate.c b/time/tst-getdate.c index c37ba3083a..3bb0e96707 100644 --- a/time/tst-getdate.c +++ b/time/tst-getdate.c @@ -115,20 +115,14 @@ do_test (void) { setenv ("TZ", tests[i].tz, 1); - int expected_err; - if (sizeof (time_t) == 4 && tests[i].time64) - expected_err = 8; - else - expected_err = 0; - tm = getdate (tests[i].str); - TEST_COMPARE (getdate_err, expected_err); - if (getdate_err != expected_err) + TEST_COMPARE (getdate_err, 0); + if (getdate_err != 0) { support_record_failure (); printf ("%s\n", report_date_error ()); } - else if (getdate_err == 0) + else { TEST_COMPARE (tests[i].tm.tm_mon, tm->tm_mon); TEST_COMPARE (tests[i].tm.tm_year, tm->tm_year); @@ -139,7 +133,7 @@ do_test (void) } struct tm tms; - TEST_COMPARE (getdate_r (tests[i].str, &tms), expected_err); + TEST_COMPARE (getdate_r (tests[i].str, &tms), 0); if (getdate_err == 0) { TEST_COMPARE (tests[i].tm.tm_mon, tms.tm_mon); From patchwork Mon Jun 7 20:36:07 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: 43774 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 A7FEE3939C08 for ; Mon, 7 Jun 2021 20:54:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7FEE3939C08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623099273; bh=QADavjzyllM4BqXDTaJgzAlvTYXgv+qONyu2QmoGsnY=; 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=tgOc/jhEZDv2zkE5a8HoVV7Rvl7qcsXhcw8mqLWgMHRBEaIkLBc65Q0aq4q6B26LE AJC83zwtYIvZrU8LHr918pKZxohlIAKog84gdc1WpcWN0tts6COutQFdY2LjPu6JJz RrhreV+0Xu9qUrTsgEcInf6Ea+4hw+2wa2O/HcDM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by sourceware.org (Postfix) with ESMTPS id 851FF3938C01 for ; Mon, 7 Jun 2021 20:36:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 851FF3938C01 Received: by mail-qk1-x736.google.com with SMTP id c124so18076304qkd.8 for ; Mon, 07 Jun 2021 13:36:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QADavjzyllM4BqXDTaJgzAlvTYXgv+qONyu2QmoGsnY=; b=nnkNZGSePbCKdfO112pu4cl3i5lgqYSMWcG1IdrZcma+IyHqAAImnEWR1Xf9e+DSrC BEO1xT+84yMnEEp0yjCUPG55ZPm6jUYMNXjXIjXldU83m+DWxK1RxGenhbe8BQYLHG4T L2wBVm/3pwHq1aSEA865ykh9U802+QoLhDfRT2Ky/tkA71+ujdrIDSH1dU/uQl+h/jOO QnIE4FKV0ijEWr7OVRa56BqQMH6qrS4Uw5MooXB/rv0wp1QDz3g+Ntm6M1/66iy+oA6t yMQyT4Hp+TPIYiuNDi1bh1RlLJaYVaq/8xbyvfwkSIpyf76LRgInXYNqRpTNrSfq7yFM Xhxw== X-Gm-Message-State: AOAM531pYVcrgBoWsI5jd77fIB6zvLJAx1oAZgkRuUTkNsgNI1xnpIU6 UNETIzUqlEy7BVlAQizfmxlG3XxFjYgztg== X-Google-Smtp-Source: ABdhPJyVD5oXqLozwdmBDv353NpVlPKXUZbYqlHd6NP/PFwZNwHGtiQwIJN553H0Z9g9NWJt4h1KBw== X-Received: by 2002:a05:620a:28c6:: with SMTP id l6mr18028161qkp.155.1623098209048; Mon, 07 Jun 2021 13:36:49 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:48 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 18/24] y2038: Add support for 64-bit time on legacy ABIs Date: Mon, 7 Jun 2021 17:36:07 -0300 Message-Id: <20210607203613.282543-19-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" A new build flag, _TIME_BITS, enables the usage of the newer 64-bit time symbols for legacy ABI (where 32 bit time_t is default). The 64 bit time support is only enabled if LFS (_FILE_OFFSET_BITS=64) is also used. Different than LFS support, the y2038 symbols are added only for the required ABIs (armhf, csky, hppa, i386, m68k, microblaze, mips32, mips64-n32, nios2, powerpc32, sparc32, s390-32, and sh). The ABIs with 64-bit time support are unchanged, both for symbol and types redirection. On Linux the full 64-bit time support requires a minimum of kernel version v5.1. Otherwise, the 32 bit fallbacks are used and might results in error with overflow return code (EOVERFLOW). The i686-gnu does not yet support 64-bit time. This patch exports following rediretions to support 64-bit time: * libc: adjtime adjtimex clock_adjtime clock_getres clock_gettime clock_nanosleep clock_settime cnd_timedwait ctime ctime_r difftime fstat fstatat futimens futimes futimesat getitimer getrusage gettimeofday gmtime gmtime_r localtime localtime_r lstat_time lutimes mktime msgctl mtx_timedlock nanosleep nanosleep ntp_gettime ntp_gettimex ppoll pselec pselect pthread_clockjoin_np pthread_cond_clockwait pthread_cond_timedwait pthread_mutex_clocklock pthread_mutex_timedlock pthread_rwlock_clockrdlock pthread_rwlock_clockwrlock pthread_rwlock_timedrdlock pthread_rwlock_timedwrlock pthread_timedjoin_np recvmmsg sched_rr_get_interval select sem_clockwait semctl semtimedop sem_timedwait setitimer settimeofday shmctl sigtimedwait stat thrd_sleep time timegm timerfd_gettime timerfd_settime timespec_get utime utimensat utimes utimes wait3 wait4 * librt: aio_suspend mq_timedreceive mq_timedsend timer_gettime timer_settime * libanl: gai_suspend Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- Makefile | 2 +- NEWS | 5 + include/features-time64.h | 1 + include/features.h | 2 + io/sys/poll.h | 11 ++ io/sys/stat.h | 113 ++++++++++++-- io/utime.h | 11 ++ manual/creature.texi | 44 ++++++ misc/sys/select.h | 27 ++++ nptl/pthread_clockjoin.c | 3 +- nptl/pthread_cond_wait.c | 9 +- nptl/pthread_mutex_timedlock.c | 8 +- nptl/pthread_rwlock_clockrdlock.c | 4 +- nptl/pthread_rwlock_clockwrlock.c | 4 +- nptl/pthread_rwlock_timedrdlock.c | 4 +- nptl/pthread_rwlock_timedwrlock.c | 4 +- nptl/pthread_timedjoin.c | 3 +- nptl/sem_clockwait.c | 3 +- nptl/sem_timedwait.c | 4 +- posix/sched.h | 11 +- posix/sys/wait.h | 20 +++ resolv/netdb.h | 11 ++ resource/sys/resource.h | 10 ++ rt/aio.h | 15 +- rt/mqueue.h | 22 +++ signal/signal.h | 13 ++ socket/sys/socket.h | 11 ++ sysdeps/generic/features-time64.h | 19 +++ sysdeps/generic/time64-compat.h | 3 + sysdeps/nptl/pthread.h | 119 +++++++++++++++ sysdeps/pthread/semaphore.h | 25 ++++ sysdeps/pthread/threads.h | 33 +++++ sysdeps/unix/sysv/linux/Makefile | 3 + sysdeps/unix/sysv/linux/Versions | 97 ++++++++++++ sysdeps/unix/sysv/linux/arm/be/libanl.abilist | 1 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 67 +++++++++ sysdeps/unix/sysv/linux/arm/be/librt.abilist | 5 + sysdeps/unix/sysv/linux/arm/le/libanl.abilist | 1 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 67 +++++++++ sysdeps/unix/sysv/linux/arm/le/librt.abilist | 5 + sysdeps/unix/sysv/linux/arm/time64-compat.h | 2 + sysdeps/unix/sysv/linux/bits/msq.h | 1 + sysdeps/unix/sysv/linux/bits/sem.h | 1 + sysdeps/unix/sysv/linux/bits/shm.h | 1 + sysdeps/unix/sysv/linux/bits/time.h | 10 ++ sysdeps/unix/sysv/linux/cnd_timedwait.c | 8 +- sysdeps/unix/sysv/linux/csky/libanl.abilist | 1 + sysdeps/unix/sysv/linux/csky/libc.abilist | 67 +++++++++ sysdeps/unix/sysv/linux/csky/librt.abilist | 5 + sysdeps/unix/sysv/linux/csky/time64-compat.h | 2 + sysdeps/unix/sysv/linux/features-time64.h | 37 +++++ sysdeps/unix/sysv/linux/hppa/libanl.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 67 +++++++++ sysdeps/unix/sysv/linux/hppa/librt.abilist | 5 + sysdeps/unix/sysv/linux/hppa/time64-compat.h | 2 + sysdeps/unix/sysv/linux/i386/libanl.abilist | 1 + sysdeps/unix/sysv/linux/i386/libc.abilist | 67 +++++++++ sysdeps/unix/sysv/linux/i386/librt.abilist | 5 + sysdeps/unix/sysv/linux/i386/time64-compat.h | 2 + sysdeps/unix/sysv/linux/include/sys/msg.h | 2 - sysdeps/unix/sysv/linux/include/sys/shm.h | 2 - sysdeps/unix/sysv/linux/include/sys/timex.h | 2 + .../sysv/linux/m68k/coldfire/libanl.abilist | 1 + .../sysv/linux/m68k/coldfire/libc.abilist | 67 +++++++++ .../sysv/linux/m68k/coldfire/librt.abilist | 5 + .../sysv/linux/m68k/m680x0/libanl.abilist | 1 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 67 +++++++++ .../unix/sysv/linux/m68k/m680x0/librt.abilist | 5 + sysdeps/unix/sysv/linux/m68k/time64-compat.h | 2 + .../sysv/linux/microblaze/be/libanl.abilist | 1 + .../sysv/linux/microblaze/be/libc.abilist | 67 +++++++++ .../sysv/linux/microblaze/be/librt.abilist | 5 + .../sysv/linux/microblaze/le/libanl.abilist | 1 + .../sysv/linux/microblaze/le/libc.abilist | 67 +++++++++ .../sysv/linux/microblaze/le/librt.abilist | 5 + .../sysv/linux/microblaze/time64-compat.h | 2 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 67 +++++++++ .../sysv/linux/mips/mips32/libanl.abilist | 1 + .../unix/sysv/linux/mips/mips32/librt.abilist | 5 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 67 +++++++++ .../sysv/linux/mips/mips32/time64-compat.h | 2 + .../sysv/linux/mips/mips64/n32/libanl.abilist | 1 + .../sysv/linux/mips/mips64/n32/libc.abilist | 67 +++++++++ .../sysv/linux/mips/mips64/n32/librt.abilist | 5 + .../linux/mips/mips64/n32/time64-compat.h | 2 + sysdeps/unix/sysv/linux/mtx_timedlock.c | 8 +- sysdeps/unix/sysv/linux/nios2/libanl.abilist | 1 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 67 +++++++++ sysdeps/unix/sysv/linux/nios2/librt.abilist | 5 + sysdeps/unix/sysv/linux/nios2/time64-compat.h | 2 + .../linux/powerpc/powerpc32/fpu/libc.abilist | 67 +++++++++ .../linux/powerpc/powerpc32/libanl.abilist | 1 + .../linux/powerpc/powerpc32/librt.abilist | 5 + .../powerpc/powerpc32/nofpu/libc.abilist | 67 +++++++++ .../linux/powerpc/powerpc32/time64-compat.h | 2 + .../sysv/linux/s390/s390-32/libanl.abilist | 1 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 67 +++++++++ .../sysv/linux/s390/s390-32/librt.abilist | 5 + .../sysv/linux/s390/s390-32/time64-compat.h | 2 + sysdeps/unix/sysv/linux/semctl.c | 1 - sysdeps/unix/sysv/linux/sh/be/libanl.abilist | 1 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 67 +++++++++ sysdeps/unix/sysv/linux/sh/be/librt.abilist | 5 + sysdeps/unix/sysv/linux/sh/le/libanl.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 67 +++++++++ sysdeps/unix/sysv/linux/sh/le/librt.abilist | 5 + sysdeps/unix/sysv/linux/sh/time64-compat.h | 2 + .../sysv/linux/sparc/sparc32/libanl.abilist | 1 + .../sysv/linux/sparc/sparc32/libc.abilist | 67 +++++++++ .../sysv/linux/sparc/sparc32/librt.abilist | 5 + .../sysv/linux/sparc/sparc32/time64-compat.h | 2 + sysdeps/unix/sysv/linux/sys/timerfd.h | 22 +++ sysdeps/unix/sysv/linux/sys/timex.h | 27 +++- sysvipc/sys/msg.h | 10 ++ sysvipc/sys/sem.h | 21 +++ sysvipc/sys/shm.h | 10 ++ time/sys/time.h | 71 +++++++++ time/time.h | 138 +++++++++++++++++- 118 files changed, 2387 insertions(+), 60 deletions(-) create mode 100644 include/features-time64.h create mode 100644 sysdeps/generic/features-time64.h create mode 100644 sysdeps/generic/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/arm/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/csky/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/features-time64.h create mode 100644 sysdeps/unix/sysv/linux/hppa/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/i386/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/m68k/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/microblaze/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/nios2/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/sh/time64-compat.h create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h diff --git a/Makefile b/Makefile index 242d36de91..0157b53cb8 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ endif # $(AUTOCONF) = no subdir_objs subdir_stubs subdir_testclean \ $(addprefix install-, no-libc.a bin lib data headers others) -headers := limits.h values.h features.h gnu-versions.h \ +headers := limits.h values.h features.h features-time64.h gnu-versions.h \ bits/xopen_lim.h gnu/libc-version.h stdc-predef.h \ bits/libc-header-start.h diff --git a/NEWS b/NEWS index 1bf3daa502..d03831978f 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,11 @@ Major new features: __STDC_WANT_IEC_60559_BFP_EXT__, as specified in TS 18661-1, is defined, and when _GNU_SOURCE is defined. +* Add support for 64-bit time_t for ABIs with defaults to 32 bit time_t. + This is enabled with the _TIME_BITS preprocessor set to 64 and only + supported when LFS (_FILE_OFFSET_BITS=64) is also enabled. It is only + enabled for Linux and the full support requires a minimum version of 5.1. + Deprecated and removed features, and other changes affecting compatibility: * The function pthread_mutex_consistent_np has been deprecated; programs diff --git a/include/features-time64.h b/include/features-time64.h new file mode 100644 index 0000000000..06115b7c86 --- /dev/null +++ b/include/features-time64.h @@ -0,0 +1 @@ +#include_next diff --git a/include/features.h b/include/features.h index fcd1a9502f..039bcb112b 100644 --- a/include/features.h +++ b/include/features.h @@ -389,6 +389,8 @@ # define __USE_FILE_OFFSET64 1 #endif +#include + #if defined _DEFAULT_SOURCE # define __USE_MISC 1 #endif diff --git a/io/sys/poll.h b/io/sys/poll.h index 08f29df540..e640efb2bc 100644 --- a/io/sys/poll.h +++ b/io/sys/poll.h @@ -66,6 +66,17 @@ extern int ppoll (struct pollfd *__fds, nfds_t __nfds, const __sigset_t *__ss) __attr_access ((__write_only__, 1, 2)); +# ifdef __USE_TIME_BITS64 +# ifdef __REDIRECT +extern int __REDIRECT (ppoll, (struct pollfd *__fds, nfds_t __nfds, + const struct timespec *__timeout, + const __sigset_t *__ss), + __ppoll64) + __attr_access ((__write_only__, 1, 2)); +# else +# define ppoll __ppoll64 +# endif +# endif #endif __END_DECLS diff --git a/io/sys/stat.h b/io/sys/stat.h index 549375c087..f7874ec5ba 100644 --- a/io/sys/stat.h +++ b/io/sys/stat.h @@ -209,21 +209,51 @@ extern int stat (const char *__restrict __file, that file descriptor FD is open on and put them in BUF. */ extern int fstat (int __fd, struct stat *__buf) __THROW __nonnull ((2)); #else -# ifdef __REDIRECT_NTH +# ifdef __USE_TIME_BITS64 +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (stat, (const char *__restrict __file, + struct stat *__restrict __buf), + __stat64_time64) + __nonnull ((1, 2)); +extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), + __fstat64_time64) + __nonnull ((2)); +# else +# define stat __stat64_time64 +# define fstat __fstat64_time64 +# endif +# else +# ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (stat, (const char *__restrict __file, struct stat *__restrict __buf), stat64) __nonnull ((1, 2)); extern int __REDIRECT_NTH (fstat, (int __fd, struct stat *__buf), fstat64) __nonnull ((2)); -# else -# define stat stat64 -# define fstat fstat64 +# else +# define stat stat64 +# define fstat fstat64 +# endif # endif #endif #ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 extern int stat64 (const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); extern int fstat64 (int __fd, struct stat64 *__buf) __THROW __nonnull ((2)); +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (stat64, (const char *__restrict __file, + struct stat64 *__restrict __buf), + __stat64_time64) + __nonnull ((1, 2)); +extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf), + __fstat64_time64) + __nonnull ((2)); +# else +# define stat64 __stat64_time64 +# define fstat64 __fstat64_time +# endif +# endif #endif #ifdef __USE_ATFILE @@ -235,20 +265,44 @@ extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) __THROW __nonnull ((2, 3)); # else -# ifdef __REDIRECT_NTH +# ifdef __USE_TIME_BITS64 +# ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag), - fstatat64) __nonnull ((2, 3)); + __fstatat64_time64) __nonnull ((2, 3)); +# else +# define fstatat __fstatat64_time64 +# endif # else -# define fstatat fstatat64 +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, + struct stat *__restrict __buf, + int __flag), + fstatat64) __nonnull ((2, 3)); +# else +# define fstatat fstatat64 +# endif # endif # endif # ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 extern int fstatat64 (int __fd, const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) __THROW __nonnull ((2, 3)); +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (fstatat64, (int __fd, + const char *__restrict __file, + struct stat64 *__restrict __buf, + int __flag), + __fstatat64_time64) + __nonnull ((2, 3)); +# else +# define fstatat64 __fstatat64_time64 +# endif +# endif # endif #endif @@ -259,19 +313,37 @@ extern int fstatat64 (int __fd, const char *__restrict __file, extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) __THROW __nonnull ((1, 2)); # else -# ifdef __REDIRECT_NTH +# ifdef __USE_TIME_BITS64 +# ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (lstat, (const char *__restrict __file, - struct stat *__restrict __buf), lstat64) + struct stat *__restrict __buf), __lstat64_time64) __nonnull ((1, 2)); +# else +# define lstat __lstat64_time64 +# endif # else -# define lstat lstat64 +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (lstat, + (const char *__restrict __file, + struct stat *__restrict __buf), lstat64) + __nonnull ((1, 2)); +# else +# define lstat lstat64 +# endif # endif # endif # ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 extern int lstat64 (const char *__restrict __file, struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); +# else +extern int __REDIRECT_NTH (lstat64, (const char *__restrict __file, + struct stat64 *__restrict __buf), + __lstat64_time64) + __nonnull ((1, 2)); +# endif # endif #endif @@ -355,17 +427,38 @@ extern int mkfifoat (int __fd, const char *__path, __mode_t __mode) #endif #ifdef __USE_ATFILE +# ifndef __USE_TIME_BITS64 /* Set file access and modification times relative to directory file descriptor. */ extern int utimensat (int __fd, const char *__path, const struct timespec __times[2], int __flags) __THROW __nonnull ((2)); +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (utimensat, (int fd, const char *__path, + const struct timespec __times[2], + int flags), + __utimensat64) __nonnull ((2)); +# else +# define utimensat __utimensat64 +# endif +# endif #endif #ifdef __USE_XOPEN2K8 +# ifndef __USE_TIME_BITS64 /* Set file access and modification times of the file associated with FD. */ extern int futimens (int __fd, const struct timespec __times[2]) __THROW; + +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (futimens, (int fd, const struct timespec __times[2]), + __futimens64); +# else +# define futimens __futimens64 +# endif +# endif #endif #ifdef __USE_GNU diff --git a/io/utime.h b/io/utime.h index c7612d0838..1a645a3fff 100644 --- a/io/utime.h +++ b/io/utime.h @@ -46,10 +46,21 @@ struct utimbuf /* Set the access and modification times of FILE to those given in *FILE_TIMES. If FILE_TIMES is NULL, set them to the current time. */ +#ifndef __USE_TIME_BITS64 extern int utime (const char *__file, const struct utimbuf *__file_times) __THROW __nonnull ((1)); +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (utime, (const char *__file, + const struct utimbuf *__file_times), + __utime64); +# else +# define utime __utime64 +# endif +#endif + __END_DECLS #endif /* utime.h */ diff --git a/manual/creature.texi b/manual/creature.texi index 705a949089..9fa658e9a7 100644 --- a/manual/creature.texi +++ b/manual/creature.texi @@ -165,6 +165,50 @@ This macro was introduced as part of the Large File Support extension (LFS). @end defvr +@defvr Macro _TIME_BITS +This macro determines the bit size of @code{time_t} (and therefore the +bit size of all @code{time_t} derived types and the prototypes of all +related functions). If @code{_TIME_BITS} is undefined, the bit size of +@code{time_t} is architecture dependent. + +Possible values of @code{_TIME_BITS}: +@enumerate +@item +@code{_TIME_BITS=64} and port from the outset uses 64-bit +@code{time_t} and word size equals to @w{64 bits} (e.g. x86_64) - no +action + +@item +@code{_TIME_BITS=32} and port from the outset uses 32-bit +@code{time_t} and word size equals to @w{64 bits} (e.g. ARM) - no +action + +@item +@code{_TIME_BITS=64} and port from the outset uses 64-bit +@code{time_t} and word size equals to @w{32 bits} (e.g. ARC, RV32) +- no action + +@item +@code{_TIME_BITS=64} and port from the outset uses 32-bit +@code{time_t} and word size equals to @w{32 bits} (e.g. ARM) +- the @code{time_t} is modified to be able to hold 64-bit time. + +@item +For any other use case the compile-time error is emitted. +@end enumerate + +The @code{_TIME_BITS} can be only used when @code{_FILE_OFFSET_BITS=64} +is also defined. + +For the point @b{4} above, calls to proper syscalls depend on the +Linux kernel version on which the system is running. For Linux kernel +version above @b{5.1} syscalls supporting 64-bit time are used. Otherwise, +a fallback code is used with legacy (i.e. 32-bit) syscalls. + +By using this macro certain ports gain support for 64-bit time and as +a result become immune to Y2038 problem. +@end defvr + @defvr Macro _ISOC99_SOURCE @standards{GNU, (none)} If this macro is defined, features from ISO C99 are included. Since diff --git a/misc/sys/select.h b/misc/sys/select.h index 188a7fe607..e9c0e8fc20 100644 --- a/misc/sys/select.h +++ b/misc/sys/select.h @@ -98,10 +98,23 @@ __BEGIN_DECLS This function is a cancellation point and therefore not marked with __THROW. */ +#ifndef __USE_TIME_BITS64 extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); +#else +# ifdef __REDIRECT +extern int __REDIRECT (select, + (int __nfds, fd_set *__restrict __readfds, + fd_set *__restrict __writefds, + fd_set *__restrict __exceptfds, + struct timeval *__restrict __timeout), + __select64); +# else +# define select __select64 +# endif +#endif #ifdef __USE_XOPEN2K /* Same as above only that the TIMEOUT value is given with higher @@ -110,11 +123,25 @@ extern int select (int __nfds, fd_set *__restrict __readfds, This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); +# else +# ifdef __REDIRECT +extern int __REDIRECT (pselect, + (int __nfds, fd_set *__restrict __readfds, + fd_set *__restrict __writefds, + fd_set *__restrict __exceptfds, + const struct timespec *__restrict __timeout, + const __sigset_t *__restrict __sigmask), + __pselect64); +# else +# define pselect __pselect64 +# endif +# endif #endif diff --git a/nptl/pthread_clockjoin.c b/nptl/pthread_clockjoin.c index f5007d7831..2d01ba03a2 100644 --- a/nptl/pthread_clockjoin.c +++ b/nptl/pthread_clockjoin.c @@ -36,7 +36,8 @@ ___pthread_clockjoin_np64 (pthread_t threadid, void **thread_return, #if __TIMESIZE == 64 strong_alias (___pthread_clockjoin_np64, ___pthread_clockjoin_np) #else /* __TIMESPEC64 != 64 */ -libc_hidden_ver (___pthread_clockjoin_np64, __pthread_clockjoin_np64) +strong_alias (___pthread_clockjoin_np64, __pthread_clockjoin_np64) +libc_hidden_def (__pthread_clockjoin_np64) int ___pthread_clockjoin_np (pthread_t threadid, void **thread_return, diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c index 409a99ecb7..daba8600fe 100644 --- a/nptl/pthread_cond_wait.c +++ b/nptl/pthread_cond_wait.c @@ -647,10 +647,8 @@ ___pthread_cond_timedwait64 (pthread_cond_t *cond, pthread_mutex_t *mutex, #if __TIMESIZE == 64 strong_alias (___pthread_cond_timedwait64, ___pthread_cond_timedwait) #else -libc_hidden_ver (___pthread_cond_timedwait64, __pthread_cond_timedwait64) -#ifndef SHARED strong_alias (___pthread_cond_timedwait64, __pthread_cond_timedwait64) -#endif +libc_hidden_def (__pthread_cond_timedwait64) int ___pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex, @@ -688,9 +686,8 @@ ___pthread_cond_clockwait64 (pthread_cond_t *cond, pthread_mutex_t *mutex, #if __TIMESIZE == 64 strong_alias (___pthread_cond_clockwait64, ___pthread_cond_clockwait) #else -versioned_symbol (libc, ___pthread_cond_clockwait64, - __pthread_cond_clockwait64, GLIBC_PRIVATE); -libc_hidden_ver (___pthread_cond_clockwait64, __pthread_cond_clockwait64) +strong_alias (___pthread_cond_clockwait64, __pthread_cond_clockwait64); +libc_hidden_def (__pthread_cond_clockwait64) int ___pthread_cond_clockwait (pthread_cond_t *cond, pthread_mutex_t *mutex, diff --git a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c index acd78131b2..5afd6222d6 100644 --- a/nptl/pthread_mutex_timedlock.c +++ b/nptl/pthread_mutex_timedlock.c @@ -585,7 +585,8 @@ ___pthread_mutex_clocklock64 (pthread_mutex_t *mutex, #if __TIMESIZE == 64 strong_alias (___pthread_mutex_clocklock64, ___pthread_mutex_clocklock) #else /* __TIMESPEC64 != 64 */ -libc_hidden_ver (___pthread_mutex_clocklock64, __pthread_mutex_clocklock64) +strong_alias (___pthread_mutex_clocklock64, __pthread_mutex_clocklock64) +libc_hidden_def (__pthread_mutex_clocklock64) int ___pthread_mutex_clocklock (pthread_mutex_t *mutex, @@ -618,9 +619,8 @@ ___pthread_mutex_timedlock64 (pthread_mutex_t *mutex, #if __TIMESIZE == 64 strong_alias (___pthread_mutex_timedlock64, ___pthread_mutex_timedlock) #else /* __TIMESPEC64 != 64 */ -versioned_symbol (libc, ___pthread_mutex_timedlock64, - __pthread_mutex_timedlock64, GLIBC_PRIVATE); -libc_hidden_ver (___pthread_mutex_timedlock64, __pthread_mutex_timedlock64) +strong_alias (___pthread_mutex_timedlock64, __pthread_mutex_timedlock64); +libc_hidden_def (__pthread_mutex_timedlock64) int ___pthread_mutex_timedlock (pthread_mutex_t *mutex, diff --git a/nptl/pthread_rwlock_clockrdlock.c b/nptl/pthread_rwlock_clockrdlock.c index 9db96b9904..83ae1d1823 100644 --- a/nptl/pthread_rwlock_clockrdlock.c +++ b/nptl/pthread_rwlock_clockrdlock.c @@ -31,8 +31,8 @@ ___pthread_rwlock_clockrdlock64 (pthread_rwlock_t *rwlock, clockid_t clockid, #if __TIMESIZE == 64 strong_alias (___pthread_rwlock_clockrdlock64, ___pthread_rwlock_clockrdlock) #else /* __TIMESPEC64 != 64 */ -libc_hidden_ver (___pthread_rwlock_clockrdlock64, - __pthread_rwlock_clockrdlock64) +strong_alias (___pthread_rwlock_clockrdlock64, __pthread_rwlock_clockrdlock64) +libc_hidden_def (__pthread_rwlock_clockrdlock64) int ___pthread_rwlock_clockrdlock (pthread_rwlock_t *rwlock, clockid_t clockid, diff --git a/nptl/pthread_rwlock_clockwrlock.c b/nptl/pthread_rwlock_clockwrlock.c index ca0ebe2a65..08a2276da5 100644 --- a/nptl/pthread_rwlock_clockwrlock.c +++ b/nptl/pthread_rwlock_clockwrlock.c @@ -31,8 +31,8 @@ ___pthread_rwlock_clockwrlock64 (pthread_rwlock_t *rwlock, clockid_t clockid, #if __TIMESIZE == 64 strong_alias (___pthread_rwlock_clockwrlock64, ___pthread_rwlock_clockwrlock) #else /* __TIMESPEC64 != 64 */ -libc_hidden_ver (___pthread_rwlock_clockwrlock64, - __pthread_rwlock_clockwrlock64) +strong_alias (___pthread_rwlock_clockwrlock64, __pthread_rwlock_clockwrlock64) +libc_hidden_def (__pthread_rwlock_clockwrlock64) int ___pthread_rwlock_clockwrlock (pthread_rwlock_t *rwlock, clockid_t clockid, diff --git a/nptl/pthread_rwlock_timedrdlock.c b/nptl/pthread_rwlock_timedrdlock.c index dd9b7cb0a2..8c73af26fb 100644 --- a/nptl/pthread_rwlock_timedrdlock.c +++ b/nptl/pthread_rwlock_timedrdlock.c @@ -30,8 +30,8 @@ ___pthread_rwlock_timedrdlock64 (pthread_rwlock_t *rwlock, #if __TIMESIZE == 64 strong_alias (___pthread_rwlock_timedrdlock64, ___pthread_rwlock_timedrdlock) #else /* __TIMESPEC64 != 64 */ -libc_hidden_ver (___pthread_rwlock_timedrdlock64, - __pthread_rwlock_timedrdlock64) +strong_alias (___pthread_rwlock_timedrdlock64, __pthread_rwlock_timedrdlock64) +libc_hidden_def (__pthread_rwlock_timedrdlock64) int ___pthread_rwlock_timedrdlock (pthread_rwlock_t *rwlock, diff --git a/nptl/pthread_rwlock_timedwrlock.c b/nptl/pthread_rwlock_timedwrlock.c index e660a544cd..890da92968 100644 --- a/nptl/pthread_rwlock_timedwrlock.c +++ b/nptl/pthread_rwlock_timedwrlock.c @@ -30,8 +30,8 @@ ___pthread_rwlock_timedwrlock64 (pthread_rwlock_t *rwlock, #if __TIMESIZE == 64 strong_alias (___pthread_rwlock_timedwrlock64, ___pthread_rwlock_timedwrlock) #else /* __TIMESPEC64 != 64 */ -libc_hidden_ver (___pthread_rwlock_timedwrlock64, - __pthread_rwlock_timedwrlock64) +strong_alias (___pthread_rwlock_timedwrlock64, __pthread_rwlock_timedwrlock64) +libc_hidden_def (__pthread_rwlock_timedwrlock64) int ___pthread_rwlock_timedwrlock (pthread_rwlock_t *rwlock, diff --git a/nptl/pthread_timedjoin.c b/nptl/pthread_timedjoin.c index ebc31f935a..0b4026612f 100644 --- a/nptl/pthread_timedjoin.c +++ b/nptl/pthread_timedjoin.c @@ -31,7 +31,8 @@ ___pthread_timedjoin_np64 (pthread_t threadid, void **thread_return, #if __TIMESIZE == 64 strong_alias (___pthread_timedjoin_np64, ___pthread_timedjoin_np) #else /* __TIMESPEC64 != 64 */ -libc_hidden_ver (___pthread_timedjoin_np64, __pthread_timedjoin_np64) +strong_alias (___pthread_timedjoin_np64, __pthread_timedjoin_np64) +libc_hidden_def (__pthread_timedjoin_np64) int ___pthread_timedjoin_np (pthread_t threadid, void **thread_return, diff --git a/nptl/sem_clockwait.c b/nptl/sem_clockwait.c index 2739799e26..19751aff04 100644 --- a/nptl/sem_clockwait.c +++ b/nptl/sem_clockwait.c @@ -49,7 +49,8 @@ ___sem_clockwait64 (sem_t *sem, clockid_t clockid, #if __TIMESIZE == 64 strong_alias (___sem_clockwait64, ___sem_clockwait) #else /* __TIMESPEC64 != 64 */ -libc_hidden_ver (___sem_clockwait64, __sem_clockwait64) +strong_alias (___sem_clockwait64, __sem_clockwait64) +libc_hidden_def (__sem_clockwait64) int ___sem_clockwait (sem_t *sem, clockid_t clockid, const struct timespec *abstime) diff --git a/nptl/sem_timedwait.c b/nptl/sem_timedwait.c index 584546c706..5c8f37d3bb 100644 --- a/nptl/sem_timedwait.c +++ b/nptl/sem_timedwait.c @@ -45,10 +45,8 @@ ___sem_timedwait64 (sem_t *sem, const struct __timespec64 *abstime) #if __TIMESIZE == 64 strong_alias (___sem_timedwait64, ___sem_timedwait) #else /* __TIMESPEC64 != 64 */ -libc_hidden_ver (___sem_timedwait64, __sem_timedwait64) -#ifndef SHARED strong_alias (___sem_timedwait64, __sem_timedwait64) -#endif +libc_hidden_def (__sem_timedwait64) int ___sem_timedwait (sem_t *sem, const struct timespec *abstime) diff --git a/posix/sched.h b/posix/sched.h index d8ce08a3ea..7dd97a49b2 100644 --- a/posix/sched.h +++ b/posix/sched.h @@ -74,8 +74,17 @@ extern int sched_get_priority_max (int __algorithm) __THROW; extern int sched_get_priority_min (int __algorithm) __THROW; /* Get the SCHED_RR interval for the named process. */ +#ifndef __USE_TIME_BITS64 extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; - +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (sched_rr_get_interval, + (__pid_t __pid, struct timespec *__t), + __sched_rr_get_interval64); +# else +# define sched_rr_get_interval __sched_rr_get_interval64 +# endif +#endif #ifdef __USE_GNU /* Access macros for `cpu_set'. */ diff --git a/posix/sys/wait.h b/posix/sys/wait.h index 9e7bb7f154..5325bfa4d2 100644 --- a/posix/sys/wait.h +++ b/posix/sys/wait.h @@ -144,14 +144,34 @@ struct rusage; nil, store information about the child's resource usage there. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. */ +# ifndef __USE_TIME_BITS64 extern __pid_t wait3 (int *__stat_loc, int __options, struct rusage * __usage) __THROWNL; +# else +# ifdef __REDIRECT_NTHNL +extern __pid_t __REDIRECT_NTHNL (wait3, (int *__stat_loc, int __options, + struct rusage * __usage), + __wait3_time64); +# else +# define wait3 __wait3_time64 +# endif +# endif #endif #ifdef __USE_MISC +# ifndef __USE_TIME_BITS64 /* PID is like waitpid. Other args are like wait3. */ extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options, struct rusage *__usage) __THROWNL; +# else +# ifdef __REDIRECT_NTHNL +extern __pid_t __REDIRECT_NTHNL (wait4, (__pid_t __pid, int *__stat_loc, + int __options, struct rusage *__usage), + __wait4_time64); +# else +# define wait4 __wait4_time64 +# endif +# endif #endif /* Use misc. */ diff --git a/resolv/netdb.h b/resolv/netdb.h index 1f36f25d4a..9b242ce3d1 100644 --- a/resolv/netdb.h +++ b/resolv/netdb.h @@ -701,6 +701,17 @@ extern int getaddrinfo_a (int __mode, struct gaicb *__list[__restrict_arr], extern int gai_suspend (const struct gaicb *const __list[], int __ent, const struct timespec *__timeout); +# ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT) +extern int __REDIRECT (gai_suspend, (const struct gaicb *const __list[], + int __ent, + const struct timespec *__timeout), + __gai_suspend_time64); +# else +# define gai_suspend __gai_suspend_time64 +# endif +# endif + /* Get the error status of the request REQ. */ extern int gai_error (struct gaicb *__req) __THROW; diff --git a/resource/sys/resource.h b/resource/sys/resource.h index d30379d085..551d25e275 100644 --- a/resource/sys/resource.h +++ b/resource/sys/resource.h @@ -88,6 +88,16 @@ extern int setrlimit64 (__rlimit_resource_t __resource, and put it in *USAGE. Returns 0 for success, -1 for failure. */ extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW; +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT_NTH) +extern int __REDIRECT_NTH (getrusage, (__rusage_who_t __who, + struct rusage *__usage), + __getrusage64); +# else +# define getrusage __getrusage64 +# endif +#endif + /* Return the highest priority of any process specified by WHICH and WHO (see above); if WHO is zero, the current process, process group, or user (as specified by WHO) is used. A lower priority number means higher diff --git a/rt/aio.h b/rt/aio.h index 3a107b2783..72cf626690 100644 --- a/rt/aio.h +++ b/rt/aio.h @@ -193,12 +193,17 @@ extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp), extern int __REDIRECT_NTH (aio_cancel, (int __fildes, struct aiocb *__aiocbp), aio_cancel64); - +# ifdef __USE_TIME_BITS64 +extern int __REDIRECT_NTH (aio_suspend, + (const struct aiocb *const __list[], int __nent, + const struct timespec *__restrict __timeout), + __aio_suspend_time64) __nonnull ((1)); +# else extern int __REDIRECT_NTH (aio_suspend, (const struct aiocb *const __list[], int __nent, const struct timespec *__restrict __timeout), aio_suspend64) __nonnull ((1)); - +# endif extern int __REDIRECT_NTH (aio_fsync, (int __operation, struct aiocb *__aiocbp), aio_fsync64) __nonnull ((2)); @@ -210,7 +215,11 @@ extern int __REDIRECT_NTH (aio_fsync, # define aio_error aio_error64 # define aio_return aio_return64 # define aio_cancel aio_cancel64 -# define aio_suspend aio_suspend64 +# ifdef __USE_TIME_BITS64 +# define aio_suspend __aio_suspend_time64 +# else +# define aio_suspend aio_suspend64 +# endif # define aio_fsync aio_fsync64 # endif #endif diff --git a/rt/mqueue.h b/rt/mqueue.h index 8a62d99f50..e8a85637e4 100644 --- a/rt/mqueue.h +++ b/rt/mqueue.h @@ -71,6 +71,7 @@ extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio) __nonnull ((2)); #ifdef __USE_XOPEN2K +# ifndef __USE_TIME_BITS64 /* Receive the oldest from highest priority messages in message queue MQDES, stop waiting if ABS_TIMEOUT expires. */ extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr, @@ -85,6 +86,27 @@ extern int mq_timedsend (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio, const struct timespec *__abs_timeout) __nonnull ((2, 5)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (mq_timedreceive, (mqd_t __mqdes, + char *__restrict __msg_ptr, + size_t __msg_len, + unsigned int *__restrict __msg_prio, + const struct timespec *__restrict __abs_timeout), + __mq_timedreceive_time64) + __nonnull ((2, 5)); + +extern int __REDIRECT (mq_timedsend, (mqd_t __mqdes, + const char *__msg_ptr, size_t __msg_len, + unsigned int __msg_prio, + const struct timespec *__abs_timeout), + __mq_timedsend_time64) + __nonnull ((2, 5)); +# else +# define mq_timedreceive __mq_timedreceive_time64 +# define mq_timedsend __mq_timedsend_time64 +# endif +# endif #endif /* Define some inlines helping to catch common problems. */ diff --git a/signal/signal.h b/signal/signal.h index b17203c99c..5fd93382fc 100644 --- a/signal/signal.h +++ b/signal/signal.h @@ -269,10 +269,23 @@ extern int sigwaitinfo (const sigset_t *__restrict __set, This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int sigtimedwait (const sigset_t *__restrict __set, siginfo_t *__restrict __info, const struct timespec *__restrict __timeout) __nonnull ((1)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (sigtimedwait, + (const sigset_t *__restrict __set, + siginfo_t *__restrict __info, + const struct timespec *__restrict __timeout), + __sigtimedwait64) + __nonnull ((1)); +# else +# define sigtimedwait __sigtimedwait64 +# endif +# endif /* Send signal SIG to the process PID. Associate data in VAL with the signal. */ diff --git a/socket/sys/socket.h b/socket/sys/socket.h index 949851a6ce..5577e75b80 100644 --- a/socket/sys/socket.h +++ b/socket/sys/socket.h @@ -196,9 +196,20 @@ extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int recvmmsg (int __fd, struct mmsghdr *__vmessages, unsigned int __vlen, int __flags, struct timespec *__tmo); +# else +# ifdef __REDIRECT +extern int __REDIRECT (recvmmsg, (int __fd, struct mmsghdr *__vmessages, + unsigned int __vlen, int __flags, + struct timespec *__tmo), + __recvmmsg64); +# else +# define recvmmsg __recvmmsg64 +# endif +# endif #endif diff --git a/sysdeps/generic/features-time64.h b/sysdeps/generic/features-time64.h new file mode 100644 index 0000000000..a5a677f837 --- /dev/null +++ b/sysdeps/generic/features-time64.h @@ -0,0 +1,19 @@ +/* Features part to handle 64-bit time_t support. Generic version. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* The generic configuration only support _TIME_BITS=32. */ diff --git a/sysdeps/generic/time64-compat.h b/sysdeps/generic/time64-compat.h new file mode 100644 index 0000000000..6f0bf9dd08 --- /dev/null +++ b/sysdeps/generic/time64-compat.h @@ -0,0 +1,3 @@ +/* Header included by Versions to generate the 64-bit time_t compat symbols. + Legacy ABIs with default 32 bit time support define TIME64_NON_DEFAULT to + generate the 64-bit symbols. */ diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h index 22e037dcb4..52e2eadbfc 100644 --- a/sysdeps/nptl/pthread.h +++ b/sysdeps/nptl/pthread.h @@ -221,6 +221,7 @@ extern int pthread_join (pthread_t __th, void **__thread_return); the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL. */ extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW; +# ifndef __USE_TIME_BITS64 /* Make calling thread wait for termination of the thread TH, but only until TIMEOUT. The exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN is not NULL. @@ -240,6 +241,23 @@ extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return, extern int pthread_clockjoin_np (pthread_t __th, void **__thread_return, clockid_t __clockid, const struct timespec *__abstime); +# else +# ifdef __REDIRECT +extern int __REDIRECT (pthread_timedjoin_np, + (pthread_t __th, void **__thread_return, + const struct timespec *__abstime), + __pthread_timedjoin_np64); + +extern int __REDIRECT (pthread_clockjoin_np, + (pthread_t __th, void **__thread_return, + clockid_t __clockid, + const struct timespec *__abstime), + __pthread_clockjoin_np64); +# else +# define pthread_timedjoin_np __pthread_timedjoin_np64 +# define pthread_clockjoin_np __pthread_clockjoin_np64 +# endif +# endif #endif /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. @@ -776,16 +794,39 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex) #ifdef __USE_XOPEN2K /* Wait until lock becomes available, or specified time passes. */ +# ifndef __USE_TIME_BITS64 extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_mutex_timedlock, + (pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict __abstime), + __pthread_mutex_timedlock64) __nonnull ((1, 2)); +# else +# define pthread_mutex_timedlock __pthread_mutex_timedlock64 +# endif +# endif #endif #ifdef __USE_GNU +# ifndef __USE_TIME_BITS64 extern int pthread_mutex_clocklock (pthread_mutex_t *__restrict __mutex, clockid_t __clockid, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 3)); +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_mutex_clocklock, + (pthread_mutex_t *__restrict __mutex, + clockid_t __clockid, + const struct timespec *__restrict __abstime), + __pthread_mutex_clocklock64) __nonnull ((1, 3)); +# else +# define pthread_mutex_clocklock __pthread_mutex_clocklock64 +# endif +# endif #endif /* Unlock a mutex. */ @@ -939,16 +980,41 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) # ifdef __USE_XOPEN2K /* Try to acquire read lock for RWLOCK or return after specfied time. */ +# ifndef __USE_TIME_BITS64 extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_rwlock_timedrdlock, + (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict __abstime), + __pthread_rwlock_timedrdlock64) + __nonnull ((1, 2)); +# else +# define pthread_rwlock_timedrdlock __pthread_rwlock_timedrdlock64 +# endif +# endif # endif # ifdef __USE_GNU +# ifndef __USE_TIME_BITS64 extern int pthread_rwlock_clockrdlock (pthread_rwlock_t *__restrict __rwlock, clockid_t __clockid, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 3)); +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_rwlock_clockrdlock, + (pthread_rwlock_t *__restrict __rwlock, + clockid_t __clockid, + const struct timespec *__restrict __abstime), + __pthread_rwlock_clockrdlock64) + __nonnull ((1, 3)); +# else +# define pthread_rwlock_clockrdlock __pthread_rwlock_clockrdlock64 +# endif +# endif # endif /* Acquire write lock for RWLOCK. */ @@ -961,16 +1027,42 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) # ifdef __USE_XOPEN2K /* Try to acquire write lock for RWLOCK or return after specfied time. */ +# ifndef __USE_TIME_BITS64 extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 2)); +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_rwlock_timedwrlock, + (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict __abstime), + __pthread_rwlock_timedwrlock64) + __nonnull ((1, 2)); +# else +# define pthread_rwlock_timedwrlock __pthread_rwlock_timedwrlock64 +# endif +# endif # endif # ifdef __USE_GNU +# ifndef __USE_TIME_BITS64 extern int pthread_rwlock_clockwrlock (pthread_rwlock_t *__restrict __rwlock, clockid_t __clockid, const struct timespec *__restrict __abstime) __THROWNL __nonnull ((1, 3)); + +# else +# ifdef __REDIRECT_NTHNL +extern int __REDIRECT_NTHNL (pthread_rwlock_clockwrlock, + (pthread_rwlock_t *__restrict __rwlock, + clockid_t __clockid, + const struct timespec *__restrict __abstime), + __pthread_rwlock_clockwrlock64) + __nonnull ((1, 3)); +# else +# define pthread_rwlock_clockwrlock __pthread_rwlock_clockwrlock64 +# endif +# endif # endif /* Unlock RWLOCK. */ @@ -1047,10 +1139,23 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __nonnull ((1, 2, 3)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (pthread_cond_timedwait, + (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict __abstime), + __pthread_cond_timedwait64) + __nonnull ((1, 2, 3)); +# else +# define pthread_cond_timedwait __pthread_cond_timedwait64 +# endif +# endif # ifdef __USE_GNU /* Wait for condition variable COND to be signaled or broadcast until @@ -1060,11 +1165,25 @@ extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int pthread_cond_clockwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, __clockid_t __clock_id, const struct timespec *__restrict __abstime) __nonnull ((1, 2, 4)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (pthread_cond_clockwait, + (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex, + __clockid_t __clock_id, + const struct timespec *__restrict __abstime), + __pthread_cond_clockwait64) + __nonnull ((1, 2, 4)); +# else +# define pthread_cond_clockwait __pthread_cond_clockwait64 +# endif +# endif # endif /* Functions for handling condition variable attributes. */ diff --git a/sysdeps/pthread/semaphore.h b/sysdeps/pthread/semaphore.h index 7fb0e5c103..35780e7c4e 100644 --- a/sysdeps/pthread/semaphore.h +++ b/sysdeps/pthread/semaphore.h @@ -59,16 +59,41 @@ extern int sem_wait (sem_t *__sem) __nonnull ((1)); This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int sem_timedwait (sem_t *__restrict __sem, const struct timespec *__restrict __abstime) __nonnull ((1, 2)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (sem_timedwait, + (sem_t *__restrict __sem, + const struct timespec *__restrict __abstime), + __sem_timedwait64) + __nonnull ((1, 2)); +# else +# define sem_timedwait __sem_timedwait64 +# endif +# endif #endif #ifdef __USE_GNU +# ifndef __USE_TIME_BITS64 extern int sem_clockwait (sem_t *__restrict __sem, clockid_t clock, const struct timespec *__restrict __abstime) __nonnull ((1, 3)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (sem_clockwait, + (sem_t *__restrict __sem, + clockid_t clock, + const struct timespec *__restrict __abstime), + __sem_clockwait64) + __nonnull ((1, 3)); +# else +# define sem_clockwait __sem_clockwait64 +# endif +# endif #endif /* Test whether SEM is posted. */ diff --git a/sysdeps/pthread/threads.h b/sysdeps/pthread/threads.h index 46929a025e..bf251c9db4 100644 --- a/sysdeps/pthread/threads.h +++ b/sysdeps/pthread/threads.h @@ -88,8 +88,18 @@ extern thrd_t thrd_current (void); __TIME_POINT. The current thread may resume if receives a signal. In that case, if __REMAINING is not NULL, the remaining time is stored in the object pointed by it. */ +#ifndef __USE_TIME_BITS64 extern int thrd_sleep (const struct timespec *__time_point, struct timespec *__remaining); +#else +# ifdef __REDIRECT +extern int __REDIRECT (thrd_sleep, (const struct timespec *__time_point, + struct timespec *__remaining), + __thrd_sleep64); +# else +# define thrd_sleep __thrd_sleep64 +# endif +#endif /* Terminate current thread execution, cleaning up any thread local storage and freeing resources. Returns the value specified in __RES. */ @@ -131,8 +141,19 @@ extern int mtx_lock (mtx_t *__mutex); /* Block the current thread until the mutex pointed by __MUTEX is unlocked or time pointed by __TIME_POINT is reached. In case the mutex is unlock, the current thread will not be blocked. */ +#ifndef __USE_TIME_BITS64 extern int mtx_timedlock (mtx_t *__restrict __mutex, const struct timespec *__restrict __time_point); +#else +# ifdef __REDIRECT +extern int __REDIRECT (mtx_timedlock, (mtx_t *__restrict __mutex, + const struct timespec *__restrict + __time_point), + __mtx_timedlock64); +# else +# define mtx_timedlock __mtx_timedlock64 +# endif +#endif /* Try to lock the mutex pointed by __MUTEX without blocking. If the mutex is free the current threads takes control of it, otherwise it returns @@ -171,9 +192,21 @@ extern int cnd_wait (cnd_t *__cond, mtx_t *__mutex); /* Block current thread on the condition variable until condition variable pointed by __COND is signaled or time pointed by __TIME_POINT is reached. */ +#ifndef __USE_TIME_BITS64 extern int cnd_timedwait (cnd_t *__restrict __cond, mtx_t *__restrict __mutex, const struct timespec *__restrict __time_point); +#else +# ifdef __REDIRECT +extern int __REDIRECT (cnd_timedwait, (cnd_t *__restrict __cond, + mtx_t *__restrict __mutex, + const struct timespec *__restrict + __time_point), + __cnd_timedwait64); +# else +# define cnd_timedwait __cnd_timedwait64 +# endif +#endif /* Destroy condition variable pointed by __cond and free all of its resources. */ diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 8b4d3a6a54..aedd02fd55 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -102,8 +102,11 @@ sysdep_headers += sys/mount.h sys/acct.h \ bits/ipc-perm.h \ bits/struct_stat.h \ bits/struct_stat_time64_helper.h \ + bits/types/struct_msqid64_ds.h \ bits/types/struct_msqid64_ds_helper.h \ + bits/types/struct_semid64_ds.h \ bits/types/struct_semid64_ds_helper.h \ + bits/types/struct_shmid64_ds.h \ bits/types/struct_shmid64_ds_helper.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 4637fd651d..0aa2ef8559 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -1,3 +1,4 @@ +%include libc { GLIBC_2.0 { # functions used in inline functions or macros @@ -185,6 +186,81 @@ libc { getdents64; gettid; tgkill; } GLIBC_2.32 { + } + GLIBC_2.34 { +%ifdef TIME64_NON_DEFAULT + # 64-bit time_t support + __adjtime64; + ___adjtimex64; + __clock_adjtime64; + __clock_getres64; + __clock_gettime64; + __clock_nanosleep_time64; + __clock_settime64; + __cnd_timedwait64; + __ctime64; + __ctime64_r; + __difftime64; + __fstat64_time64; + __fstatat64_time64; + __futimens64; + __futimes64; + __futimesat64; + __getitimer64; + __getrusage64; + __gettimeofday64; + __gmtime64; + __gmtime64_r; + __localtime64; + __localtime64_r; + __lstat64_time64; + __lutimes64; + __mktime64; + __msgctl64; + __mtx_timedlock64; + __nanosleep64; + __nanosleep64; + __ntp_gettime64; + __ntp_gettimex64; + __ppoll64; + __pselec64; + __pselect64; + __pthread_clockjoin_np64; + __pthread_cond_clockwait64; + __pthread_cond_timedwait64; + __pthread_mutex_clocklock64; + __pthread_mutex_timedlock64; + __pthread_rwlock_clockrdlock64; + __pthread_rwlock_clockwrlock64; + __pthread_rwlock_timedrdlock64; + __pthread_rwlock_timedwrlock64; + __pthread_timedjoin_np64; + __recvmmsg64; + __sched_rr_get_interval64; + __select64; + __sem_clockwait64; + __semctl64; + __semtimedop64; + __sem_timedwait64; + __setitimer64; + __settimeofday64; + __shmctl64; + __sigtimedwait64; + __stat64_time64; + __thrd_sleep64; + __time64; + __timegm64; + __timerfd_gettime64; + __timerfd_settime64; + __timespec_get64; + __timespec_getres64; + __utime64; + __utimensat64; + __utimes64; + __utimes64; + __wait3_time64; + __wait4_time64; +%endif } GLIBC_PRIVATE { # functions used in other libraries @@ -205,3 +281,24 @@ ld { __nptl_change_stack_perm; } } + +librt { + GLIBC_2.34 { +%ifdef TIME64_NON_DEFAULT + # 64-bit time_t support + __aio_suspend_time64; + __mq_timedsend_time64; + __mq_timedreceive_time64; + __timer_gettime64; + __timer_settime64; +%endif + } +} + +libanl { +%ifdef TIME64_NON_DEFAULT + GLIBC_2.34 { + __gai_suspend_time64; + } +%endif +} diff --git a/sysdeps/unix/sysv/linux/arm/be/libanl.abilist b/sysdeps/unix/sysv/linux/arm/be/libanl.abilist index a8fafedb66..37f9b49e52 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libanl.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libanl.abilist @@ -1,3 +1,4 @@ +GLIBC_2.34 __gai_suspend_time64 F GLIBC_2.4 gai_cancel F GLIBC_2.4 gai_error F GLIBC_2.4 gai_suspend F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index f66ee7aab1..1d32514579 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -190,16 +190,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/arm/be/librt.abilist b/sysdeps/unix/sysv/linux/arm/be/librt.abilist index 3c0647b251..8cb1ed626c 100644 --- a/sysdeps/unix/sysv/linux/arm/be/librt.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/librt.abilist @@ -1,3 +1,8 @@ +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 aio_cancel F GLIBC_2.4 aio_cancel64 F GLIBC_2.4 aio_error F diff --git a/sysdeps/unix/sysv/linux/arm/le/libanl.abilist b/sysdeps/unix/sysv/linux/arm/le/libanl.abilist index a8fafedb66..37f9b49e52 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libanl.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libanl.abilist @@ -1,3 +1,4 @@ +GLIBC_2.34 __gai_suspend_time64 F GLIBC_2.4 gai_cancel F GLIBC_2.4 gai_error F GLIBC_2.4 gai_suspend F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 3798b32830..05d0878232 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -187,16 +187,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/arm/le/librt.abilist b/sysdeps/unix/sysv/linux/arm/le/librt.abilist index 3c0647b251..8cb1ed626c 100644 --- a/sysdeps/unix/sysv/linux/arm/le/librt.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/librt.abilist @@ -1,3 +1,8 @@ +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 aio_cancel F GLIBC_2.4 aio_cancel64 F GLIBC_2.4 aio_error F diff --git a/sysdeps/unix/sysv/linux/arm/time64-compat.h b/sysdeps/unix/sysv/linux/arm/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/arm/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/bits/msq.h b/sysdeps/unix/sysv/linux/bits/msq.h index 3313b69d78..7c9c479551 100644 --- a/sysdeps/unix/sysv/linux/bits/msq.h +++ b/sysdeps/unix/sysv/linux/bits/msq.h @@ -26,6 +26,7 @@ typedef __syscall_ulong_t msgqnum_t; typedef __syscall_ulong_t msglen_t; #include +#include /* Define options for message queue functions. */ #define MSG_NOERROR 010000 /* no error if message is too big */ diff --git a/sysdeps/unix/sysv/linux/bits/sem.h b/sysdeps/unix/sysv/linux/bits/sem.h index ad13287e66..776524b876 100644 --- a/sysdeps/unix/sysv/linux/bits/sem.h +++ b/sysdeps/unix/sysv/linux/bits/sem.h @@ -22,6 +22,7 @@ #include #include #include +#include /* Flags for `semop'. */ #define SEM_UNDO 0x1000 /* undo the operation on exit */ diff --git a/sysdeps/unix/sysv/linux/bits/shm.h b/sysdeps/unix/sysv/linux/bits/shm.h index a50c79d7be..454fc3f366 100644 --- a/sysdeps/unix/sysv/linux/bits/shm.h +++ b/sysdeps/unix/sysv/linux/bits/shm.h @@ -43,6 +43,7 @@ __BEGIN_DECLS typedef __syscall_ulong_t shmatt_t; #include +#include #ifdef __USE_MISC diff --git a/sysdeps/unix/sysv/linux/bits/time.h b/sysdeps/unix/sysv/linux/bits/time.h index ee5a8b3ef4..d0c98a7864 100644 --- a/sysdeps/unix/sysv/linux/bits/time.h +++ b/sysdeps/unix/sysv/linux/bits/time.h @@ -77,6 +77,16 @@ __BEGIN_DECLS /* Tune a POSIX clock. */ extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) __THROW; +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT_NTH) +extern int __REDIRECT_NTH (clock_adjtime, (__clockid_t __clock_id, + struct timex *__utx), + __clock_adjtime64); +# else +# define clock_adjtime __clock_adjtime64 +# endif +#endif + __END_DECLS #endif /* use GNU */ diff --git a/sysdeps/unix/sysv/linux/cnd_timedwait.c b/sysdeps/unix/sysv/linux/cnd_timedwait.c index 0415c683f9..6e8ce3d61b 100644 --- a/sysdeps/unix/sysv/linux/cnd_timedwait.c +++ b/sysdeps/unix/sysv/linux/cnd_timedwait.c @@ -21,8 +21,8 @@ #include "thrd_priv.h" int -___cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex, - const struct __timespec64 *restrict time_point) +__cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex, + const struct __timespec64 *restrict time_point) { int err_code = __pthread_cond_timedwait64 ((pthread_cond_t *) cond, (pthread_mutex_t *) mutex, @@ -31,9 +31,9 @@ ___cnd_timedwait64 (cnd_t *restrict cond, mtx_t *restrict mutex, } #if __TIMESIZE == 64 -strong_alias (___cnd_timedwait64, ___cnd_timedwait) +strong_alias (__cnd_timedwait64, ___cnd_timedwait) #else -libc_hidden_ver (___cnd_timedwait64, __cnd_timedwait64) +libc_hidden_def (__cnd_timedwait64) int ___cnd_timedwait (cnd_t *restrict cond, mtx_t *restrict mutex, diff --git a/sysdeps/unix/sysv/linux/csky/libanl.abilist b/sysdeps/unix/sysv/linux/csky/libanl.abilist index 416a6f8ddb..01f2e6cbf0 100644 --- a/sysdeps/unix/sysv/linux/csky/libanl.abilist +++ b/sysdeps/unix/sysv/linux/csky/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.29 gai_cancel F GLIBC_2.29 gai_error F GLIBC_2.29 gai_suspend F GLIBC_2.29 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index ba53b61ea6..ac9f009f38 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2277,16 +2277,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/csky/librt.abilist b/sysdeps/unix/sysv/linux/csky/librt.abilist index c6690ef7c1..b60deca65a 100644 --- a/sysdeps/unix/sysv/linux/csky/librt.abilist +++ b/sysdeps/unix/sysv/linux/csky/librt.abilist @@ -33,3 +33,8 @@ GLIBC_2.29 timer_delete F GLIBC_2.29 timer_getoverrun F GLIBC_2.29 timer_gettime F GLIBC_2.29 timer_settime F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F diff --git a/sysdeps/unix/sysv/linux/csky/time64-compat.h b/sysdeps/unix/sysv/linux/csky/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/csky/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/features-time64.h b/sysdeps/unix/sysv/linux/features-time64.h new file mode 100644 index 0000000000..1f786f903b --- /dev/null +++ b/sysdeps/unix/sysv/linux/features-time64.h @@ -0,0 +1,37 @@ +/* Features part to handle 64-bit time_t support. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* We need to know the word size in order to check the time size. */ +#include +#include + +#if defined _TIME_BITS +# if _TIME_BITS == 64 +# if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64 +# error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" +# elif __TIMESIZE == 32 +# define __USE_TIME_BITS64 1 +# endif +# elif _TIME_BITS == 32 +# if __TIMESIZE > 32 +# error "_TIME_BITS=32 is not compatible with __TIMESIZE > 32" +# endif +# else +# error Invalid _TIME_BITS value (can only be 32 or 64-bit) +# endif +#endif diff --git a/sysdeps/unix/sysv/linux/hppa/libanl.abilist b/sysdeps/unix/sysv/linux/hppa/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/hppa/libanl.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 9783504c93..d2770a4874 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2231,16 +2231,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/hppa/librt.abilist b/sysdeps/unix/sysv/linux/hppa/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/hppa/librt.abilist +++ b/sysdeps/unix/sysv/linux/hppa/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/hppa/time64-compat.h b/sysdeps/unix/sysv/linux/hppa/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/i386/libanl.abilist b/sysdeps/unix/sysv/linux/i386/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/i386/libanl.abilist +++ b/sysdeps/unix/sysv/linux/i386/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index c223c360ff..eb20d66c28 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2414,17 +2414,84 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __isnanf128 F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/i386/librt.abilist b/sysdeps/unix/sysv/linux/i386/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/i386/librt.abilist +++ b/sysdeps/unix/sysv/linux/i386/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/i386/time64-compat.h b/sysdeps/unix/sysv/linux/i386/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/i386/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/include/sys/msg.h b/sysdeps/unix/sysv/linux/include/sys/msg.h index 522903f818..c460be0dc9 100644 --- a/sysdeps/unix/sysv/linux/include/sys/msg.h +++ b/sysdeps/unix/sysv/linux/include/sys/msg.h @@ -7,8 +7,6 @@ extern ssize_t __libc_msgrcv (int msqid, void *msgp, size_t msgsz, extern int __libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg); -# include - # if __TIMESIZE == 64 # define __msgctl64 __msgctl # else diff --git a/sysdeps/unix/sysv/linux/include/sys/shm.h b/sysdeps/unix/sysv/linux/include/sys/shm.h index 530a1cdfc9..85177a632d 100644 --- a/sysdeps/unix/sysv/linux/include/sys/shm.h +++ b/sysdeps/unix/sysv/linux/include/sys/shm.h @@ -3,8 +3,6 @@ #ifndef _ISOMAC -# include - # if __TIMESIZE == 64 # define __shmctl64 __shmctl # else diff --git a/sysdeps/unix/sysv/linux/include/sys/timex.h b/sysdeps/unix/sysv/linux/include/sys/timex.h index e136ed172e..c554248ed9 100644 --- a/sysdeps/unix/sysv/linux/include/sys/timex.h +++ b/sysdeps/unix/sysv/linux/include/sys/timex.h @@ -23,10 +23,12 @@ # ifndef _ISOMAC +extern int __adjtimex (struct timex *__ntx); libc_hidden_proto (__adjtimex) # include # include + /* Local definition of 64 bit time supporting timex struct */ # if __TIMESIZE == 64 # define __timex64 timex diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist index a8fafedb66..37f9b49e52 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist @@ -1,3 +1,4 @@ +GLIBC_2.34 __gai_suspend_time64 F GLIBC_2.4 gai_cancel F GLIBC_2.4 gai_error F GLIBC_2.4 gai_suspend F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 3cb4279b41..044cec51fc 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -191,16 +191,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist index 3c0647b251..8cb1ed626c 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist @@ -1,3 +1,8 @@ +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 aio_cancel F GLIBC_2.4 aio_cancel64 F GLIBC_2.4 aio_error F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 94a718ff58..3a6463a3ef 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2358,16 +2358,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/m68k/time64-compat.h b/sysdeps/unix/sysv/linux/m68k/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/m68k/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist index 67c7554803..c06e33a1cf 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.18 gai_cancel F GLIBC_2.18 gai_error F GLIBC_2.18 gai_suspend F GLIBC_2.18 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 5823bf18ef..612d7f1c58 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2328,16 +2328,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist index 889dfbc0ee..1b8fc10087 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/librt.abilist @@ -33,3 +33,8 @@ GLIBC_2.18 timer_delete F GLIBC_2.18 timer_getoverrun F GLIBC_2.18 timer_gettime F GLIBC_2.18 timer_settime F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist index 67c7554803..c06e33a1cf 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.18 gai_cancel F GLIBC_2.18 gai_error F GLIBC_2.18 gai_suspend F GLIBC_2.18 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index 723c4bcb09..685cb974c3 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2325,16 +2325,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist b/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist index 889dfbc0ee..1b8fc10087 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/librt.abilist @@ -33,3 +33,8 @@ GLIBC_2.18 timer_delete F GLIBC_2.18 timer_getoverrun F GLIBC_2.18 timer_gettime F GLIBC_2.18 timer_settime F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/time64-compat.h b/sysdeps/unix/sysv/linux/microblaze/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/microblaze/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index f67da8f37a..d17b5a02a5 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2323,16 +2323,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist index 1539c1cef9..c4dd28e3b2 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index e44a6be8aa..aba6bd2e3c 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2321,16 +2321,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h b/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips32/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 21cbe39166..88d8e2af38 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2329,16 +2329,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist index 1539c1cef9..c4dd28e3b2 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/mtx_timedlock.c b/sysdeps/unix/sysv/linux/mtx_timedlock.c index 7715ebb315..8983eb8556 100644 --- a/sysdeps/unix/sysv/linux/mtx_timedlock.c +++ b/sysdeps/unix/sysv/linux/mtx_timedlock.c @@ -21,8 +21,8 @@ #include "thrd_priv.h" int -___mtx_timedlock64 (mtx_t *restrict mutex, - const struct __timespec64 *restrict time_point) +__mtx_timedlock64 (mtx_t *restrict mutex, + const struct __timespec64 *restrict time_point) { int err_code = __pthread_mutex_timedlock64 ((pthread_mutex_t *)mutex, time_point); @@ -30,9 +30,9 @@ ___mtx_timedlock64 (mtx_t *restrict mutex, } #if __TIMESIZE == 64 -strong_alias (___mtx_timedlock64, ___mtx_timedlock) +strong_alias (__mtx_timedlock64, ___mtx_timedlock) #else -libc_hidden_ver (___mtx_timedlock64, __mtx_timedlock64) +libc_hidden_def (__mtx_timedlock64) int ___mtx_timedlock (mtx_t *restrict mutex, diff --git a/sysdeps/unix/sysv/linux/nios2/libanl.abilist b/sysdeps/unix/sysv/linux/nios2/libanl.abilist index 6ff9c2d94e..6b080bd075 100644 --- a/sysdeps/unix/sysv/linux/nios2/libanl.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.21 gai_cancel F GLIBC_2.21 gai_error F GLIBC_2.21 gai_suspend F GLIBC_2.21 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index 9429209215..3b64e2cf51 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2367,16 +2367,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/nios2/librt.abilist b/sysdeps/unix/sysv/linux/nios2/librt.abilist index b4ae7a2dc2..2458614125 100644 --- a/sysdeps/unix/sysv/linux/nios2/librt.abilist +++ b/sysdeps/unix/sysv/linux/nios2/librt.abilist @@ -33,3 +33,8 @@ GLIBC_2.21 timer_delete F GLIBC_2.21 timer_getoverrun F GLIBC_2.21 timer_gettime F GLIBC_2.21 timer_settime F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F diff --git a/sysdeps/unix/sysv/linux/nios2/time64-compat.h b/sysdeps/unix/sysv/linux/nios2/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/nios2/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index eaca8e4b0c..5404fdea4a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2385,16 +2385,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index c754a181da..506fa3619f 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2418,16 +2418,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 963e27571d..99b6d6d1ce 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2383,16 +2383,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h b/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-32/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c index 1043b2b80d..bb2690d30f 100644 --- a/sysdeps/unix/sysv/linux/semctl.c +++ b/sysdeps/unix/sysv/linux/semctl.c @@ -21,7 +21,6 @@ #include #include #include -#include /* For __semid64_ds. */ #include /* For __kernel_mode_t. */ /* The struct used to issue the syscall. For architectures that assume diff --git a/sysdeps/unix/sysv/linux/sh/be/libanl.abilist b/sysdeps/unix/sysv/linux/sh/be/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libanl.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 456abfb5bb..68a631b161 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2238,16 +2238,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/sh/be/librt.abilist b/sysdeps/unix/sysv/linux/sh/be/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/sh/be/librt.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/sh/le/libanl.abilist b/sysdeps/unix/sysv/linux/sh/le/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libanl.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 45e59f1821..61a29e643a 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2235,16 +2235,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/sh/le/librt.abilist b/sysdeps/unix/sysv/linux/sh/le/librt.abilist index bb03781dcc..463a88a1df 100644 --- a/sysdeps/unix/sysv/linux/sh/le/librt.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/librt.abilist @@ -32,6 +32,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/sh/time64-compat.h b/sysdeps/unix/sysv/linux/sh/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sh/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist index d9a5ed015d..ff719e7605 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist @@ -2,3 +2,4 @@ GLIBC_2.2.3 gai_cancel F GLIBC_2.2.3 gai_error F GLIBC_2.2.3 gai_suspend F GLIBC_2.2.3 getaddrinfo_a F +GLIBC_2.34 __gai_suspend_time64 F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 734e1f38b6..fa3ae954c1 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2376,16 +2376,83 @@ GLIBC_2.33 mknod F GLIBC_2.33 mknodat F GLIBC_2.33 stat F GLIBC_2.33 stat64 F +GLIBC_2.34 ___adjtimex64 F +GLIBC_2.34 __adjtime64 F +GLIBC_2.34 __clock_adjtime64 F +GLIBC_2.34 __clock_getres64 F +GLIBC_2.34 __clock_gettime64 F +GLIBC_2.34 __clock_nanosleep_time64 F +GLIBC_2.34 __clock_settime64 F +GLIBC_2.34 __cnd_timedwait64 F +GLIBC_2.34 __ctime64 F +GLIBC_2.34 __ctime64_r F +GLIBC_2.34 __difftime64 F +GLIBC_2.34 __fstat64_time64 F +GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __futimens64 F +GLIBC_2.34 __futimes64 F +GLIBC_2.34 __futimesat64 F +GLIBC_2.34 __getitimer64 F +GLIBC_2.34 __getrusage64 F +GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __gmtime64 F +GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F +GLIBC_2.34 __localtime64 F +GLIBC_2.34 __localtime64_r F +GLIBC_2.34 __lstat64_time64 F +GLIBC_2.34 __lutimes64 F +GLIBC_2.34 __mktime64 F +GLIBC_2.34 __msgctl64 F +GLIBC_2.34 __mtx_timedlock64 F +GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __ntp_gettime64 F +GLIBC_2.34 __ntp_gettimex64 F +GLIBC_2.34 __ppoll64 F +GLIBC_2.34 __pselect64 F GLIBC_2.34 __pthread_cleanup_routine F +GLIBC_2.34 __pthread_clockjoin_np64 F +GLIBC_2.34 __pthread_cond_clockwait64 F +GLIBC_2.34 __pthread_cond_timedwait64 F GLIBC_2.34 __pthread_key_create F +GLIBC_2.34 __pthread_mutex_clocklock64 F GLIBC_2.34 __pthread_mutex_lock F +GLIBC_2.34 __pthread_mutex_timedlock64 F GLIBC_2.34 __pthread_mutex_unlock F GLIBC_2.34 __pthread_register_cancel F GLIBC_2.34 __pthread_register_cancel_defer F +GLIBC_2.34 __pthread_rwlock_clockrdlock64 F +GLIBC_2.34 __pthread_rwlock_clockwrlock64 F +GLIBC_2.34 __pthread_rwlock_timedrdlock64 F +GLIBC_2.34 __pthread_rwlock_timedwrlock64 F +GLIBC_2.34 __pthread_timedjoin_np64 F GLIBC_2.34 __pthread_unregister_cancel F GLIBC_2.34 __pthread_unregister_cancel_restore F GLIBC_2.34 __pthread_unwind_next F +GLIBC_2.34 __recvmmsg64 F +GLIBC_2.34 __sched_rr_get_interval64 F +GLIBC_2.34 __select64 F +GLIBC_2.34 __sem_clockwait64 F +GLIBC_2.34 __sem_timedwait64 F +GLIBC_2.34 __semctl64 F +GLIBC_2.34 __semtimedop64 F +GLIBC_2.34 __setitimer64 F +GLIBC_2.34 __settimeofday64 F +GLIBC_2.34 __shmctl64 F +GLIBC_2.34 __sigtimedwait64 F +GLIBC_2.34 __stat64_time64 F +GLIBC_2.34 __thrd_sleep64 F +GLIBC_2.34 __time64 F +GLIBC_2.34 __timegm64 F +GLIBC_2.34 __timerfd_gettime64 F +GLIBC_2.34 __timerfd_settime64 F +GLIBC_2.34 __timespec_get64 F +GLIBC_2.34 __timespec_getres64 F +GLIBC_2.34 __utime64 F +GLIBC_2.34 __utimensat64 F +GLIBC_2.34 __utimes64 F +GLIBC_2.34 __wait3_time64 F +GLIBC_2.34 __wait4_time64 F GLIBC_2.34 call_once F GLIBC_2.34 cnd_broadcast F GLIBC_2.34 cnd_destroy F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist index 38f0aad791..fb2769e87b 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist @@ -34,6 +34,11 @@ GLIBC_2.3.4 mq_setattr F GLIBC_2.3.4 mq_timedreceive F GLIBC_2.3.4 mq_timedsend F GLIBC_2.3.4 mq_unlink F +GLIBC_2.34 __aio_suspend_time64 F +GLIBC_2.34 __mq_timedreceive_time64 F +GLIBC_2.34 __mq_timedsend_time64 F +GLIBC_2.34 __timer_gettime64 F +GLIBC_2.34 __timer_settime64 F GLIBC_2.4 lio_listio F GLIBC_2.4 lio_listio64 F GLIBC_2.7 __mq_open_2 F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h b/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h new file mode 100644 index 0000000000..700f854597 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/time64-compat.h @@ -0,0 +1,2 @@ +/* ABI support 64-bit in non-default mode. */ +#define TIME64_NON_DEFAULT diff --git a/sysdeps/unix/sysv/linux/sys/timerfd.h b/sysdeps/unix/sysv/linux/sys/timerfd.h index 4ad64c2259..790b9d5be6 100644 --- a/sysdeps/unix/sysv/linux/sys/timerfd.h +++ b/sysdeps/unix/sysv/linux/sys/timerfd.h @@ -47,9 +47,31 @@ extern int timerfd_settime (int __ufd, int __flags, const struct itimerspec *__utmr, struct itimerspec *__otmr) __THROW; +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT_NTH) +extern int __REDIRECT_NTH (timerfd_settime, + (int __ufd, int __flags, + const struct itimerspec *__restrict __value, + struct itimerspec *__restrict __ovalue), + __timerfd_settime64); +# else +# define timerfd_settime __timerfd_settime64 +# endif +#endif + /* Return the next expiration time of UFD. */ extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW; +#ifdef __USE_TIME_BITS64 +# if defined(__REDIRECT_NTH) +extern int __REDIRECT_NTH (timerfd_gettime, (int __ufd, + struct itimerspec *__otmr), + __timerfd_gettime64); +# else +# define timerfd_gettime __timerfd_gettime64 +# endif +#endif + __END_DECLS #endif /* sys/timerfd.h */ diff --git a/sysdeps/unix/sysv/linux/sys/timex.h b/sysdeps/unix/sysv/linux/sys/timex.h index eb8d15a806..e17265c607 100644 --- a/sysdeps/unix/sysv/linux/sys/timex.h +++ b/sysdeps/unix/sysv/linux/sys/timex.h @@ -54,17 +54,34 @@ struct ntptimeval __BEGIN_DECLS -extern int __adjtimex (struct timex *__ntx) __THROW; +#ifndef __USE_TIME_BITS64 extern int adjtimex (struct timex *__ntx) __THROW; extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW; -#ifdef __REDIRECT_NTH +# ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), - ntp_gettimex); + ntp_gettimex); +# else +# define ntp_gettime ntp_gettimex +# endif +extern int ntp_adjtime (struct timex *__tntx) __THROW; #else -# define ntp_gettime ntp_gettimex +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (adjtimex, (struct timex *__ntx), + ___adjtimex64); +extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv), + __ntp_gettime64); +extern int __REDIRECT_NTH (ntp_gettimex, (struct ntptimeval *__ntv), + __ntp_gettimex64); +extern int __REDIRECT_NTH (ntp_adjtime, (struct timex *__ntx), + ___adjtimex64); +# else +# define adjtimex ___adjtimex64 +# define ntp_adjtime ___adjtimex64 +# define ntp_gettime __ntp_gettime64 +# define ntp_gettimex __ntp_gettimex64 +# endif #endif -extern int ntp_adjtime (struct timex *__tntx) __THROW; __END_DECLS diff --git a/sysvipc/sys/msg.h b/sysvipc/sys/msg.h index 9ddedf5e15..f31a43757d 100644 --- a/sysvipc/sys/msg.h +++ b/sysvipc/sys/msg.h @@ -58,7 +58,17 @@ struct msgbuf __BEGIN_DECLS /* Message queue control operation. */ +#ifndef __USE_TIME_BITS64 extern int msgctl (int __msqid, int __cmd, struct msqid_ds *__buf) __THROW; +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (msgctl, + (int __msqid, int __cmd, struct msqid_ds *__buf), + __msgctl64); +# else +# define msgctl __msgctl64 +# endif +#endif /* Get messages queue. */ extern int msgget (key_t __key, int __msgflg) __THROW; diff --git a/sysvipc/sys/sem.h b/sysvipc/sys/sem.h index 03b65dff21..4eb4c51bbe 100644 --- a/sysvipc/sys/sem.h +++ b/sysvipc/sys/sem.h @@ -48,7 +48,17 @@ struct sembuf __BEGIN_DECLS /* Semaphore control operation. */ +#ifndef __USE_TIME_BITS64 extern int semctl (int __semid, int __semnum, int __cmd, ...) __THROW; +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (semctl, + (int __semid, int __semnum, int __cmd, ...), + __semctl64); +# else +# define semctl __semctl64 +# endif +#endif /* Get semaphore. */ extern int semget (key_t __key, int __nsems, int __semflg) __THROW; @@ -58,8 +68,19 @@ extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW; #ifdef __USE_GNU /* Operate on semaphore with timeout. */ +# ifndef __USE_TIME_BITS64 extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops, const struct timespec *__timeout) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (semtimedop, (int __semid, struct sembuf *__sops, + size_t __nsops, + const struct timespec *__timeout), + __semtimedop64); +# else +# define semtimedop __semtimedop64 +# endif +# endif #endif __END_DECLS diff --git a/sysvipc/sys/shm.h b/sysvipc/sys/shm.h index 7506ba67bf..b09e0497e6 100644 --- a/sysvipc/sys/shm.h +++ b/sysvipc/sys/shm.h @@ -46,7 +46,17 @@ __BEGIN_DECLS facility. The definition is found in XPG4.2. */ /* Shared memory control operation. */ +#ifndef __USE_TIME_BITS64 extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW; +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (shmctl, + (int __shmid, int __cmd, struct shmid_ds *__buf), + __shmctl64); +# else +# define shmctl __shmctl64 +# endif +#endif /* Get shared memory segment. */ extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW; diff --git a/time/sys/time.h b/time/sys/time.h index 42f91f186b..d21411c0b4 100644 --- a/time/sys/time.h +++ b/time/sys/time.h @@ -63,10 +63,21 @@ struct timezone use localtime etc. instead. This function itself is semi-obsolete; most callers should use time or clock_gettime instead. */ +#ifndef __USE_TIME_BITS64 extern int gettimeofday (struct timeval *__restrict __tv, void *__restrict __tz) __THROW __nonnull ((1)); +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (gettimeofday, (struct timeval *__restrict __tv, + void *__restrict __tz), + __gettimeofday64) __nonnull ((1)); +# else +# define gettimeofday __gettimeofday64 +# endif +#endif #ifdef __USE_MISC +# ifndef __USE_TIME_BITS64 /* Set the current time of day and timezone information. This call is restricted to the super-user. Setting the timezone in this way is obsolete, but we don't yet @@ -82,6 +93,20 @@ extern int settimeofday (const struct timeval *__tv, This call is restricted to the super-user. */ extern int adjtime (const struct timeval *__delta, struct timeval *__olddelta) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (settimeofday, (const struct timeval *__tv, + const struct timezone *__tz), + __settimeofday64); + +extern int __REDIRECT_NTH (adjtime, (const struct timeval *__delta, + struct timeval *__olddelta), + __adjtime64); +# else +# define settimeofday __settimeofday64 +# define adjtime __adjtime64 +# endif +# endif #endif @@ -118,6 +143,7 @@ typedef enum __itimer_which __itimer_which_t; typedef int __itimer_which_t; #endif +#ifndef __USE_TIME_BITS64 /* Set *VALUE to the current setting of timer WHICH. Return 0 on success, -1 on errors. */ extern int getitimer (__itimer_which_t __which, @@ -136,21 +162,66 @@ extern int setitimer (__itimer_which_t __which, extern int utimes (const char *__file, const struct timeval __tvp[2]) __THROW __nonnull ((1)); +#else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (getitimer, (__itimer_which_t __which, + struct itimerval *__value), + __getitimer64); + +extern int __REDIRECT_NTH (setitimer, (__itimer_which_t __which, + const struct itimerval *__restrict __new, + struct itimerval *__restrict __old), + __setitimer64); + +extern int __REDIRECT_NTH (utimes, (const char *__file, + const struct timeval __tvp[2]), + __utimes64) __nonnull ((1)); +# else +# define getitimer __getitimer64 +# define setitimer __setitimer64 +# define utimes __utimes64 +# endif +#endif + #ifdef __USE_MISC +# ifndef __USE_TIME_BITS64 /* Same as `utimes', but does not follow symbolic links. */ extern int lutimes (const char *__file, const struct timeval __tvp[2]) __THROW __nonnull ((1)); /* Same as `utimes', but takes an open file descriptor instead of a name. */ extern int futimes (int __fd, const struct timeval __tvp[2]) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (lutimes, (const char *__file, + const struct timeval __tvp[2]), + __lutimes64) __nonnull ((1)); + +extern int __REDIRECT_NTH (futimes, (int __fd, const struct timeval __tvp[2]), + __futimes64); +# else +# define lutimes __lutimes64 +# define futimes __futimes64 +# endif +# endif #endif #ifdef __USE_GNU +# ifndef __USE_TIME_BITS64 /* Change the access time of FILE relative to FD to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ extern int futimesat (int __fd, const char *__file, const struct timeval __tvp[2]) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (futimesat, (int __fd, const char *__file, + const struct timeval __tvp[2]), + __futimesat64); +# else +# define futimesat __futimesat64 +# endif +# endif #endif diff --git a/time/time.h b/time/time.h index e255db9772..bde870c934 100644 --- a/time/time.h +++ b/time/time.h @@ -71,6 +71,7 @@ __BEGIN_DECLS The result / CLOCKS_PER_SEC is program time in seconds. */ extern clock_t clock (void) __THROW; +#ifndef __USE_TIME_BITS64 /* Return the current time and put it in *TIMER if TIMER is not NULL. */ extern time_t time (time_t *__timer) __THROW; @@ -80,7 +81,18 @@ extern double difftime (time_t __time1, time_t __time0) /* Return the `time_t' representation of TP and normalize TP. */ extern time_t mktime (struct tm *__tp) __THROW; - +#else +# ifdef __REDIRECT_NTH +extern time_t __REDIRECT_NTH (time, (time_t *__timer), __time64); +extern double __REDIRECT_NTH (difftime, (time_t __time1, time_t __time0), + __difftime64) __attribute__ ((__const__)); +extern time_t __REDIRECT_NTH (mktime, (struct tm *__tp), __mktime64); +# else +# define time __time64 +# define difftime __difftime64 +# define mktime __mktime64 +# endif +#endif /* Format TP into S according to FORMAT. Write no more than MAXSIZE characters and return the number @@ -114,6 +126,7 @@ extern char *strptime_l (const char *__restrict __s, #endif +#ifndef __USE_TIME_BITS64 /* Return the `struct tm' representation of *TIMER in Universal Coordinated Time (aka Greenwich Mean Time). */ extern struct tm *gmtime (const time_t *__timer) __THROW; @@ -122,7 +135,20 @@ extern struct tm *gmtime (const time_t *__timer) __THROW; of *TIMER in the local timezone. */ extern struct tm *localtime (const time_t *__timer) __THROW; +#else +# ifdef __REDIRECT_NTH +extern struct tm*__REDIRECT_NTH (gmtime, (const time_t *__timer), __gmtime64); +extern struct tm *__REDIRECT_NTH (localtime, (const time_t *__timer), + __localtime64); +# else +# define gmtime __gmtime64 +# define localtime __localtime64 +# endif +#endif + + #if defined __USE_POSIX || __GLIBC_USE (ISOC2X) +# ifndef __USE_TIME_BITS64 /* Return the `struct tm' representation of *TIMER in UTC, using *TP to store the result. */ extern struct tm *gmtime_r (const time_t *__restrict __timer, @@ -132,6 +158,20 @@ extern struct tm *gmtime_r (const time_t *__restrict __timer, using *TP to store the result. */ extern struct tm *localtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) __THROW; +# else +# ifdef __REDIRECT_NTH +extern struct tm*__REDIRECT_NTH (gmtime_r, (const time_t *__restrict __timer, + struct tm *__restrict __tp), + __gmtime64_r); + +extern struct tm*__REDIRECT_NTH (localtime_r, (const time_t *__restrict __t, + struct tm *__restrict __tp), + __localtime64_r); +# else +# define gmtime_r __gmtime64_r +# define localtime_r __localtime_r +# endif +# endif #endif /* POSIX || C2X */ /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" @@ -139,7 +179,15 @@ extern struct tm *localtime_r (const time_t *__restrict __timer, extern char *asctime (const struct tm *__tp) __THROW; /* Equivalent to `asctime (localtime (timer))'. */ +#ifndef __USE_TIME_BITS64 extern char *ctime (const time_t *__timer) __THROW; +#else +# ifdef __REDIRECT_NTH +extern char *__REDIRECT_NTH (ctime, (const time_t *__timer), __ctime64); +# else +# define ctime __ctime64 +# endif +#endif #ifdef __USE_POSIX /* Reentrant versions of the above functions. */ @@ -150,8 +198,18 @@ extern char *asctime_r (const struct tm *__restrict __tp, char *__restrict __buf) __THROW; /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ +#ifndef __USE_TIME_BITS64 extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __THROW; +#else +# ifdef __REDIRECT_NTH +extern char *__REDIRECT_NTH (ctime_r, (const time_t *__restrict __timer, + char *__restrict __buf), __ctime64_r); +# else +# define ctime_r __ctime64_r +# endif +#endif + #endif /* POSIX */ @@ -186,11 +244,19 @@ extern long int timezone; /* Miscellaneous functions many Unices inherited from the public domain localtime package. These are included only for compatibility. */ +#ifndef __USE_TIME_BITS64 /* Like `mktime', but for TP represents Universal Time, not local time. */ extern time_t timegm (struct tm *__tp) __THROW; - /* Another name for `mktime'. */ extern time_t timelocal (struct tm *__tp) __THROW; +#else +# ifdef __REDIRECT_NTH +extern time_t __REDIRECT_NTH (timegm, (struct tm *__tp), __timegm64); +extern time_t __REDIRECT_NTH (timelocal, (struct tm *__tp), __mktime64); +# else +# define timegm __timegm64 +# endif +#endif /* Return the number of days in YEAR. */ extern int dysize (int __year) __THROW __attribute__ ((__const__)); @@ -198,6 +264,7 @@ extern int dysize (int __year) __THROW __attribute__ ((__const__)); #ifdef __USE_POSIX199309 +# ifndef __USE_TIME_BITS64 /* Pause execution for a number of nanoseconds. This function is a cancellation point and therefore not marked with @@ -205,7 +272,6 @@ extern int dysize (int __year) __THROW __attribute__ ((__const__)); extern int nanosleep (const struct timespec *__requested_time, struct timespec *__remaining); - /* Get resolution of clock CLOCK_ID. */ extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW; @@ -215,15 +281,46 @@ extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW; /* Set clock CLOCK_ID to value TP. */ extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp) __THROW; +# else +# ifdef __REDIRECT +extern int __REDIRECT (nanosleep, (const struct timespec *__requested_time, + struct timespec *__remaining), + __nanosleep64); +extern int __REDIRECT_NTH (clock_getres, (clockid_t __clock_id, + struct timespec *__res), + __clock_getres64); +extern int __REDIRECT_NTH (clock_gettime, (clockid_t __clock_id, struct + timespec *__tp), __clock_gettime64); +extern int __REDIRECT_NTH (clock_settime, (clockid_t __clock_id, const struct + timespec *__tp), __clock_settime64); +# else +# define nanosleep __nanosleep64 +# define clock_getres __clock_getres64 +# define clock_gettime __clock_gettime64 +# define clock_settime __clock_settime64 +# endif +# endif + # ifdef __USE_XOPEN2K /* High-resolution sleep with the specified clock. This function is a cancellation point and therefore not marked with __THROW. */ +# ifndef __USE_TIME_BITS64 extern int clock_nanosleep (clockid_t __clock_id, int __flags, const struct timespec *__req, struct timespec *__rem); +# else +# ifdef __REDIRECT +extern int __REDIRECT (clock_nanosleep, (clockid_t __clock_id, int __flags, + const struct timespec *__req, + struct timespec *__rem), + __clock_nanosleep_time64); +# else +# define clock_nanosleep __clock_nanosleep_time64 +# endif +# endif /* Return clock ID for CPU-time clock. */ extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW; @@ -239,6 +336,7 @@ extern int timer_create (clockid_t __clock_id, extern int timer_delete (timer_t __timerid) __THROW; /* Set timer TIMERID to VALUE, returning old value in OVALUE. */ +# ifndef __USE_TIME_BITS64 extern int timer_settime (timer_t __timerid, int __flags, const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __THROW; @@ -246,6 +344,21 @@ extern int timer_settime (timer_t __timerid, int __flags, /* Get current value of timer TIMERID and store it in VALUE. */ extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (timer_settime, (timer_t __timerid, int __flags, + const struct itimerspec *__restrict __value, + struct itimerspec *__restrict __ovalue), + __timer_settime64); + +extern int __REDIRECT_NTH (timer_gettime, (timer_t __timerid, + struct itimerspec *__value), + __timer_gettime64); +# else +# define timer_settime __timer_settime64 +# define timer_gettime __timer_gettime64 +# endif +# endif /* Get expiration overrun for timer TIMERID. */ extern int timer_getoverrun (timer_t __timerid) __THROW; @@ -253,16 +366,35 @@ extern int timer_getoverrun (timer_t __timerid) __THROW; #ifdef __USE_ISOC11 +# ifndef __USE_TIME_BITS64 /* Set TS to calendar time based in time base BASE. */ extern int timespec_get (struct timespec *__ts, int __base) __THROW __nonnull ((1)); +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (timespec_get, (struct timespec *__ts, int __base), + __timespec_get64) __nonnull ((1)); +# else +# define timespec_get __timespec_get64 +# endif +# endif #endif #if __GLIBC_USE (ISOC2X) +# ifndef __USE_TIME_BITS64 /* Set TS to resolution of time base BASE. */ extern int timespec_getres (struct timespec *__ts, int __base) __THROW; +# else +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (timespec_getres, (struct timespec *__ts, + int __base), + __timespec_getres64); +# else +# define timespec_getres __timespec_getres64 +# endif +# endif #endif From patchwork Mon Jun 7 20:36:08 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: 43769 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 39F8D3938C31 for ; Mon, 7 Jun 2021 20:50:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39F8D3938C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623099032; bh=CPDIgIcMrxumdhzjQgVD4qmMg1+bIAKfuDMWlbi/u/o=; 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=u6vcjLmeFeXvK21GBKEylgH2pPeYAO4ffUI3zB7Ps/gQ+rigJVYFJGwI/CHpIMxz4 CZd3btiZLbGkfPVRSTnvZ7+AOK1MQSixYk8MsF4VSCDes8g/xswsVUBsGrCrkiq4XL scuJ+J3xSGjk8Oc3J8+j63bDqtuxEB6BmZc3Wj9Q= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by sourceware.org (Postfix) with ESMTPS id 778E83938396 for ; Mon, 7 Jun 2021 20:36:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 778E83938396 Received: by mail-qv1-xf2f.google.com with SMTP id u13so9613202qvt.7 for ; Mon, 07 Jun 2021 13:36:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CPDIgIcMrxumdhzjQgVD4qmMg1+bIAKfuDMWlbi/u/o=; b=IQRQlRNKFugTLqLBmsJBeDo9I3TPU2OeMEzs+SyEaNligtJlts0zmGyhdf2ZeYS5Kz YeXFlw45Mc7w3Z+/fOb3o153Kmbtq7benGWH+4fE+suiH9KzztL3G8kfFg9MyUhpCtNw Am18UeJ56ScSEhvuDHBB8zn+9d210MoMEKS8RuSUxeyPSjcUrcGXreU7IohqUerQI1u1 bjozJuzV2nbaI9v8Hgj1mpYOKTM6Yhzjy/OkzqJwxPf6NL/K+VYgXy0w+GuwikZ4dFdy kxIDyX79eTtdq2WgfcDzXjFw4PGX3oEDWpzB5TNt2YS14QUgWSYEDS7NBoVQkI/6iBqr KuJQ== X-Gm-Message-State: AOAM531Cf9iaK0lIforo9slcPAe3GbsvSnAIzaBmWWNSr8j80ukXxfKr /O7DT4uCdWzxzn9FBCsF08XFFvTzlZ/2gA== X-Google-Smtp-Source: ABdhPJwz/DQUVSXwB4EmfJsCSmsIHBwKWwVgi3OnOy2261bnKBnb4J+oJZVbUdIso2XZCuOzHa/FEw== X-Received: by 2002:a05:6214:240b:: with SMTP id fv11mr7754083qvb.23.1623098210690; Mon, 07 Jun 2021 13:36:50 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:50 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 19/24] posix: Add glob64 with 64-bit time_t support Date: Mon, 7 Jun 2021 17:36:08 -0300 Message-Id: <20210607203613.282543-20-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The glob might pass a different stat struct for gl_stat and gl_lstat when GLOB_ALTDIRFUNC is used. This requires add a new 64-bit time version that also uses 64-bit time stat functions. Checked on i686-linux-gnu and x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: carlos O'Donell --- include/glob.h | 28 +++++++++++ posix/Makefile | 4 +- posix/glob.c | 46 +++++++++-------- posix/glob.h | 22 +++++++++ posix/glob64-lstat-compat.c | 3 +- posix/glob64-time64.c | 49 +++++++++++++++++++ posix/globfree64-time64.c | 30 ++++++++++++ sysdeps/gnu/glob64-lstat-compat.c | 3 +- sysdeps/unix/sysv/linux/Versions | 2 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 2 + sysdeps/unix/sysv/linux/csky/libc.abilist | 2 + sysdeps/unix/sysv/linux/glob-lstat-compat.c | 6 ++- sysdeps/unix/sysv/linux/glob.c | 6 +++ sysdeps/unix/sysv/linux/glob64-lstat-compat.c | 12 ++--- sysdeps/unix/sysv/linux/glob64-time64.c | 44 +++++++++++++++++ sysdeps/unix/sysv/linux/glob64.c | 8 +-- sysdeps/unix/sysv/linux/globfree64-time64.c | 35 +++++++++++++ sysdeps/unix/sysv/linux/hppa/libc.abilist | 2 + sysdeps/unix/sysv/linux/i386/libc.abilist | 2 + .../sysv/linux/m68k/coldfire/libc.abilist | 2 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 2 + .../sysv/linux/microblaze/be/libc.abilist | 2 + .../sysv/linux/microblaze/le/libc.abilist | 2 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 2 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 2 + .../sysv/linux/mips/mips64/n32/libc.abilist | 2 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 2 + sysdeps/unix/sysv/linux/oldglob.c | 11 ++--- .../linux/powerpc/powerpc32/fpu/libc.abilist | 2 + .../powerpc/powerpc32/nofpu/libc.abilist | 2 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 2 + .../sysv/linux/sparc/sparc32/libc.abilist | 2 + 35 files changed, 307 insertions(+), 40 deletions(-) create mode 100644 posix/glob64-time64.c create mode 100644 posix/globfree64-time64.c create mode 100644 sysdeps/unix/sysv/linux/glob64-time64.c create mode 100644 sysdeps/unix/sysv/linux/globfree64-time64.c diff --git a/include/glob.h b/include/glob.h index 1d2f78793e..f48c71960d 100644 --- a/include/glob.h +++ b/include/glob.h @@ -2,11 +2,39 @@ #include #ifndef _ISOMAC +# include + libc_hidden_proto (glob) libc_hidden_proto (glob64) libc_hidden_proto (globfree) libc_hidden_proto (globfree64) +# if __TIMESIZE == 64 +# define glob64_time64_t glob64_t +# else +# include + +typedef struct + { + size_t gl_pathc; + char **gl_pathv; + size_t gl_offs; + int gl_flags; + + void (*gl_closedir) (void *); + struct dirent64 *(*gl_readdir) (void *); + void *(*gl_opendir) (const char *); + int (*gl_lstat) (const char *__restrict, struct __stat64_t64 *__restrict); + int (*gl_stat) (const char *__restrict, struct __stat64_t64 *__restrict); + } glob64_time64_t; + +extern int __glob64_time64 (const char *pattern, int flags, + int (*errfunc) (const char *, int), + glob64_time64_t *pglob); +void __globfree64_time64 (glob64_time64_t *pglob); +libc_hidden_proto (__globfree64_time64) +# endif + /* Now define the internal interfaces. */ extern int __glob_pattern_p (const char *__pattern, int __quote); extern int __glob64 (const char *__pattern, int __flags, diff --git a/posix/Makefile b/posix/Makefile index fa0dc0ea20..c8c538fcee 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -67,7 +67,9 @@ routines := \ get_child_max sched_cpucount sched_cpualloc sched_cpufree \ streams-compat \ shm-directory \ - execveat + execveat \ + glob64-time64 \ + globfree64-time64 aux := init-posix environ tests := test-errno tstgetopt testfnm runtests runptests \ diff --git a/posix/glob.c b/posix/glob.c index 32c88e5d15..593a4c358f 100644 --- a/posix/glob.c +++ b/posix/glob.c @@ -59,25 +59,37 @@ # define readdir(str) __readdir64 (str) # define getpwnam_r(name, bufp, buf, len, res) \ __getpwnam_r (name, bufp, buf, len, res) -# define struct_stat64 struct stat64 # define FLEXIBLE_ARRAY_MEMBER +# ifndef struct_stat +# define struct_stat struct stat +# endif +# ifndef struct_stat64 +# define struct_stat64 struct stat64 +# endif +# ifndef GLOB_LSTAT +# define GLOB_LSTAT gl_lstat +# endif +# ifndef GLOB_STAT64 +# define GLOB_STAT64 __stat64 +# endif +# ifndef GLOB_LSTAT64 +# define GLOB_LSTAT64 __lstat64 +# endif # include #else /* !_LIBC */ # define __glob glob # define __getlogin_r(buf, len) getlogin_r (buf, len) -# define __lstat64(fname, buf) lstat (fname, buf) -# if defined _WIN32 && !defined __CYGWIN__ - /* Avoid GCC or clang warning. The original __stat64 macro is unused. */ -# undef __stat64 -# endif -# define __stat64(fname, buf) stat (fname, buf) # define __fxstatat64(_, d, f, st, flag) fstatat (d, f, st, flag) -# define struct_stat64 struct stat # ifndef __MVS__ # define __alloca alloca # endif # define __readdir readdir # define COMPILE_GLOB64 +# define struct_stat struct stat +# define struct_stat64 struct stat +# define GLOB_LSTAT gl_lstat +# define GLOB_STAT64 stat +# define GLOB_LSTAT64 lstat #endif /* _LIBC */ #include @@ -196,22 +208,14 @@ glob_lstat (glob_t *pglob, int flags, const char *fullname) { /* Use on glob-lstat-compat.c to provide a compat symbol which does not use lstat / gl_lstat. */ -#ifdef GLOB_NO_LSTAT -# define GL_LSTAT gl_stat -# define LSTAT64 __stat64 -#else -# define GL_LSTAT gl_lstat -# define LSTAT64 __lstat64 -#endif - union { - struct stat st; + struct_stat st; struct_stat64 st64; } ust; return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC) - ? pglob->GL_LSTAT (fullname, &ust.st) - : LSTAT64 (fullname, &ust.st64)); + ? pglob->GLOB_LSTAT (fullname, &ust.st) + : GLOB_LSTAT64 (fullname, &ust.st64)); } /* Set *R = A + B. Return true if the answer is mathematically @@ -249,11 +253,11 @@ static int collated_compare (const void *, const void *) __THROWNL; static bool is_dir (char const *filename, int flags, glob_t const *pglob) { - struct stat st; + struct_stat st; struct_stat64 st64; return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC) ? pglob->gl_stat (filename, &st) == 0 && S_ISDIR (st.st_mode) - : __stat64 (filename, &st64) == 0 && S_ISDIR (st64.st_mode)); + : GLOB_STAT64 (filename, &st64) == 0 && S_ISDIR (st64.st_mode)); } /* Find the end of the sub-pattern in a brace expression. */ diff --git a/posix/glob.h b/posix/glob.h index b5686600c7..700aeb2392 100644 --- a/posix/glob.h +++ b/posix/glob.h @@ -150,20 +150,42 @@ extern int glob (const char *__restrict __pattern, int __flags, /* Free storage allocated in PGLOB by a previous `glob' call. */ extern void globfree (glob_t *__pglob) __THROW; #else +# ifdef __USE_TIME_BITS64 +extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern, + int __flags, + int (*__errfunc) (const char *, int), + glob_t *__restrict __pglob), + __glob64_time64); + +extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), + __globfree64_time64); +# else extern int __REDIRECT_NTHNL (glob, (const char *__restrict __pattern, int __flags, int (*__errfunc) (const char *, int), glob_t *__restrict __pglob), glob64); extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64); +# endif #endif #ifdef __USE_LARGEFILE64 +# ifdef __USE_TIME_BITS64 +extern int __REDIRECT_NTHNL (glob64, (const char *__restrict __pattern, + int __flags, + int (*__errfunc) (const char *, int), + glob64_t *__restrict __pglob), + __glob64_time64); + +extern void __REDIRECT_NTH (globfree64, (glob64_t *__pglob), + __globfree64_time64); +# else extern int glob64 (const char *__restrict __pattern, int __flags, int (*__errfunc) (const char *, int), glob64_t *__restrict __pglob) __THROWNL; extern void globfree64 (glob64_t *__pglob) __THROW; +# endif #endif diff --git a/posix/glob64-lstat-compat.c b/posix/glob64-lstat-compat.c index bd81a1e390..e90d4ae93e 100644 --- a/posix/glob64-lstat-compat.c +++ b/posix/glob64-lstat-compat.c @@ -28,7 +28,8 @@ # define GLOB_ATTRIBUTE attribute_compat_text_section /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ -# define GLOB_NO_LSTAT +# define GLOB_LSTAT gl_stat +# define GLOB_LSTAT64 __stat64 # include diff --git a/posix/glob64-time64.c b/posix/glob64-time64.c new file mode 100644 index 0000000000..b0f8facd84 --- /dev/null +++ b/posix/glob64-time64.c @@ -0,0 +1,49 @@ +/* Long File Support glob with 64-bit time support. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + +#if __TIMESIZE != 64 + +/* Do glob searching for PATTERN, placing results in PGLOB. + The bits defined above may be set in FLAGS. + If a directory cannot be opened or read and ERRFUNC is not nil, + it is called with the pathname that caused the error, and the + `errno' value from the failing call; if it returns non-zero + `glob' returns GLOB_ABORTED; if it returns zero, the error is ignored. + If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned. + Otherwise, `glob' returns zero. */ +int +__glob64_time64 (const char *pattern, int flags, + int (*errfunc) (const char *, int), glob64_time64_t *pglob) +{ + if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0) + { + __set_errno (EINVAL); + return -1; + } + + __set_errno (ENOSYS); + return GLOB_NOSYS; +} + +stub_warning (glob64) + +#endif diff --git a/posix/globfree64-time64.c b/posix/globfree64-time64.c new file mode 100644 index 0000000000..1fc2085f3f --- /dev/null +++ b/posix/globfree64-time64.c @@ -0,0 +1,30 @@ +/* Long File Support globfree with 64-bit time support. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#if __TIMESIZE != 64 + +/* Free storage allocated in PGLOB by a previous `glob' call. */ +void +__globfree64_time64 (glob64_time64_t *pglob) +{ +} +libc_hidden_def (__globfree64_time64) + +#endif diff --git a/sysdeps/gnu/glob64-lstat-compat.c b/sysdeps/gnu/glob64-lstat-compat.c index 6764f1d062..ade4ccac8a 100644 --- a/sysdeps/gnu/glob64-lstat-compat.c +++ b/sysdeps/gnu/glob64-lstat-compat.c @@ -39,7 +39,8 @@ #define GLOB_ATTRIBUTE attribute_compat_text_section /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ -#define GLOB_NO_LSTAT +#define GLOB_LSTAT gl_stat +#define GLOB_LSTAT64 __stat64 #include diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 0aa2ef8559..f045604ad6 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -209,6 +209,8 @@ libc { __getitimer64; __getrusage64; __gettimeofday64; + __glob64_time64; + __globfree64_time64; __gmtime64; __gmtime64_r; __localtime64; diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 1d32514579..8e3101b1c2 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -209,6 +209,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 05d0878232..b29a0e324e 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -206,6 +206,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index ac9f009f38..5f5427cb46 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2296,6 +2296,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/glob-lstat-compat.c b/sysdeps/unix/sysv/linux/glob-lstat-compat.c index 1f502e3299..7729e0dc12 100644 --- a/sysdeps/unix/sysv/linux/glob-lstat-compat.c +++ b/sysdeps/unix/sysv/linux/glob-lstat-compat.c @@ -30,7 +30,11 @@ #define GLOB_ATTRIBUTE attribute_compat_text_section /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ -#define GLOB_NO_LSTAT +#define struct_stat struct stat +#define struct_stat64 struct stat64 +#define GLOB_LSTAT gl_stat +#define GLOB_STAT64 __stat64 +#define GLOB_LSTAT64 __stat64 #include diff --git a/sysdeps/unix/sysv/linux/glob.c b/sysdeps/unix/sysv/linux/glob.c index 1be4885b96..89c287d01d 100644 --- a/sysdeps/unix/sysv/linux/glob.c +++ b/sysdeps/unix/sysv/linux/glob.c @@ -19,6 +19,12 @@ #include #include +#define struct_stat struct stat +#define struct_stat64 struct stat64 +#define GLOB_LSTAT gl_lstat +#define GLOB_STAT64 __stat64 +#define GLOB_LSTAT64 __lstat64 + #define glob64 __no_glob64_decl #define __glob64 __no___glob64_decl #include diff --git a/sysdeps/unix/sysv/linux/glob64-lstat-compat.c b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c index 40ad625f58..302a44d3a4 100644 --- a/sysdeps/unix/sysv/linux/glob64-lstat-compat.c +++ b/sysdeps/unix/sysv/linux/glob64-lstat-compat.c @@ -33,15 +33,15 @@ # define __glob __glob64_lstat_compat # define globfree globfree64 -# undef stat -# define stat stat64 - -# define COMPILE_GLOB64 1 - # define GLOB_ATTRIBUTE attribute_compat_text_section /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ -# define GLOB_NO_LSTAT +# define COMPILE_GLOB64 1 +# define struct_stat struct stat64 +# define struct_stat64 struct stat64 +# define GLOB_LSTAT gl_stat +# define GLOB_STAT64 __stat64 +# define GLOB_LSTAT64 __stat64 # include diff --git a/sysdeps/unix/sysv/linux/glob64-time64.c b/sysdeps/unix/sysv/linux/glob64-time64.c new file mode 100644 index 0000000000..260f067fa4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/glob64-time64.c @@ -0,0 +1,44 @@ +/* Find pathnames matching a pattern. Linux version. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#if __TIMESIZE != 64 +# include +# include +# include + +# define dirent dirent64 +# define __readdir(dirp) __readdir64 (dirp) + +# define glob_t glob64_time64_t +# define __glob __glob64_time64 + +# define globfree(pglob) __globfree64_time64 (pglob) + +# define COMPILE_GLOB64 1 +# define struct_stat struct __stat64_t64 +# define struct_stat64 struct __stat64_t64 +# define GLOB_LSTAT gl_lstat +# define GLOB_STAT64 __stat64_time64 +# define GLOB_LSTAT64 __lstat64_time64 + +# define COMPILE_GLOB64 1 + +# include +#endif diff --git a/sysdeps/unix/sysv/linux/glob64.c b/sysdeps/unix/sysv/linux/glob64.c index 3cbadf34fb..572ca215df 100644 --- a/sysdeps/unix/sysv/linux/glob64.c +++ b/sysdeps/unix/sysv/linux/glob64.c @@ -31,10 +31,12 @@ # define __glob __glob64 # define globfree(pglob) globfree64 (pglob) -# undef stat -# define stat stat64 - # define COMPILE_GLOB64 1 +# define struct_stat struct stat64 +# define struct_stat64 struct stat64 +# define GLOB_LSTAT gl_lstat +# define GLOB_STAT64 __stat64 +# define GLOB_LSTAT64 __lstat64 # include diff --git a/sysdeps/unix/sysv/linux/globfree64-time64.c b/sysdeps/unix/sysv/linux/globfree64-time64.c new file mode 100644 index 0000000000..d6b1e6ac49 --- /dev/null +++ b/sysdeps/unix/sysv/linux/globfree64-time64.c @@ -0,0 +1,35 @@ +/* Frees the dynamically allocated storage from an earlier call to glob. + Linux version. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#if __TIMESIZE != 64 +# include +# include +# include + +# define glob_t glob64_time64_t +# define globfree(pglob) __globfree64_time64 (pglob) + +# undef stat +# define stat __stat64_t64 + +# include +libc_hidden_def (__globfree64_time64) +#endif diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index d2770a4874..ca8f7c3dbb 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2250,6 +2250,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index eb20d66c28..d2b7b4d4b6 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2433,6 +2433,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __isnanf128 F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 044cec51fc..515e383d50 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -210,6 +210,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 3a6463a3ef..6915fa115f 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2377,6 +2377,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 612d7f1c58..9293872f80 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2347,6 +2347,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index 685cb974c3..cb671c56be 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2344,6 +2344,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index d17b5a02a5..f5effe36e1 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2342,6 +2342,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index aba6bd2e3c..2b66d26931 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2340,6 +2340,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 88d8e2af38..bd76490d97 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2348,6 +2348,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index 3b64e2cf51..e62a2a5729 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2386,6 +2386,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/oldglob.c b/sysdeps/unix/sysv/linux/oldglob.c index 59bf89dc1d..a9a4439ddb 100644 --- a/sysdeps/unix/sysv/linux/oldglob.c +++ b/sysdeps/unix/sysv/linux/oldglob.c @@ -28,13 +28,12 @@ libc_hidden_proto (__old_glob64); #define convert_dirent __old_convert_dirent #define glob_in_dir __old_glob_in_dir -#undef stat -#define stat stat64 -#undef __stat -#define __stat(file, buf) __stat64 (file, buf) - /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ -#define GLOB_NO_LSTAT +#define struct_stat struct stat64 +#define struct_stat64 struct stat64 +#define GLOB_LSTAT gl_stat +#define GLOB_STAT64 __stat64 +#define GLOB_LSTAT64 __stat64 #define GLOB_ATTRIBUTE attribute_compat_text_section diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 5404fdea4a..bc5b23c818 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2404,6 +2404,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 506fa3619f..f9421c7777 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2437,6 +2437,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 99b6d6d1ce..7581354bf4 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2402,6 +2402,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 68a631b161..0e45f7fb0a 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2257,6 +2257,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 61a29e643a..ece6721841 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2254,6 +2254,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index fa3ae954c1..6073443a3d 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2395,6 +2395,8 @@ GLIBC_2.34 __futimesat64 F GLIBC_2.34 __getitimer64 F GLIBC_2.34 __getrusage64 F GLIBC_2.34 __gettimeofday64 F +GLIBC_2.34 __glob64_time64 F +GLIBC_2.34 __globfree64_time64 F GLIBC_2.34 __gmtime64 F GLIBC_2.34 __gmtime64_r F GLIBC_2.34 __libc_start_main F From patchwork Mon Jun 7 20:36:09 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: 43770 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 356603939C08 for ; Mon, 7 Jun 2021 20:51:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 356603939C08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623099082; bh=koBHfo3eBOkbQE8xJULj0vF9sK25mr4GvMZAFPWYqpA=; 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=qkZe6XJCLMnk9NM2+BObOwxX1pWfvIMrVWhJSQw17DfatGsFyKZFD5EN5yvVsopa+ xwIeS48YSvbJdFGLtM7pLmmF2PxVJOtJTl/rMkvzkPS8tsCNdIvEPuEBh1/Owin/H9 lfaGC0D88bi2Nr3qGTkKF96L2S++eS7q8jThShew= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by sourceware.org (Postfix) with ESMTPS id 03A8B389853F for ; Mon, 7 Jun 2021 20:36:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 03A8B389853F Received: by mail-qk1-x72d.google.com with SMTP id c124so18076401qkd.8 for ; Mon, 07 Jun 2021 13:36:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=koBHfo3eBOkbQE8xJULj0vF9sK25mr4GvMZAFPWYqpA=; b=AbMmrdNTyPSFSu2WKbksKevdzrgY9aQAgwwhihRIpiqE64DqxIlkjNGmIJ0WM0PI52 NoYiO3J1W3LG8tKTLkyAOQzs2eRxhlpATxxzRwBW+AZV1NmhsqgY33Jw0VVbo/505xGa +HxCRQW59RRrxq8OA80S/pS+vDkchZx533kkIKaapvJsRKI5qq85K+NaUxkSxP1B+v/s nWrz1lMQyDYMFchkMEnx2vENBCsH1ka+EY4BUzVwkJXQ99iHDzj9ahnH43W0nYDLNSPw XTS6bRU8IBWBPFObykIPK3fruIPw11SLnY9PxiLH9BcnESycH9vS0J14Ha0Lr2rzjFQP pdhA== X-Gm-Message-State: AOAM531umPvuGYW74AmU0JJNZPm1ESI8Qbt+3qLe9wB7GKf1exrErPG3 C/0vTy9QBg2X0ChtDe4Hq/SIMT94pjy7dQ== X-Google-Smtp-Source: ABdhPJzmp011NZm/8u+yESw66oevHKHoeTiZ/gVbia+eaU2hHyd0dHd8esdxEzi8XqSCTNZYgNGUuA== X-Received: by 2002:ae9:e84f:: with SMTP id a76mr9781192qkg.366.1623098212298; Mon, 07 Jun 2021 13:36:52 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:52 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 20/24] io: Add fts64 with 64-bit time_t support Date: Mon, 7 Jun 2021 17:36:09 -0300 Message-Id: <20210607203613.282543-21-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Similar to glob, fts routines passes a stat pointer that might differ of size and layout when 64-bit time API is used. Checked on i686-linux-gnu and x86_64-linux-gnu. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- include/fts.h | 51 +++++++++++++++++++ io/Makefile | 4 +- io/fts.h | 43 ++++++++++++++-- io/fts64-time64.c | 35 +++++++++++++ sysdeps/unix/sysv/linux/Versions | 5 ++ sysdeps/unix/sysv/linux/arm/be/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/arm/le/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/csky/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/hppa/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/i386/libc.abilist | 5 ++ .../sysv/linux/m68k/coldfire/libc.abilist | 5 ++ .../unix/sysv/linux/m68k/m680x0/libc.abilist | 5 ++ .../sysv/linux/microblaze/be/libc.abilist | 5 ++ .../sysv/linux/microblaze/le/libc.abilist | 5 ++ .../sysv/linux/mips/mips32/fpu/libc.abilist | 5 ++ .../sysv/linux/mips/mips32/nofpu/libc.abilist | 5 ++ .../sysv/linux/mips/mips64/n32/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/nios2/libc.abilist | 5 ++ .../linux/powerpc/powerpc32/fpu/libc.abilist | 5 ++ .../powerpc/powerpc32/nofpu/libc.abilist | 5 ++ .../unix/sysv/linux/s390/s390-32/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/sh/be/libc.abilist | 5 ++ sysdeps/unix/sysv/linux/sh/le/libc.abilist | 5 ++ .../sysv/linux/sparc/sparc32/libc.abilist | 5 ++ 24 files changed, 227 insertions(+), 6 deletions(-) create mode 100644 io/fts64-time64.c diff --git a/include/fts.h b/include/fts.h index 145dce6779..ea36a9b9be 100644 --- a/include/fts.h +++ b/include/fts.h @@ -1 +1,52 @@ +#ifndef _FTS_H #include + +#ifndef _ISOMAC +# if __TIMESIZE != 64 +# include + +typedef struct +{ + struct _ftsent64_time64 *fts_cur; + struct _ftsent64_time64 *fts_child; + struct _ftsent64_time64 **fts_array; + dev_t fts_dev; + char *fts_path; + int fts_rfd; + int fts_pathlen; + int fts_nitems; + int (*fts_compar) (const void *, const void *); + int fts_options; +} FTS64_TIME64; + +typedef struct _ftsent64_time64 +{ + struct _ftsent64_time64 *fts_cycle; + struct _ftsent64_time64 *fts_parent; + struct _ftsent64_time64 *fts_link; + long fts_number; + void *fts_pointer; + char *fts_accpath; + char *fts_path; + int fts_errno; + int fts_symfd; + unsigned short fts_pathlen; + unsigned short fts_namelen; + + ino64_t fts_ino; + dev_t fts_dev; + nlink_t fts_nlink; + + short fts_level; + unsigned short fts_info; + unsigned short fts_flags; + unsigned short fts_instr; + + struct __stat64_t64 *fts_statp; + char fts_name[1]; +} FSTENT64_TIME64; + +# endif +#endif + +#endif /* _FTS_H */ diff --git a/io/Makefile b/io/Makefile index a22492f3f3..12c832cfcb 100644 --- a/io/Makefile +++ b/io/Makefile @@ -54,7 +54,8 @@ routines := \ posix_fadvise posix_fadvise64 \ posix_fallocate posix_fallocate64 \ sendfile sendfile64 copy_file_range \ - utimensat futimens file_change_detection + utimensat futimens file_change_detection \ + fts64-time64 others := pwd test-srcs := ftwtest @@ -102,6 +103,7 @@ CFLAGS-statvfs.c += -fexceptions CFLAGS-fstatvfs.c += -fexceptions CFLAGS-fts.c += -Wno-uninitialized $(uses-callbacks) -fexceptions CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions +CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions CFLAGS-ftw.c += $(uses-callbacks) -fexceptions CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions CFLAGS-posix_fallocate.c += -fexceptions diff --git a/io/fts.h b/io/fts.h index 867677a27e..8d3395fa31 100644 --- a/io/fts.h +++ b/io/fts.h @@ -187,6 +187,7 @@ FTSENT *fts_read (FTS *); int fts_set (FTS *, FTSENT *, int) __THROW; #else # ifdef __REDIRECT +# ifndef __USE_TIME_BITS64 FTSENT *__REDIRECT (fts_children, (FTS *, int), fts64_children); int __REDIRECT (fts_close, (FTS *), fts64_close); FTS *__REDIRECT (fts_open, (char * const *, int, @@ -194,21 +195,53 @@ FTS *__REDIRECT (fts_open, (char * const *, int, fts64_open); FTSENT *__REDIRECT (fts_read, (FTS *), fts64_read); int __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), fts64_set); +# else +FTSENT *__REDIRECT (fts_children, (FTS *, int), __fts64_children_time64); +int __REDIRECT (fts_close, (FTS *), __fts64_close_time64); +FTS *__REDIRECT (fts_open, (char * const *, int, + int (*)(const FTSENT **, const FTSENT **)), + __fts64_open_time64); +FTSENT *__REDIRECT (fts_read, (FTS *), __fts64_read_time64); +int __REDIRECT_NTH (fts_set, (FTS *, FTSENT *, int), + __fts64_set_time64); +# endif # else -# define fts_children fts64_children -# define fts_close fts64_close -# define fts_open fts64_open -# define fts_read fts64_read -# define fts_set fts64_set +# ifndef __USE_TIME_BITS64 +# define fts_children fts64_children +# define fts_close fts64_close +# define fts_open fts64_open +# define fts_read fts64_read +# define fts_set fts64_set +# else +# endif # endif #endif #ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 FTSENT64 *fts64_children (FTS64 *, int); int fts64_close (FTS64 *); FTS64 *fts64_open (char * const *, int, int (*)(const FTSENT64 **, const FTSENT64 **)); FTSENT64 *fts64_read (FTS64 *); int fts64_set (FTS64 *, FTSENT64 *, int) __THROW; +# else +# ifdef __REDIRECT +FTSENT *__REDIRECT (fts64_children, (FTS64 *, int), __fts64_children_time64); +int __REDIRECT (fts64_close, (FTS64 *), __fts64_close_time64); +FTS *__REDIRECT (fts64_open, (char * const *, int, + int (*)(const FTSENT64 **, const FTSENT64 **)), + __fts64_open_time64); +FTSENT *__REDIRECT (fts64_read, (FTS64 *), __fts64_read_time64); +int __REDIRECT_NTH (fts64_set, (FTS64 *, FTSENT64 *, int), + __fts64_set_time64); +# else +# define fts_children __fts64_children_time64 +# define fts_close __fts64_close_time64 +# define fts_open __fts64_open_time64 +# define fts_read __fts64_read_time64 +# define fts_set __fts64_set_time64 +# endif +# endif #endif __END_DECLS diff --git a/io/fts64-time64.c b/io/fts64-time64.c new file mode 100644 index 0000000000..c8885ca79b --- /dev/null +++ b/io/fts64-time64.c @@ -0,0 +1,35 @@ +/* File tree traversal functions LFS version. + Copyright (C) 2015-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#if __TIMESIZE != 64 +# define FTS_OPEN __fts64_open_time64 +# define FTS_CLOSE __fts64_close_time64 +# define FTS_READ __fts64_read_time64 +# define FTS_SET __fts64_set_time64 +# define FTS_CHILDREN __fts64_children_time64 +# define FTSOBJ FTS64_TIME64 +# define FTSENTRY FSTENT64_TIME64 +# define INO_T ino64_t +# define STRUCT_STAT __stat64_t64 +# define STAT __stat64_time64 +# define LSTAT __lstat64_time64 + +# include "fts.c" +#endif diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index f045604ad6..b4513f64da 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -206,6 +206,11 @@ libc { __futimens64; __futimes64; __futimesat64; + __fts64_open_time64; + __fts64_close_time64; + __fts64_read_time64; + __fts64_set_time64; + __fts64_children_time64; __getitimer64; __getrusage64; __gettimeofday64; diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 8e3101b1c2..49fa140d7a 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -203,6 +203,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index b29a0e324e..60e3da1b8a 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -200,6 +200,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index 5f5427cb46..a694b01087 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2290,6 +2290,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index ca8f7c3dbb..d40edc659c 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2244,6 +2244,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index d2b7b4d4b6..cd975e36a7 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2427,6 +2427,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 515e383d50..77c15fda91 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -204,6 +204,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 6915fa115f..0e1ab1544e 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2371,6 +2371,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 9293872f80..26641a9573 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2341,6 +2341,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index cb671c56be..dc50753be0 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2338,6 +2338,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index f5effe36e1..3d89c7457b 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2336,6 +2336,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 2b66d26931..6bfac13584 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2334,6 +2334,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index bd76490d97..09c884ac9b 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2342,6 +2342,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index e62a2a5729..fd64cce1da 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2380,6 +2380,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index bc5b23c818..306a572a38 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2398,6 +2398,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index f9421c7777..86d4a96c20 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2431,6 +2431,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 7581354bf4..8f0716c6f6 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2396,6 +2396,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 0e45f7fb0a..9c0b91f70b 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2251,6 +2251,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index ece6721841..280984fcc8 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2248,6 +2248,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 6073443a3d..d46f749d1a 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2389,6 +2389,11 @@ GLIBC_2.34 __ctime64_r F GLIBC_2.34 __difftime64 F GLIBC_2.34 __fstat64_time64 F GLIBC_2.34 __fstatat64_time64 F +GLIBC_2.34 __fts64_children_time64 F +GLIBC_2.34 __fts64_close_time64 F +GLIBC_2.34 __fts64_open_time64 F +GLIBC_2.34 __fts64_read_time64 F +GLIBC_2.34 __fts64_set_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F From patchwork Mon Jun 7 20:36:10 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: 43771 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 6366D3938C0F for ; Mon, 7 Jun 2021 20:52:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6366D3938C0F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623099126; bh=c8koUzr8PThL/JkUhS3RoQiBm3KYOOqXqBWXrYZRsSw=; 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=Ji418Xk+zTsusTnOyvnUZbfpHALvgfy3lZ+0dqCFkk5gFNx/LDaWrx2EVrkRh/Do6 hQagH7m8fZc+2553D4nFBMJORtHQWMsRgxRj/m8JPHu/RmJU2zXW4DOlMYDn9evELQ BMiWWrbsK7EE6Koqe+9WArXdgZKlw5QD3NBq8wXc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by sourceware.org (Postfix) with ESMTPS id AD27D3938C20 for ; Mon, 7 Jun 2021 20:36:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AD27D3938C20 Received: by mail-qk1-x72d.google.com with SMTP id i68so14486931qke.3 for ; Mon, 07 Jun 2021 13:36:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c8koUzr8PThL/JkUhS3RoQiBm3KYOOqXqBWXrYZRsSw=; b=t0OUUWBR+otL9wMQZqqrmtEAqw57F94Ud14AzVQfsG0IdrMKtFSaWZMjny+DcQELk4 V/cLPHea6HCJepxU2P/RBhfGH3CUbQa1vlr9pfSs1/Kj1zZHRphWP+msAV6QrJp+bqDs NlQJ/iaaC8T4Y8nwoD95UAUcP6kkD7mPELOMr410SFWLdhmp1nxFuuy6Gp9OVUEOdzYm haxKTAl/C5fMQS3otrAEdwsxcvBziCUXhiqmvza81NeNmt3ncAww8sSW4k5++i1lcYHz 3gNJYojNgK4ONG8tfbZoep6PAgbmMoqOoM8tS9z29hmc2/iJW18/OB5JXhbaiBY0BKrq uagA== X-Gm-Message-State: AOAM531l1pC6q9447ZZVAFEft/06HgEFmFCcyRJ9iTsT3pkCxmY/UQBG XOdI8nQvlxisQzmmbQjN31lfDInIHN+62w== X-Google-Smtp-Source: ABdhPJzO94751mXswCveqhWSrudwvGeNt4PHEwKVWodC+JV9Aw7hQIO77HzWQeV7eHxpxOhRDmlAoQ== X-Received: by 2002:a37:7046:: with SMTP id l67mr18403117qkc.69.1623098213958; Mon, 07 Jun 2021 13:36:53 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:53 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 21/24] io: Add ftw64 with 64-bit time_t support Date: Mon, 7 Jun 2021 17:36:10 -0300 Message-Id: <20210607203613.282543-22-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Similar to fts, ftw routines passes a stat pointer that might differ of size and layout when 64-bit time API is used. Checked on i686-linux-gnu and x86_64-linux-gnu. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- include/ftw.h | 18 ++++++++ io/Makefile | 4 +- io/ftw.c | 5 +- io/ftw.h | 46 ++++++++++++++++++- io/ftw64-time64.c | 34 ++++++++++++++ sysdeps/unix/sysv/linux/Versions | 2 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 2 + sysdeps/unix/sysv/linux/csky/libc.abilist | 2 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 2 + sysdeps/unix/sysv/linux/i386/libc.abilist | 2 + .../sysv/linux/m68k/coldfire/libc.abilist | 2 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 2 + .../sysv/linux/microblaze/be/libc.abilist | 2 + .../sysv/linux/microblaze/le/libc.abilist | 2 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 2 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 2 + .../sysv/linux/mips/mips64/n32/libc.abilist | 2 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 2 + .../linux/powerpc/powerpc32/fpu/libc.abilist | 2 + .../powerpc/powerpc32/nofpu/libc.abilist | 2 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 2 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 2 + .../sysv/linux/sparc/sparc32/libc.abilist | 2 + 25 files changed, 141 insertions(+), 6 deletions(-) create mode 100644 io/ftw64-time64.c diff --git a/include/ftw.h b/include/ftw.h index 4fb654cf22..8fb89c4046 100644 --- a/include/ftw.h +++ b/include/ftw.h @@ -1 +1,19 @@ +#ifndef _FTW_H #include + +#ifndef _ISOMAC +# if __TIMESIZE != 64 +# include + +typedef int (*__ftw64_time64_func_t) (const char *, + const struct __stat64_t64 *, int); +typedef int (*__nftw64_time64_func_t) (const char *, + const struct __stat64_t64 *, int, + struct FTW *); + +extern int __ftw64_time64 (const char *, __ftw64_time64_func_t, int); +extern int __nftw64_time64 (const char *, __nftw64_time64_func_t, int, int); +# endif +#endif + +#endif /* _FTW_H */ diff --git a/io/Makefile b/io/Makefile index 12c832cfcb..d35e966258 100644 --- a/io/Makefile +++ b/io/Makefile @@ -55,7 +55,8 @@ routines := \ posix_fallocate posix_fallocate64 \ sendfile sendfile64 copy_file_range \ utimensat futimens file_change_detection \ - fts64-time64 + fts64-time64 \ + ftw64-time64 others := pwd test-srcs := ftwtest @@ -106,6 +107,7 @@ CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions CFLAGS-ftw.c += $(uses-callbacks) -fexceptions CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions +CFLAGS-ftw64-time64.c += $(uses-callbacks) -fexceptions CFLAGS-posix_fallocate.c += -fexceptions CFLAGS-posix_fallocate64.c += -fexceptions CFLAGS-fallocate.c += -fexceptions diff --git a/io/ftw.c b/io/ftw.c index baca3deeee..ce1c6a14a3 100644 --- a/io/ftw.c +++ b/io/ftw.c @@ -821,7 +821,7 @@ FTW_NAME (const char *path, FTW_FUNC_T func, int descriptors) return ftw_startup (path, 0, func, descriptors, 0); } -#ifndef _LIBC +#ifndef NFTW_OLD_NAME int NFTW_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags) { @@ -844,7 +844,6 @@ NFTW_NEW_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags) } return ftw_startup (path, 1, func, descriptors, flags); } - versioned_symbol (libc, NFTW_NEW_NAME, NFTW_NAME, GLIBC_2_3_3); # if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_3_3) @@ -863,4 +862,4 @@ NFTW_OLD_NAME (const char *path, NFTW_FUNC_T func, int descriptors, int flags) compat_symbol (libc, NFTW_OLD_NAME, NFTW_NAME, GLIBC_2_1); # endif -#endif +#endif /* NFTW_OLD_NAME */ diff --git a/io/ftw.h b/io/ftw.h index 751d689cdb..446498856d 100644 --- a/io/ftw.h +++ b/io/ftw.h @@ -137,15 +137,36 @@ extern int ftw (const char *__dir, __ftw_func_t __func, int __descriptors) __nonnull ((1, 2)); #else # ifdef __REDIRECT +# ifndef __USE_TIME_BITS64 extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func, int __descriptors), ftw64) __nonnull ((1, 2)); +# else +extern int __REDIRECT (ftw, (const char *__dir, __ftw_func_t __func, + int __descriptors), __ftw64_time64) + __nonnull ((1, 2)); +# endif # else -# define ftw ftw64 +# ifndef __USE_TIME_BITS64 +# define ftw ftw64 +# else +# define ftw __ftw64_time64 +# endif # endif #endif #ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 extern int ftw64 (const char *__dir, __ftw64_func_t __func, int __descriptors) __nonnull ((1, 2)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (ftw64, (const char *__dir, __ftw64_func_t __func, + int __descriptors), + __ftw64_time64) + __nonnull ((1, 2)); +# else +# define nftw64 __nftw64_time64 +# endif +# endif #endif #ifdef __USE_XOPEN_EXTENDED @@ -159,16 +180,37 @@ extern int nftw (const char *__dir, __nftw_func_t __func, int __descriptors, int __flag) __nonnull ((1, 2)); # else # ifdef __REDIRECT +# ifndef __USE_TIME_BITS64 extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func, int __descriptors, int __flag), nftw64) __nonnull ((1, 2)); +# else +extern int __REDIRECT (nftw, (const char *__dir, __nftw_func_t __func, + int __descriptors, int __flag), __nftw64_time64) + __nonnull ((1, 2)); +# endif # else -# define nftw nftw64 +# ifndef __USE_TIME_BITS64 +# define nftw nftw64 +# else +# define nftw __nftw64_time64 +# endif # endif # endif # ifdef __USE_LARGEFILE64 +# ifndef __USE_TIME_BITS64 extern int nftw64 (const char *__dir, __nftw64_func_t __func, int __descriptors, int __flag) __nonnull ((1, 2)); +# else +# ifdef __REDIRECT +extern int __REDIRECT (nftw64, (const char *__dir, __nftw64_func_t __func, + int __descriptors, int __flag), + __nftw64_time64) + __nonnull ((1, 2)); +# else +# define nftw64 __nftw64_time64 +# endif +# endif # endif #endif diff --git a/io/ftw64-time64.c b/io/ftw64-time64.c new file mode 100644 index 0000000000..7c9db5448a --- /dev/null +++ b/io/ftw64-time64.c @@ -0,0 +1,34 @@ +/* File tree walker functions. LFS version. + Copyright (C) 1996-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#if __TIMESIZE != 64 +# define FTW_NAME __ftw64_time64 +# define NFTW_NAME __nftw64_time64 +# define INO_T ino64_t +# define STRUCT_STAT __stat64_t64 +# define LSTAT __lstat64_time64 +# define STAT __stat64_time64 +# define FSTATAT __fstatat64_time64 +# define FTW_FUNC_T __ftw64_time64_func_t +# define NFTW_FUNC_T __nftw64_time64_func_t + +# include "ftw.c" +#endif diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index b4513f64da..aeb5c1f0b4 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -211,6 +211,8 @@ libc { __fts64_read_time64; __fts64_set_time64; __fts64_children_time64; + __ftw64_time64; + __nftw64_time64; __getitimer64; __getrusage64; __gettimeofday64; diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 49fa140d7a..9cb72fe04b 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -208,6 +208,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -227,6 +228,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 60e3da1b8a..5b0c9ff0f3 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -205,6 +205,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -224,6 +225,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index a694b01087..3049001346 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2295,6 +2295,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2314,6 +2315,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index d40edc659c..92629e1630 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2249,6 +2249,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2268,6 +2269,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index cd975e36a7..4cd1c26d0a 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2432,6 +2432,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2452,6 +2453,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 77c15fda91..85b909706c 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -209,6 +209,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -228,6 +229,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 0e1ab1544e..7212e6ee9d 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2376,6 +2376,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2395,6 +2396,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 26641a9573..3103e95dd8 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2346,6 +2346,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2365,6 +2366,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index dc50753be0..d081a8c55a 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2343,6 +2343,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2362,6 +2363,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 3d89c7457b..bca2a3b05e 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2341,6 +2341,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2360,6 +2361,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 6bfac13584..6284a0b4f9 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2339,6 +2339,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2358,6 +2359,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 09c884ac9b..83578c8899 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2347,6 +2347,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2366,6 +2367,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index fd64cce1da..89d9c50b9e 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2385,6 +2385,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2404,6 +2405,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 306a572a38..f9cb8f1c24 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2403,6 +2403,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2422,6 +2423,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 86d4a96c20..4936a2ee5a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2436,6 +2436,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2455,6 +2456,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 8f0716c6f6..4dd86819df 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2401,6 +2401,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2420,6 +2421,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 9c0b91f70b..a53b86b1df 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2256,6 +2256,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2275,6 +2276,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index 280984fcc8..31d321a82c 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2253,6 +2253,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2272,6 +2273,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index d46f749d1a..a9540a7082 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2394,6 +2394,7 @@ GLIBC_2.34 __fts64_close_time64 F GLIBC_2.34 __fts64_open_time64 F GLIBC_2.34 __fts64_read_time64 F GLIBC_2.34 __fts64_set_time64 F +GLIBC_2.34 __ftw64_time64 F GLIBC_2.34 __futimens64 F GLIBC_2.34 __futimes64 F GLIBC_2.34 __futimesat64 F @@ -2413,6 +2414,7 @@ GLIBC_2.34 __mktime64 F GLIBC_2.34 __msgctl64 F GLIBC_2.34 __mtx_timedlock64 F GLIBC_2.34 __nanosleep64 F +GLIBC_2.34 __nftw64_time64 F GLIBC_2.34 __ntp_gettime64 F GLIBC_2.34 __ntp_gettimex64 F GLIBC_2.34 __ppoll64 F From patchwork Mon Jun 7 20:36:11 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: 43772 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 5CC03393A401 for ; Mon, 7 Jun 2021 20:52:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CC03393A401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623099176; bh=Ged7LajZXcId5inMOjT4eJs0VVdwec9gufbgSFXg3F4=; 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=lgvhqggfzcXnwEJ3nJS83RzXXwToXwaRggat5Ue2gOeVtIAhf0TLNABFttrmc2UYu Fx4Qr7V05Trvxosec8vA5E5U8YrO+WW/nV/moND+4mARHM7lAY3TGFbe7b0e+pvHzR AX/Ys154aj+b4HgBQ7j1uRlNFqUNYnDAWkWAgt60= 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 6DF9F3938C35 for ; Mon, 7 Jun 2021 20:36:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6DF9F3938C35 Received: by mail-qk1-x72c.google.com with SMTP id i67so18063352qkc.4 for ; Mon, 07 Jun 2021 13:36:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ged7LajZXcId5inMOjT4eJs0VVdwec9gufbgSFXg3F4=; b=hSHkUl6y0dTAIymDdM/dkG5rDSzRECMmPwPGf1NuK8omjd2HyJHzTTKNmwezhZWrTT AZMNO4hHTiV3EBfntlXbTPdwtyb1ovyYF8oE+N/YjxAgx4DGjsa+/TjlXXBiJ1RlnNQF u1C3x2aumcIWIn1gXF8IX/fQJhDk2tZgPKtqx9x+rG2PenZFhR0KK3cQgM/o1ZhoCUsr 0UvsWh0M/2n/vitH1IQG//8bGVtqT19DlNap7HZWgNunzQ9McHNWxH1BKZdrXTQTIyYS utfmmn3Vd9qH51JSD+BbaIAG1h35BmO/Ld3wtremGIWU77QTwU2UY+CGFNHINnY4DHLe RC/g== X-Gm-Message-State: AOAM533XxfJOzh2tvUaOrCifKrJc6hILpBFfWWVCTvUNq2btYMPFCjsN IoBXE5CCkNPoJn3oW6UNjNFNGdBt8xplvg== X-Google-Smtp-Source: ABdhPJxssujmMM+3IyjWxvaqZBwUQjP4q/uvdeEQJBdihQgf47OKoiBBkMCl/yweDrTuF1G+Q3wYRQ== X-Received: by 2002:a05:620a:a4f:: with SMTP id j15mr6073841qka.177.1623098215712; Mon, 07 Jun 2021 13:36:55 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:55 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 22/24] libsupport: Add 64-bit time_t support for time functions Date: Mon, 7 Jun 2021 17:36:11 -0300 Message-Id: <20210607203613.282543-23-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The patch adds redirections for xclock_gettime, xclock_settime, timespec_add, timespec_sub, test_timespec_before_impl, test_timespec_equal_or_after_impl, support_timespec_ns, support_timespec_normalize, and support_timespec_check_in_range when _TIME_BITS=64 is defined. Co-authored-by: Lukasz Majewski Tested-by: Carlos O'Donell Reviewed-by: Carlos O'Donell Tested-by: carlos O'Donell --- support/Makefile | 6 ++++ support/timespec-add-time64.c | 27 +++++++++++++++++ support/timespec-add.c | 2 +- support/timespec-sub-time64.c | 27 +++++++++++++++++ support/timespec-sub.c | 2 +- support/timespec-time64.c | 40 +++++++++++++++++++++++++ support/timespec.c | 9 +++--- support/timespec.h | 52 +++++++++++++++++++++++++-------- support/xclock_gettime_time64.c | 26 +++++++++++++++++ support/xclock_settime_time64.c | 26 +++++++++++++++++ support/xtime.h | 7 +++++ 11 files changed, 205 insertions(+), 19 deletions(-) create mode 100644 support/timespec-add-time64.c create mode 100644 support/timespec-sub-time64.c create mode 100644 support/timespec-time64.c create mode 100644 support/xclock_gettime_time64.c create mode 100644 support/xclock_settime_time64.c diff --git a/support/Makefile b/support/Makefile index 0a4b057db5..e27b9b164e 100644 --- a/support/Makefile +++ b/support/Makefile @@ -83,8 +83,11 @@ libsupport-routines = \ support_test_verify_impl \ temp_file \ timespec \ + timespec-time64 \ timespec-add \ + timespec-add-time64 \ timespec-sub \ + timespec-sub-time64 \ write_message \ xaccept \ xaccept4 \ @@ -94,7 +97,9 @@ libsupport-routines = \ xchdir \ xchroot \ xclock_gettime \ + xclock_gettime_time64 \ xclock_settime \ + xclock_settime_time64 \ xclose \ xchmod \ xconnect \ @@ -216,6 +221,7 @@ CFLAGS-support_paths.c = \ # in support_timespec_check_in_range and for that computation we use # -fexcess-precision=standard. CFLAGS-timespec.c += -fexcess-precision=standard +CFLAGS-timespec-time64.c += -fexcess-precision=standard ifeq (,$(CXX)) LINKS_DSO_PROGRAM = links-dso-program-c diff --git a/support/timespec-add-time64.c b/support/timespec-add-time64.c new file mode 100644 index 0000000000..a25a3c8d34 --- /dev/null +++ b/support/timespec-add-time64.c @@ -0,0 +1,27 @@ +/* Add two struct __timespec64 values. 64-bit time support. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library and is also part of gnulib. + Patches to this file should be submitted to both projects. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#if __TIMESIZE != 64 +# define timespec __timespec64 +# define time_t __time64_t +# define timespec_add timespec_add_time64 +# include "timespec-add.c" +#endif diff --git a/support/timespec-add.c b/support/timespec-add.c index cf8bd91291..8ed3acef6d 100644 --- a/support/timespec-add.c +++ b/support/timespec-add.c @@ -61,5 +61,5 @@ timespec_add (struct timespec a, struct timespec b) } } - return make_timespec (rs, rns); + return (struct timespec) { .tv_sec = rs, .tv_nsec = rns }; } diff --git a/support/timespec-sub-time64.c b/support/timespec-sub-time64.c new file mode 100644 index 0000000000..dcbb79211a --- /dev/null +++ b/support/timespec-sub-time64.c @@ -0,0 +1,27 @@ +/* Subtract two struct __timespec64 values. 64-bit time support. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library and is also part of gnulib. + Patches to this file should be submitted to both projects. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#if __TIMESIZE != 64 +# define timespec __timespec64 +# define time_t __time64_t +# define timespec_sub timespec_sub_time64 +# include "timespec-sub.c" +#endif diff --git a/support/timespec-sub.c b/support/timespec-sub.c index 08cc233086..0b8fea042d 100644 --- a/support/timespec-sub.c +++ b/support/timespec-sub.c @@ -61,5 +61,5 @@ timespec_sub (struct timespec a, struct timespec b) } } - return make_timespec (rs, rns); + return (struct timespec) { .tv_sec = rs, .tv_nsec = rns }; } diff --git a/support/timespec-time64.c b/support/timespec-time64.c new file mode 100644 index 0000000000..d780658ec3 --- /dev/null +++ b/support/timespec-time64.c @@ -0,0 +1,40 @@ +/* Support code for timespec checks. 64-bit time support. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include +#include + +#if __TIMESIZE != 64 +struct __timespec64 timespec_sub_time64 (struct __timespec64, + struct __timespec64); + +#define test_timespec_before_impl test_timespec_before_impl_time64 +#define test_timespec_equal_or_after_impl \ + test_timespec_equal_or_after_impl_time64 +#define support_timespec_ns support_timespec_ns_time64 +#define support_timespec_normalize support_timespec_normalize_time64 +#define support_timespec_check_in_range \ + support_timespec_check_in_range_time64 +#define timespec __timespec64 +#define timespec_sub timespec_sub_time64 + +#include "timespec.c" +#endif diff --git a/support/timespec.c b/support/timespec.c index b02afad9d3..fcc54861b1 100644 --- a/support/timespec.c +++ b/support/timespec.c @@ -23,9 +23,8 @@ #include void -test_timespec_before_impl (const char *file, int line, - const struct timespec left, - const struct timespec right) +test_timespec_before_impl (const char *file, int line, struct timespec left, + struct timespec right) { if (left.tv_sec > right.tv_sec || (left.tv_sec == right.tv_sec @@ -43,8 +42,8 @@ test_timespec_before_impl (const char *file, int line, void test_timespec_equal_or_after_impl (const char *file, int line, - const struct timespec left, - const struct timespec right) + struct timespec left, + struct timespec right) { if (left.tv_sec < right.tv_sec || (left.tv_sec == right.tv_sec diff --git a/support/timespec.h b/support/timespec.h index a3eb72aa01..0478aef51f 100644 --- a/support/timespec.h +++ b/support/timespec.h @@ -24,11 +24,6 @@ #include #include -struct timespec timespec_add (struct timespec, struct timespec) - __attribute__((const)); -struct timespec timespec_sub (struct timespec, struct timespec) - __attribute__((const)); - static inline struct timespec make_timespec (time_t s, long int ns) { @@ -40,21 +35,54 @@ make_timespec (time_t s, long int ns) enum { TIMESPEC_HZ = 1000000000 }; +#ifndef __USE_TIME_BITS64 +struct timespec timespec_add (struct timespec, struct timespec) + __attribute__((const)); +struct timespec timespec_sub (struct timespec, struct timespec) + __attribute__((const)); + void test_timespec_before_impl (const char *file, int line, - const struct timespec left, - const struct timespec right); + struct timespec left, + struct timespec right); void test_timespec_equal_or_after_impl (const char *file, int line, - const struct timespec left, - const struct timespec right); + struct timespec left, + struct timespec right); time_t support_timespec_ns (struct timespec time); struct timespec support_timespec_normalize (struct timespec time); -int support_timespec_check_in_range (struct timespec expected, struct timespec observed, - double lower_bound, double upper_bound); - +int support_timespec_check_in_range (struct timespec expected, + struct timespec observed, + double lower_bound, double upper_bound); + +#else +struct timespec __REDIRECT (timespec_add, (struct timespec, struct timespec), + timespec_add_time64); +struct timespec __REDIRECT (timespec_sub, (struct timespec, struct timespec), + timespec_sub_time64); +void __REDIRECT (test_timespec_before_impl, (const char *file, int line, + struct timespec left, + struct timespec right), + test_timespec_before_impl_time64); +void __REDIRECT (test_timespec_equal_or_after_impl, (const char *f, int line, + struct timespec left, + struct timespec right), + test_timespec_equal_or_after_impl_time64); + +time_t __REDIRECT (support_timespec_ns, (struct timespec time), + support_timespec_ns_time64); + +struct timespec __REDIRECT (support_timespec_normalize, (struct timespec time), + support_timespec_normalize_time64); + +int __REDIRECT (support_timespec_check_in_range, (struct timespec expected, + struct timespec observed, + double lower_bound, + double upper_bound), + support_timespec_check_in_range_time64); +#endif /* Check that the timespec on the left represents a time before the time on the right. */ diff --git a/support/xclock_gettime_time64.c b/support/xclock_gettime_time64.c new file mode 100644 index 0000000000..d2ed0f026d --- /dev/null +++ b/support/xclock_gettime_time64.c @@ -0,0 +1,26 @@ +/* clock_settime with error checking. 64-bit time_t support. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#if __TIMESIZE != 64 +# define xclock_gettime xclock_gettime_time64 +# define timespec __timespec64 +# define clock_gettime __clock_gettime64 +# include "xclock_gettime.c" +#endif diff --git a/support/xclock_settime_time64.c b/support/xclock_settime_time64.c new file mode 100644 index 0000000000..7f7bead876 --- /dev/null +++ b/support/xclock_settime_time64.c @@ -0,0 +1,26 @@ +/* clock_settime helper with error checking - 64-bit time_t support. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +#if __TIMESIZE != 64 +# define xclock_settime xclock_settime_time64 +# define timespec __timespec64 +# define clock_settime __clock_settime64 +# include "xclock_settime.c" +#endif diff --git a/support/xtime.h b/support/xtime.h index b4ac3b59e2..25a069d447 100644 --- a/support/xtime.h +++ b/support/xtime.h @@ -30,8 +30,15 @@ __BEGIN_DECLS /* The following functions call the corresponding libc functions and terminate the process on error. */ +#ifndef __USE_TIME_BITS64 void xclock_gettime (clockid_t clock, struct timespec *ts); void xclock_settime (clockid_t clock, const struct timespec *ts); +#else +void __REDIRECT (xclock_gettime, (clockid_t clock, struct timespec *ts), + xclock_gettime_time64); +void __REDIRECT (xclock_settime, (clockid_t clock, const struct timespec *ts), + xclock_settime_time64); +#endif /* This helper can often simplify tests by avoiding an explicit variable declaration or allowing that declaration to be const. */ From patchwork Mon Jun 7 20:36:12 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: 43773 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 C36B93938C1F for ; Mon, 7 Jun 2021 20:53:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C36B93938C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623099220; bh=7RoQsJx+qqwmHp0Zxere8hKpgWxHrb8SaqTvh7y4YWo=; 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=OuylMcV4S/WfYLegumPKtwUJkE78yRFgoT5oTB6w/EZThpWTMOYkfHUmlgI//Vdkj EkUhBPwjSk6Y3mSCeqGXonx5CyTbojiBBjZGdUn+ZauD6Q6dcFn7iGwMereUUMkWaT TraJz+TsyWreCEamJng/6KvzOzAS0O9GoaDemTvg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by sourceware.org (Postfix) with ESMTPS id F1E573939C01 for ; Mon, 7 Jun 2021 20:36:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F1E573939C01 Received: by mail-qk1-x735.google.com with SMTP id j189so18117690qkf.2 for ; Mon, 07 Jun 2021 13:36:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7RoQsJx+qqwmHp0Zxere8hKpgWxHrb8SaqTvh7y4YWo=; b=l5YNKHyW1NC8NAm+icPyq99rzJm9mQBtEMbtNLoC4opA6KpltwqcQKQGHB5uMi9fhb CdjWI9rhgnRCO35hIrET5Wv1xQNFG6T2x7MHDuY06rlAgu5QmcszIrTVQSej2nc8mZoL 07E/utBQWGfx4RgCPQcbs2AymIjnXpkb6ofSWPsRZj0SyclI7Fi1a/sAoLqwvo6y1KSw R+xFDZdoUKb1x2cW9+HvlBZgORs14pfuNLpBVEALYi8Bd1DYua4hl+aaBLHTaeWRNMsS g03GCMpmK/PksSks+CZt6tpOAnek+M+YUEfiivQpuNAzXSKkDzSuCoyqsHMtajXtdRmn +N5Q== X-Gm-Message-State: AOAM531qbOlVfCVJOWc2PbTRvZ5+iKwcAW4DCcYSuKqC97xwfa09jPDo m4BBOOgpIs2q3r7QSfmgdj1w43edt24I7Q== X-Google-Smtp-Source: ABdhPJynhCm9V0h8ornjC5R9d6m6Q5AhZ0R8FXKETfNUjHOSJ2/4VNWQgCarPA8O7EMm0Ot039L2Ig== X-Received: by 2002:a05:620a:2941:: with SMTP id n1mr18260240qkp.330.1623098217346; Mon, 07 Jun 2021 13:36:57 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:57 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 23/24] libsupport: Add 64-bit time_t support for stat functions Date: Mon, 7 Jun 2021 17:36:12 -0300 Message-Id: <20210607203613.282543-24-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The patch adds redirections for xstat, xlstat, and xfstat when _TIME_BITS=64 is defined. Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- support/Makefile | 3 +++ support/support-xfstat-time64.c | 32 ++++++++++++++++++++++++++++++++ support/support-xstat-time64.c | 32 ++++++++++++++++++++++++++++++++ support/xlstat-time64.c | 32 ++++++++++++++++++++++++++++++++ support/xunistd.h | 13 +++++++++++++ 5 files changed, 112 insertions(+) create mode 100644 support/support-xfstat-time64.c create mode 100644 support/support-xstat-time64.c create mode 100644 support/xlstat-time64.c diff --git a/support/Makefile b/support/Makefile index e27b9b164e..f3ebaa8d2e 100644 --- a/support/Makefile +++ b/support/Makefile @@ -40,7 +40,9 @@ libsupport-routines = \ resolv_test \ set_fortify_handler \ support-xfstat \ + support-xfstat-time64 \ support-xstat \ + support-xstat-time64 \ support_become_root \ support_can_chroot \ support_capture_subprocess \ @@ -117,6 +119,7 @@ libsupport-routines = \ xlisten \ xlseek \ xlstat \ + xlstat-time64 \ xmalloc \ xmemstream \ xmkdir \ diff --git a/support/support-xfstat-time64.c b/support/support-xfstat-time64.c new file mode 100644 index 0000000000..324c5d20d2 --- /dev/null +++ b/support/support-xfstat-time64.c @@ -0,0 +1,32 @@ +/* 64-bit time_t stat with error checking. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* NB: Non-standard file name to avoid sysdeps override for xstat. */ + +#include +#include +#include + +#if __TIMESIZE != 64 +void +xfstat_time64 (int fd, struct __stat64_t64 *result) +{ + if (__fstat64_time64 (fd, result) != 0) + FAIL_EXIT1 ("__fstat64_time64 (%d): %m", fd); +} +#endif diff --git a/support/support-xstat-time64.c b/support/support-xstat-time64.c new file mode 100644 index 0000000000..7d0194b98a --- /dev/null +++ b/support/support-xstat-time64.c @@ -0,0 +1,32 @@ +/* 64-bit time_t stat with error checking. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* NB: Non-standard file name to avoid sysdeps override for xstat. */ + +#include +#include +#include + +#if __TIMESIZE != 64 +void +xstat_time64 (const char *path, struct __stat64_t64 *result) +{ + if (__stat64_time64 (path, result) != 0) + FAIL_EXIT1 ("__stat64_time64 (\"%s\"): %m", path); +} +#endif diff --git a/support/xlstat-time64.c b/support/xlstat-time64.c new file mode 100644 index 0000000000..ef4d922635 --- /dev/null +++ b/support/xlstat-time64.c @@ -0,0 +1,32 @@ +/* 64-bit time_t stat with error checking. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* NB: Non-standard file name to avoid sysdeps override for xstat. */ + +#include +#include +#include + +#if __TIMESIZE != 64 +void +xlstat_time64 (const char *path, struct __stat64_t64 *result) +{ + if (__lstat64_time64 (path, result) != 0) + FAIL_EXIT1 ("__lstat64_time64 (\"%s\"): %m", path); +} +#endif diff --git a/support/xunistd.h b/support/xunistd.h index c642588c29..e4ade65c85 100644 --- a/support/xunistd.h +++ b/support/xunistd.h @@ -24,6 +24,7 @@ #include #include +#include #include __BEGIN_DECLS @@ -35,9 +36,21 @@ pid_t xwaitpid (pid_t, int *status, int flags); void xpipe (int[2]); void xdup2 (int, int); int xopen (const char *path, int flags, mode_t); +#ifndef __USE_TIME_BITS64 +# ifdef __USE_FILE_OFFSET64 +void xstat (const char *path, struct stat *); +void xlstat (const char *path, struct stat *); +void xfstat (int fd, struct stat *); +# else void xstat (const char *path, struct stat64 *); void xlstat (const char *path, struct stat64 *); void xfstat (int fd, struct stat64 *); +# endif +#else +void __REDIRECT (xstat, (const char *path, struct stat *), xstat_time64); +void __REDIRECT (xlstat, (const char *path, struct stat *), xlstat_time64); +void __REDIRECT (xfstat, (int fd, struct stat *), xfstat_time64); +#endif void xmkdir (const char *path, mode_t); void xchroot (const char *path); void xunlink (const char *path); From patchwork Mon Jun 7 20:36:13 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: 43775 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 2AFC3388982E for ; Mon, 7 Jun 2021 20:55:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AFC3388982E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623099341; bh=j+/x5f0GIgMm3M9uwTht2v62/gjXZZs/JOMGV3GSyyU=; 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=kXne+Zd4IwlkrvID4zaS/iPSkDItbGFigLsvma7sk+WFkxTmNDvn3xC3wtXco192B +a1F+4ImuLORwmOKJNeU1tOcWBZ306cOe/2ywEaEmZ7VO65zhJuAn3DdgOzsBJmn5Q +4Pft7l5e9d3mcnC8PpV3aBHaDzZotUqMahspxEw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by sourceware.org (Postfix) with ESMTPS id 1A4CE3938C33 for ; Mon, 7 Jun 2021 20:37:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1A4CE3938C33 Received: by mail-qt1-x82e.google.com with SMTP id g12so1295114qtb.2 for ; Mon, 07 Jun 2021 13:37:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=j+/x5f0GIgMm3M9uwTht2v62/gjXZZs/JOMGV3GSyyU=; b=BdhCCjtS1eC2ShBhkZcLcwFRrSloDTXBUwnoB/iHP7e6mNwaPQtIaHjjjZDFvg8OTi H5/RoRqFaF5i6t/GSuXPEnjEhyJzv24ePd3BGfpgRDpAPhBkB9c5OMHkPn60wcarwrZE trYaYGKSfcyPeNmoBY4FeMlpJksm7ACweG9I2vQ/gMAY55StvjY5RMNHBR9lATPDGjbk +Wa2wOshpyOB090Jt+AfDOrrylalppethaSRbSxIzD1tftSU9Rht/V5JXc5FanzAA8lD WDL424dQkX/HllKrG+gSIV5f1FmZZjR2O//u5hcIwH4KlfcviXrTCprmO61RDvmieaZQ g1cA== X-Gm-Message-State: AOAM532WEPfwtlLaxS41yU04eYfNsyXRZaPD5BqmHMJWr6+7ga5fxQvm 7FvtyV3uOm9alSRebD1Flo3oYsQmxKpl5w== X-Google-Smtp-Source: ABdhPJw5DT7K1wEDdoWJ3IEj63oSgom9J4779sLwWhdDkqUvjFEGgEXAUvWChg5UoXh5lR1G6YuYfw== X-Received: by 2002:ac8:4654:: with SMTP id f20mr8482786qto.144.1623098219162; Mon, 07 Jun 2021 13:36:59 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.googlemail.com with ESMTPSA id t196sm10422123qke.50.2021.06.07.13.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 13:36:58 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 24/24] y2038: Add test coverage Date: Mon, 7 Jun 2021 17:36:13 -0300 Message-Id: <20210607203613.282543-25-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607203613.282543-1-adhemerval.zanella@linaro.org> References: <20210607203613.282543-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+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" It is enabled through a new rule, tests-y2038, which is built only when the ABI supports the comapt 64-bit time_t (defined by the header time64-compat.h, which also enables the creation of the symbol Version for Linux). It means the tests are not built for ABI which already provide default 64-bit time_t. The new rule already adds the required LFS and 64-bit time_t compiler flags. The current coverage is: * libc: - adjtime tst-adjtime-time64 - adjtimex tst-adjtimex-time64 - clock_adjtime tst-clock_adjtime-time64 - clock_getres tst-clock-time64, tst-cpuclock1-time64 - clock_gettime tst-clock-time64, tst-clock2-time64, tst-cpuclock1-time64 - clock_nanosleep tst-clock_nanosleep-time64, tst-cpuclock1-time64 - clock_settime tst-clock2-time64 - cnd_timedwait tst-cnd-timedwait-time64 - ctime tst-ctime-time64 - ctime_r tst-ctime-time64 - difftime tst-difftime-time64 - fstat tst-stat-time64 - fstatat tst-stat-time64 - futimens tst-futimens-time64 - futimes tst-futimes-time64 - futimesat tst-futimesat-time64 - fts_* tst-fts-time64 - getitimer tst-itimer-timer64 - getrusage - gettimeofday tst-clock_nanosleep-time64 - glob / globfree tst-gnuglob64-time64 - gmtime tst-gmtime-time64 - gmtime_r tst-gmtime-time64 - lstat tst-stat-time64 - localtime tst-y2039-time64 - localtime_t tst-y2039-time64 - lutimes tst-lutimes-time64 - mktime tst-mktime4-time64 - mq_timedreceive tst-mqueue{1248}-time64 - mq_timedsend tst-mqueue{1248}-time64 - msgctl test-sysvmsg-time64 - mtx_timedlock tst-mtx-timedlock-time64 - nanosleep tst-cpuclock{12}-time64, tst-mqueue8-time64, tst-clock-time64 - nftw / ftw ftwtest-time64 - ntp_adjtime tst-ntp_adjtime-time64 - ntp_gettime tst-ntp_gettime-time64 - ntp_gettimex tst-ntp_gettimex-time64 - ppoll tst-ppoll-time64 - pselect tst-pselect-time64 - pthread_clockjoin_np tst-join14-time64 - pthread_cond_clockwait tst-cond11-time64 - pthread_cond_timedwait tst-abstime-time64 - pthread_mutex_clocklock tst-abstime-time64 - pthread_mutex_timedlock tst-abstime-time64 - pthread_rwlock_clockrdlock tst-abstime-time64, tst-rwlock14-time64 - pthread_rwlock_clockwrlock tst-abstime-time64, tst-rwlock14-time64 - pthread_rwlock_timedrdlock tst-abstime-time64, tst-rwlock14-time64 - pthread_rwlock_timedwrlock tst-abstime-time64, tst-rwlock14-time64 - pthread_timedjoin_np tst-join14-time64 - recvmmsg tst-cancel4_2-time64 - sched_rr_get_interval tst-sched_rr_get_interval-time64 - select tst-select-time64 - sem_clockwait tst-sem5-time64 - sem_timedwait tst-sem5-time64 - semctl test-sysvsem-time64 - semtimedop test-sysvsem-time64 - setitimer tst-mqueue2-time64, tst-itimer-timer64 - settimeofday tst-settimeofday-time64 - shmctl test-sysvshm-time64 - sigtimedwait tst-sigtimedwait-time64 - stat tst-stat-time64 - thrd_sleep tst-thrd-sleep-time64 - time tst-mqueue{1248}-time64 - timegm tst-timegm-time64 - timer_gettime tst-timer4-time64 - timer_settime tst-timer4-time64 - timerfd_gettime tst-timerfd-time64 - timerfd_settime tst-timerfd-time64 - timespec_get tst-timespec_get-time64 - timespec_getres tst-timespec_getres-time64 - utime tst-utime-time64 - utimensat tst-utimensat-time64 - utimes tst-utimes-time64 - wait3 tst-wait3-time64 - wait4 tst-wait4-time64 * librt: - aio_suspend tst-aio6-time64 - mq_timedreceive tst-mqueue{1248}-time64 - mq_timedsend tst-mqueue{1248}-time64 - timer_gettime tst-timer4-time64 - timer_settime tst-timer4-time64 * libanl: - gai_suspend Reviewed-by: Lukasz Majewski Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- Makeconfig | 14 +++ Makerules | 18 +++- io/Makefile | 22 +++- io/ftwtest-time64.c | 1 + io/tst-fts-time64.c | 1 + io/tst-futimens-time64.c | 2 + io/tst-futimens.c | 6 +- io/tst-futimes-time64.c | 2 + io/tst-futimes.c | 6 +- io/tst-futimesat-time64.c | 4 + io/tst-futimesat.c | 47 +++++--- io/tst-lutimes-time64.c | 2 + io/tst-lutimes.c | 10 +- io/tst-stat-time64.c | 102 ++++++++++++++++++ io/tst-utime-time64.c | 2 + io/tst-utime.c | 6 +- io/tst-utimensat-time64.c | 2 + io/tst-utimensat.c | 12 ++- io/tst-utimes-time64.c | 2 + io/tst-utimes.c | 6 +- misc/Makefile | 4 + misc/tst-pselect-time64.c | 1 + misc/tst-select-time64.c | 1 + nptl/Makefile | 3 + nptl/tst-cancel4_2-time64.c | 1 + posix/Makefile | 2 + posix/tst-gnuglob64-time64.c | 7 ++ posix/tst-sched_rr_get_interval-time64.c | 1 + posix/tst-wait3-time64.c | 1 + posix/tst-wait4-time64.c | 1 + rt/Makefile | 9 ++ rt/tst-aio6-time64.c | 1 + rt/tst-cpuclock2-time64.c | 1 + rt/tst-cpuclock2.c | 9 +- rt/tst-mqueue1-time64.c | 1 + rt/tst-mqueue2-time64.c | 1 + rt/tst-mqueue4-time64.c | 1 + rt/tst-mqueue8-time64.c | 1 + rt/tst-timer4-time64.c | 1 + sysdeps/pthread/Makefile | 10 ++ sysdeps/pthread/tst-abstime-time64.c | 1 + sysdeps/pthread/tst-cnd-timedwait-time64.c | 1 + sysdeps/pthread/tst-cond11-time64.c | 1 + sysdeps/pthread/tst-join14-time64.c | 1 + sysdeps/pthread/tst-mtx-timedlock-time64.c | 1 + sysdeps/pthread/tst-rwlock14-time64.c | 1 + sysdeps/pthread/tst-sem5-time64.c | 1 + sysdeps/pthread/tst-thrd-sleep-time64.c | 1 + sysdeps/unix/sysv/linux/Makefile | 10 ++ sysdeps/unix/sysv/linux/tst-adjtimex-time64.c | 1 + .../sysv/linux/tst-clock_adjtime-time64.c | 1 + .../unix/sysv/linux/tst-ntp_adjtime-time64.c | 1 + .../unix/sysv/linux/tst-ntp_gettime-time64.c | 1 + .../unix/sysv/linux/tst-ntp_gettimex-time64.c | 1 + sysdeps/unix/sysv/linux/tst-ppoll-time64.c | 1 + .../unix/sysv/linux/tst-sigtimedwait-time64.c | 1 + sysdeps/unix/sysv/linux/tst-timerfd-time64.c | 1 + sysvipc/Makefile | 2 + sysvipc/test-sysvmsg-time64.c | 1 + sysvipc/test-sysvsem-time64.c | 1 + sysvipc/test-sysvshm-time64.c | 1 + time/Makefile | 18 ++++ time/tst-adjtime-time64.c | 1 + time/tst-clock-time64.c | 1 + time/tst-clock2-time64.c | 1 + time/tst-clock_nanosleep-time64.c | 1 + time/tst-clock_settime-time64.c | 1 + time/tst-cpuclock1-time64.c | 1 + time/tst-ctime-time64.c | 1 + time/tst-ctime.c | 16 +++ time/tst-difftime-time64.c | 1 + time/tst-gmtime-time64.c | 1 + time/tst-itimer-time64.c | 1 + time/tst-mktime4-time64.c | 1 + time/tst-settimeofday-time64.c | 1 + time/tst-timegm-time64.c | 1 + time/tst-timespec_get-time64.c | 1 + time/tst-timespec_getres-time64.c | 1 + time/tst-y2039-time64.c | 1 + time/tst-y2039.c | 10 ++ 80 files changed, 385 insertions(+), 30 deletions(-) create mode 100644 io/ftwtest-time64.c create mode 100644 io/tst-fts-time64.c create mode 100644 io/tst-futimens-time64.c create mode 100644 io/tst-futimes-time64.c create mode 100644 io/tst-futimesat-time64.c create mode 100644 io/tst-lutimes-time64.c create mode 100644 io/tst-stat-time64.c create mode 100644 io/tst-utime-time64.c create mode 100644 io/tst-utimensat-time64.c create mode 100644 io/tst-utimes-time64.c create mode 100644 misc/tst-pselect-time64.c create mode 100644 misc/tst-select-time64.c create mode 100644 nptl/tst-cancel4_2-time64.c create mode 100644 posix/tst-gnuglob64-time64.c create mode 100644 posix/tst-sched_rr_get_interval-time64.c create mode 100644 posix/tst-wait3-time64.c create mode 100644 posix/tst-wait4-time64.c create mode 100644 rt/tst-aio6-time64.c create mode 100644 rt/tst-cpuclock2-time64.c create mode 100644 rt/tst-mqueue1-time64.c create mode 100644 rt/tst-mqueue2-time64.c create mode 100644 rt/tst-mqueue4-time64.c create mode 100644 rt/tst-mqueue8-time64.c create mode 100644 rt/tst-timer4-time64.c create mode 100644 sysdeps/pthread/tst-abstime-time64.c create mode 100644 sysdeps/pthread/tst-cnd-timedwait-time64.c create mode 100644 sysdeps/pthread/tst-cond11-time64.c create mode 100644 sysdeps/pthread/tst-join14-time64.c create mode 100644 sysdeps/pthread/tst-mtx-timedlock-time64.c create mode 100644 sysdeps/pthread/tst-rwlock14-time64.c create mode 100644 sysdeps/pthread/tst-sem5-time64.c create mode 100644 sysdeps/pthread/tst-thrd-sleep-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-adjtimex-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-ppoll-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-timerfd-time64.c create mode 100644 sysvipc/test-sysvmsg-time64.c create mode 100644 sysvipc/test-sysvsem-time64.c create mode 100644 sysvipc/test-sysvshm-time64.c create mode 100644 time/tst-adjtime-time64.c create mode 100644 time/tst-clock-time64.c create mode 100644 time/tst-clock2-time64.c create mode 100644 time/tst-clock_nanosleep-time64.c create mode 100644 time/tst-clock_settime-time64.c create mode 100644 time/tst-cpuclock1-time64.c create mode 100644 time/tst-ctime-time64.c create mode 100644 time/tst-difftime-time64.c create mode 100644 time/tst-gmtime-time64.c create mode 100644 time/tst-itimer-time64.c create mode 100644 time/tst-mktime4-time64.c create mode 100644 time/tst-settimeofday-time64.c create mode 100644 time/tst-timegm-time64.c create mode 100644 time/tst-timespec_get-time64.c create mode 100644 time/tst-timespec_getres-time64.c create mode 100644 time/tst-y2039-time64.c diff --git a/Makeconfig b/Makeconfig index c3496452b6..b6357d0b19 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1235,6 +1235,20 @@ $(common-objpfx)versions.stmp: $(common-objpfx)Versions.all \ touch $@ endif # avoid-generated endif # $(build-shared) = yes + +-include $(common-objpfx)time64-compat.mk +postclean-generated += time64-compat.mk + +$(common-objpfx)time64-compat.mk: $(sysd-versions-force) \ + $(common-objpfx)time64-compat.i + sed '/^[ ]*#/d;/^[ ]*$$/d' $< > $@T + mv -f $@T $@ +$(common-objpfx)time64-compat.i: $(..)Makeconfig + printf "#include \n#ifdef TIME64_NON_DEFAULT\nhave-time64-compat = yes\n#endif" \ + | $(CC) -E -undef $(CPPFLAGS) -x assembler-with-cpp - > $@T + mv -f $@T $@ + + endif # sysd-sorted-done # The name under which the run-time dynamic linker is installed. diff --git a/Makerules b/Makerules index ca9885436e..12f1a5cb50 100644 --- a/Makerules +++ b/Makerules @@ -771,7 +771,8 @@ endif $(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \ $(patsubst %.oS,%.d,$(filter %.oS,$(extra-objs))) \ $(patsubst %.o,%.d,$(filter %.o,$(extra-test-objs:.os=.o))) \ - $(addsuffix .d,$(tests) $(tests-internal) $(xtests) $(test-srcs)) + $(addsuffix .d,$(tests) $(tests-internal) $(xtests) \ + $(test-srcs) $(tests-time64) $(xtests-time64)) ifeq ($(build-programs),yes) +depfiles += $(addsuffix .d,$(others) $(sysdep-others)) endif @@ -1286,6 +1287,21 @@ check: tests .PHONY: xcheck xcheck: xtests +# Handle tests-time64 and xtests-time64 that should built with LFS +# and 64-bit time support. +include $(o-iterator) +define o-iterator-doit +$(foreach f,$(tests-time64) $(xtests-time64),\ + $(objpfx)$(f)$(o)): CFLAGS += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 +endef +object-suffixes-left := $(all-object-suffixes) +include $(o-iterator) + +ifeq ($(have-time64-compat),yes) +tests += $(foreach t,$(tests-time64),$(t)) +xtests += $(foreach t,$(xtests-time64),$(t)) +endif + # The only difference between MODULE_NAME=testsuite and MODULE_NAME=nonlib is # that almost all internal declarations from config.h, libc-symbols.h, and # include/*.h are not available to 'testsuite' code, but are to 'nonlib' code. diff --git a/io/Makefile b/io/Makefile index d35e966258..ba8bd37355 100644 --- a/io/Makefile +++ b/io/Makefile @@ -59,7 +59,7 @@ routines := \ ftw64-time64 others := pwd -test-srcs := ftwtest +test-srcs := ftwtest ftwtest-time64 tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 tst-statvfs \ tst-openat tst-unlinkat tst-fstatat tst-futimesat \ @@ -78,12 +78,24 @@ tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ tst-futimens \ tst-utimensat \ +tests-time64 := \ + tst-futimens-time64 \ + tst-futimes-time64\ + tst-fts-time64 \ + tst-lutimes-time64 \ + tst-stat-time64 \ + tst-futimesat-time64 \ + tst-utime-time64 \ + tst-utimensat-time64 \ + tst-utimes-time64 \ + # Likewise for statx, but we do not need static linking here. tests-internal += tst-statx tests-static += tst-statx ifeq ($(run-built-tests),yes) -tests-special += $(objpfx)ftwtest.out +tests-special += $(objpfx)ftwtest.out \ + $(objpfx)ftwtest-time64.out endif include ../Rules @@ -125,8 +137,14 @@ tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp tst-open-tmpfile-ARGS = --test-dir=$(objpfx) +CFLAGS-ftwtest-time64.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 + ifeq ($(run-built-tests),yes) $(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \ $(evaluate-test) + +$(objpfx)ftwtest-time64.out: ftwtest-sh $(objpfx)ftwtest-time64 + $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \ + $(evaluate-test) endif diff --git a/io/ftwtest-time64.c b/io/ftwtest-time64.c new file mode 100644 index 0000000000..67f1c46826 --- /dev/null +++ b/io/ftwtest-time64.c @@ -0,0 +1 @@ +#include "ftwtest.c" diff --git a/io/tst-fts-time64.c b/io/tst-fts-time64.c new file mode 100644 index 0000000000..a4a41fe1cf --- /dev/null +++ b/io/tst-fts-time64.c @@ -0,0 +1 @@ +#include "tst-fts.c" diff --git a/io/tst-futimens-time64.c b/io/tst-futimens-time64.c new file mode 100644 index 0000000000..88fcb38489 --- /dev/null +++ b/io/tst-futimens-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-futimens.c" diff --git a/io/tst-futimens.c b/io/tst-futimens.c index b3e3f3137f..4c18ede573 100644 --- a/io/tst-futimens.c +++ b/io/tst-futimens.c @@ -20,13 +20,17 @@ #include #include +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + static int test_futimens_helper (const char *file, int fd, const struct timespec *ts) { int result = futimens (fd, ts); TEST_VERIFY_EXIT (result == 0); - struct stat64 st; + struct_stat st; xfstat (fd, &st); /* Check if seconds for atime match */ diff --git a/io/tst-futimes-time64.c b/io/tst-futimes-time64.c new file mode 100644 index 0000000000..d489c265d1 --- /dev/null +++ b/io/tst-futimes-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-futimes.c" diff --git a/io/tst-futimes.c b/io/tst-futimes.c index bdef38d7cb..9575a4b08e 100644 --- a/io/tst-futimes.c +++ b/io/tst-futimes.c @@ -21,13 +21,17 @@ #include #include +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + 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; + struct_stat st; xfstat (fd, &st); /* Check if seconds for atime match */ diff --git a/io/tst-futimesat-time64.c b/io/tst-futimesat-time64.c new file mode 100644 index 0000000000..f6c0500eef --- /dev/null +++ b/io/tst-futimesat-time64.c @@ -0,0 +1,4 @@ +#define struct_stat struct stat +#define fstat fstat +#define fstatat fstatat +#include "io/tst-futimesat.c" diff --git a/io/tst-futimesat.c b/io/tst-futimesat.c index af58ad06dd..c32ab2b668 100644 --- a/io/tst-futimesat.c +++ b/io/tst-futimesat.c @@ -1,4 +1,23 @@ +/* futimesat basic tests. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + #include +#include #include #include #include @@ -7,19 +26,19 @@ #include #include +#include +#include -static void prepare (void); -#define PREPARE(argc, argv) prepare () - -static int do_test (void); -#define TEST_FUNCTION do_test () - -#include "../test-skeleton.c" +#ifndef struct_stat +# define struct_stat struct stat64 +# define fstat fstat64 +# define fstatat fstatat64 +#endif static int dir_fd; static void -prepare (void) +prepare (int argc, char *argv[]) { size_t test_dir_len = strlen (test_dir); static const char dir_name[] = "/tst-futimesat.XXXXXX"; @@ -48,7 +67,7 @@ prepare (void) exit (1); } } - +#define PREPARE prepare static int do_test (void) @@ -98,8 +117,8 @@ do_test (void) write (fd, "hello", 5); puts ("file created"); - struct stat64 st1; - if (fstat64 (fd, &st1) != 0) + struct_stat st1; + if (fstat (fd, &st1) != 0) { puts ("fstat64 failed"); return 1; @@ -118,8 +137,8 @@ do_test (void) return 1; } - struct stat64 st2; - if (fstatat64 (dir_fd, "some-file", &st2, 0) != 0) + struct_stat st2; + if (fstatat (dir_fd, "some-file", &st2, 0) != 0) { puts ("fstatat64 failed"); return 1; @@ -146,3 +165,5 @@ do_test (void) return 0; } + +#include diff --git a/io/tst-lutimes-time64.c b/io/tst-lutimes-time64.c new file mode 100644 index 0000000000..06caec0a91 --- /dev/null +++ b/io/tst-lutimes-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-lutimes.c" diff --git a/io/tst-lutimes.c b/io/tst-lutimes.c index b2da3c5796..237a870415 100644 --- a/io/tst-lutimes.c +++ b/io/tst-lutimes.c @@ -21,23 +21,27 @@ #include #include +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + static int test_lutimes_helper (const char *testfile, int fd, const char *testlink, const struct timeval *tv) { - struct stat64 stfile_orig; + struct_stat stfile_orig; xlstat (testfile, &stfile_orig); TEST_VERIFY_EXIT (lutimes (testlink, tv) == 0); - struct stat64 stlink; + struct_stat stlink; xlstat (testlink, &stlink); TEST_COMPARE (stlink.st_atime, tv[0].tv_sec); TEST_COMPARE (stlink.st_mtime, tv[1].tv_sec); /* Check if the timestamp from original file is not changed. */ - struct stat64 stfile; + struct_stat stfile; xlstat (testfile, &stfile); TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime); diff --git a/io/tst-stat-time64.c b/io/tst-stat-time64.c new file mode 100644 index 0000000000..8feded56d5 --- /dev/null +++ b/io/tst-stat-time64.c @@ -0,0 +1,102 @@ +/* Basic test of stat with 64-bit time_t interfaces. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* The idea of the test is check whether the 64-bit time_t stat implementation + returns the expected value for comparable fields, so it does not really + matter whether statx uses a fallback implementation or not. */ + +static void +stat_check (int fd, const char *path, struct stat *st) +{ + TEST_COMPARE (stat (path, st), 0); +} + +static void +lstat_check (int fd, const char *path, struct stat *st) +{ + TEST_COMPARE (lstat (path, st), 0); +} + +static void +fstat_check (int fd, const char *path, struct stat *st) +{ + TEST_COMPARE (fstat (fd, st), 0); +} + +static void +fstatat_check (int fd, const char *path, struct stat *st) +{ + TEST_COMPARE (fstatat (fd, path, st, 0), 0); +} + +typedef void (*test_t)(int, const char *path, struct stat *); + +static int +do_test (void) +{ + char *path; + int fd = create_temp_file ("tst-statx-", &path); + TEST_VERIFY_EXIT (fd >= 0); + support_write_file_string (path, "abc"); + + struct statx stx; + TEST_COMPARE (statx (fd, path, 0, STATX_BASIC_STATS, &stx), 0); + + for (test_t *test = (test_t[]) { stat_check, lstat_check, fstat_check, + fstatat_check, NULL }; + *test != NULL; test++) + { + struct stat st; + (*test) (fd, path, &st); + + TEST_COMPARE (stx.stx_dev_major, major (st.st_dev)); + TEST_COMPARE (stx.stx_dev_minor, minor (st.st_dev)); + TEST_COMPARE (stx.stx_ino, st.st_ino); + TEST_COMPARE (stx.stx_mode, st.st_mode); + TEST_COMPARE (stx.stx_nlink, st.st_nlink); + TEST_COMPARE (stx.stx_uid, st.st_uid); + TEST_COMPARE (stx.stx_gid, st.st_gid); + TEST_COMPARE (stx.stx_rdev_major, major (st.st_rdev)); + TEST_COMPARE (stx.stx_rdev_minor, minor (st.st_rdev)); + TEST_COMPARE (stx.stx_blksize, st.st_blksize); + TEST_COMPARE (stx.stx_blocks, st.st_blocks); + + TEST_COMPARE (stx.stx_ctime.tv_sec, st.st_ctim.tv_sec); + TEST_COMPARE (stx.stx_ctime.tv_nsec, st.st_ctim.tv_nsec); + TEST_COMPARE (stx.stx_mtime.tv_sec, st.st_mtim.tv_sec); + TEST_COMPARE (stx.stx_mtime.tv_nsec, st.st_mtim.tv_nsec); + } + + xclose (fd); + free (path); + + return 0; +} + +#include diff --git a/io/tst-utime-time64.c b/io/tst-utime-time64.c new file mode 100644 index 0000000000..eb62f59126 --- /dev/null +++ b/io/tst-utime-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-utime.c" diff --git a/io/tst-utime.c b/io/tst-utime.c index 6269ef7929..0144e2a22a 100644 --- a/io/tst-utime.c +++ b/io/tst-utime.c @@ -21,13 +21,17 @@ #include #include +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + static int test_utime_helper (const char *file, int fd, const struct utimbuf *ut) { int result = utime (file, ut); TEST_VERIFY_EXIT (result == 0); - struct stat64 st; + struct_stat st; xfstat (fd, &st); /* Check if seconds for actime match */ diff --git a/io/tst-utimensat-time64.c b/io/tst-utimensat-time64.c new file mode 100644 index 0000000000..7ac7d8df1d --- /dev/null +++ b/io/tst-utimensat-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-utimensat.c" diff --git a/io/tst-utimensat.c b/io/tst-utimensat.c index 0c7c8470bc..062abdd8d3 100644 --- a/io/tst-utimensat.c +++ b/io/tst-utimensat.c @@ -22,6 +22,10 @@ #include #include +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + static int test_utimesat_helper (const char *testfile, int fd, const char *testlink, const struct timespec *ts) @@ -29,7 +33,7 @@ test_utimesat_helper (const char *testfile, int fd, const char *testlink, { TEST_VERIFY_EXIT (utimensat (fd, testfile, ts, 0) == 0); - struct stat64 st; + struct_stat st; xfstat (fd, &st); /* Check if seconds for atime match */ @@ -40,20 +44,20 @@ test_utimesat_helper (const char *testfile, int fd, const char *testlink, } { - struct stat64 stfile_orig; + struct_stat stfile_orig; xlstat (testfile, &stfile_orig); TEST_VERIFY_EXIT (utimensat (0 /* ignored */, testlink, ts, AT_SYMLINK_NOFOLLOW) == 0); - struct stat64 stlink; + struct_stat stlink; xlstat (testlink, &stlink); TEST_COMPARE (stlink.st_atime, ts[0].tv_sec); TEST_COMPARE (stlink.st_mtime, ts[1].tv_sec); /* Check if the timestamp from original file is not changed. */ - struct stat64 stfile; + struct_stat stfile; xlstat (testfile, &stfile); TEST_COMPARE (stfile_orig.st_atime, stfile.st_atime); diff --git a/io/tst-utimes-time64.c b/io/tst-utimes-time64.c new file mode 100644 index 0000000000..234ec02541 --- /dev/null +++ b/io/tst-utimes-time64.c @@ -0,0 +1,2 @@ +#define struct_stat struct stat +#include "tst-utimes.c" diff --git a/io/tst-utimes.c b/io/tst-utimes.c index 991ab0c7d3..e88efff45b 100644 --- a/io/tst-utimes.c +++ b/io/tst-utimes.c @@ -22,13 +22,17 @@ #include #include +#ifndef struct_stat +# define struct_stat struct stat64 +#endif + static int test_utimes_helper (const char *file, int fd, const struct timeval *tv) { int result = utimes (file, tv); TEST_VERIFY_EXIT (result == 0); - struct stat64 st; + struct_stat st; xfstat (fd, &st); /* Check if seconds for atime match */ diff --git a/misc/Makefile b/misc/Makefile index c103b6bff4..f34ab09fe3 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -90,6 +90,10 @@ tests := tst-dirname tst-tsearch tst-fdset tst-mntent tst-hsearch \ tst-ldbl-warn tst-ldbl-error tst-dbl-efgcvt tst-ldbl-efgcvt \ tst-mntent-autofs tst-syscalls tst-mntent-escape tst-select +tests-time64 := \ + tst-select-time64 \ + tst-pselect-time64 + # Tests which need libdl. ifeq (yes,$(build-shared)) tests += tst-gethostid diff --git a/misc/tst-pselect-time64.c b/misc/tst-pselect-time64.c new file mode 100644 index 0000000000..15a1e49292 --- /dev/null +++ b/misc/tst-pselect-time64.c @@ -0,0 +1 @@ +#include "tst-pselect.c" diff --git a/misc/tst-select-time64.c b/misc/tst-select-time64.c new file mode 100644 index 0000000000..13120bfe31 --- /dev/null +++ b/misc/tst-select-time64.c @@ -0,0 +1 @@ +#include "tst-select.c" diff --git a/nptl/Makefile b/nptl/Makefile index f7d7a2c7e2..727761e610 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -324,6 +324,9 @@ xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \ tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 tst-setgroups \ tst-mutexpp5 tst-mutexpp9 +tests-time64 := \ + tst-cancel4_2-time64 + # This test can run into task limits because of a linux kernel bug # and then cause the make process to fail too, see bug 24537. xtests += tst-eintr1 diff --git a/nptl/tst-cancel4_2-time64.c b/nptl/tst-cancel4_2-time64.c new file mode 100644 index 0000000000..4ac086a312 --- /dev/null +++ b/nptl/tst-cancel4_2-time64.c @@ -0,0 +1 @@ +#include "tst-cancel4_2.c" diff --git a/posix/Makefile b/posix/Makefile index c8c538fcee..8d139e54f6 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -122,7 +122,9 @@ endif tests-internal := bug-regex5 bug-regex20 bug-regex33 \ tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 tests-container := bug-ga2 +tests-time64 := tst-wait4-time64 tst-wait3-time64 tst-gnuglob64-time64 xtests := tst-getaddrinfo4 tst-getaddrinfo5 tst-sched_rr_get_interval +xtests-time64 := tst-sched_rr_get_interval-time64 ifeq (yes,$(build-shared)) test-srcs := globtest tests += wordexp-test tst-exec tst-spawn tst-spawn2 tst-spawn3 diff --git a/posix/tst-gnuglob64-time64.c b/posix/tst-gnuglob64-time64.c new file mode 100644 index 0000000000..00922bcdc6 --- /dev/null +++ b/posix/tst-gnuglob64-time64.c @@ -0,0 +1,7 @@ +#define GLOB_FUNC glob +#define GLOB_TYPE glob_t +#define GLOBFREE_FUNC globfree +#define DIRENT_STRUCT dirent +#define STAT_STRUCT stat + +#include "tst-gnuglob-skeleton.c" diff --git a/posix/tst-sched_rr_get_interval-time64.c b/posix/tst-sched_rr_get_interval-time64.c new file mode 100644 index 0000000000..f4e66d2939 --- /dev/null +++ b/posix/tst-sched_rr_get_interval-time64.c @@ -0,0 +1 @@ +#include "tst-sched_rr_get_interval.c" diff --git a/posix/tst-wait3-time64.c b/posix/tst-wait3-time64.c new file mode 100644 index 0000000000..2837bc7a9e --- /dev/null +++ b/posix/tst-wait3-time64.c @@ -0,0 +1 @@ +#include "tst-wait3.c" diff --git a/posix/tst-wait4-time64.c b/posix/tst-wait4-time64.c new file mode 100644 index 0000000000..12543b270f --- /dev/null +++ b/posix/tst-wait4-time64.c @@ -0,0 +1 @@ +#include "tst-wait4.c" diff --git a/rt/Makefile b/rt/Makefile index 97c9bbd9de..797f2da51e 100644 --- a/rt/Makefile +++ b/rt/Makefile @@ -51,6 +51,15 @@ tests := tst-shm tst-timer tst-timer2 \ tst-shm-cancel tests-internal := tst-timer-sigmask +tests-time64 := \ + tst-aio6-time64 \ + tst-cpuclock2-time64 \ + tst-mqueue1-time64 \ + tst-mqueue2-time64 \ + tst-mqueue4-time64 \ + tst-mqueue8-time64 \ + tst-timer4-time64 + extra-libs := librt extra-libs-others := $(extra-libs) diff --git a/rt/tst-aio6-time64.c b/rt/tst-aio6-time64.c new file mode 100644 index 0000000000..a386a577ec --- /dev/null +++ b/rt/tst-aio6-time64.c @@ -0,0 +1 @@ +#include "tst-aio6.c" diff --git a/rt/tst-cpuclock2-time64.c b/rt/tst-cpuclock2-time64.c new file mode 100644 index 0000000000..05775522bb --- /dev/null +++ b/rt/tst-cpuclock2-time64.c @@ -0,0 +1 @@ +#include "tst-cpuclock2.c" diff --git a/rt/tst-cpuclock2.c b/rt/tst-cpuclock2.c index c1c7ed2ad8..eebc3609d0 100644 --- a/rt/tst-cpuclock2.c +++ b/rt/tst-cpuclock2.c @@ -21,7 +21,11 @@ #if (_POSIX_THREADS - 0) <= 0 -# define TEST_FUNCTION 0 +static int +do_test () +{ + return 0; +} #else @@ -330,7 +334,6 @@ do_test (void) return result; } -# define TEST_FUNCTION do_test () #endif -#include "../test-skeleton.c" +#include diff --git a/rt/tst-mqueue1-time64.c b/rt/tst-mqueue1-time64.c new file mode 100644 index 0000000000..9c600a9a97 --- /dev/null +++ b/rt/tst-mqueue1-time64.c @@ -0,0 +1 @@ +#include "tst-mqueue1.c" diff --git a/rt/tst-mqueue2-time64.c b/rt/tst-mqueue2-time64.c new file mode 100644 index 0000000000..9d49f0b196 --- /dev/null +++ b/rt/tst-mqueue2-time64.c @@ -0,0 +1 @@ +#include "tst-mqueue2.c" diff --git a/rt/tst-mqueue4-time64.c b/rt/tst-mqueue4-time64.c new file mode 100644 index 0000000000..c23a228dc4 --- /dev/null +++ b/rt/tst-mqueue4-time64.c @@ -0,0 +1 @@ +#include "tst-mqueue4.c" diff --git a/rt/tst-mqueue8-time64.c b/rt/tst-mqueue8-time64.c new file mode 100644 index 0000000000..972637f7f5 --- /dev/null +++ b/rt/tst-mqueue8-time64.c @@ -0,0 +1 @@ +#include "tst-mqueue8.c" diff --git a/rt/tst-timer4-time64.c b/rt/tst-timer4-time64.c new file mode 100644 index 0000000000..e47a593f10 --- /dev/null +++ b/rt/tst-timer4-time64.c @@ -0,0 +1 @@ +#include "tst-timer4.c" diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile index e4690a7bc4..9e6ed3c6f7 100644 --- a/sysdeps/pthread/Makefile +++ b/sysdeps/pthread/Makefile @@ -124,6 +124,16 @@ tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \ tst-unwind-thread \ tst-pt-vfork1 tst-pt-vfork2 tst-vfork1x tst-vfork2x \ +tests-time64 := \ + tst-abstime-time64 \ + tst-cnd-timedwait-time64 \ + tst-cond11-time64 \ + tst-join14-time64 \ + tst-mtx-timedlock-time64 \ + tst-rwlock14-time64 \ + tst-sem5-time64 \ + tst-thrd-sleep-time64 \ + # Files which must not be linked with libpthread. tests-nolibpthread += tst-unload diff --git a/sysdeps/pthread/tst-abstime-time64.c b/sysdeps/pthread/tst-abstime-time64.c new file mode 100644 index 0000000000..2fc77cb365 --- /dev/null +++ b/sysdeps/pthread/tst-abstime-time64.c @@ -0,0 +1 @@ +#include "tst-abstime.c" diff --git a/sysdeps/pthread/tst-cnd-timedwait-time64.c b/sysdeps/pthread/tst-cnd-timedwait-time64.c new file mode 100644 index 0000000000..9b2abfd277 --- /dev/null +++ b/sysdeps/pthread/tst-cnd-timedwait-time64.c @@ -0,0 +1 @@ +#include "tst-cnd-timedwait.c" diff --git a/sysdeps/pthread/tst-cond11-time64.c b/sysdeps/pthread/tst-cond11-time64.c new file mode 100644 index 0000000000..9bccb8ec8b --- /dev/null +++ b/sysdeps/pthread/tst-cond11-time64.c @@ -0,0 +1 @@ +#include "tst-cond11.c" diff --git a/sysdeps/pthread/tst-join14-time64.c b/sysdeps/pthread/tst-join14-time64.c new file mode 100644 index 0000000000..bed784ee24 --- /dev/null +++ b/sysdeps/pthread/tst-join14-time64.c @@ -0,0 +1 @@ +#include "tst-join14.c" diff --git a/sysdeps/pthread/tst-mtx-timedlock-time64.c b/sysdeps/pthread/tst-mtx-timedlock-time64.c new file mode 100644 index 0000000000..b3393c99ef --- /dev/null +++ b/sysdeps/pthread/tst-mtx-timedlock-time64.c @@ -0,0 +1 @@ +#include "tst-mtx-timedlock.c" diff --git a/sysdeps/pthread/tst-rwlock14-time64.c b/sysdeps/pthread/tst-rwlock14-time64.c new file mode 100644 index 0000000000..ae9b1912cf --- /dev/null +++ b/sysdeps/pthread/tst-rwlock14-time64.c @@ -0,0 +1 @@ +#include "tst-rwlock14.c" diff --git a/sysdeps/pthread/tst-sem5-time64.c b/sysdeps/pthread/tst-sem5-time64.c new file mode 100644 index 0000000000..89c2a14f94 --- /dev/null +++ b/sysdeps/pthread/tst-sem5-time64.c @@ -0,0 +1 @@ +#include "tst-sem5.c" diff --git a/sysdeps/pthread/tst-thrd-sleep-time64.c b/sysdeps/pthread/tst-thrd-sleep-time64.c new file mode 100644 index 0000000000..02837bd19f --- /dev/null +++ b/sysdeps/pthread/tst-thrd-sleep-time64.c @@ -0,0 +1 @@ +#include "tst-thrd-sleep.c" diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index aedd02fd55..294c366e3b 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -125,6 +125,16 @@ endif tests-internal += tst-sigcontext-get_pc +tests-time64 += \ + tst-adjtimex-time64 \ + tst-clock_adjtime-time64 \ + tst-ntp_adjtime-time64 \ + tst-ntp_gettime-time64 \ + tst-ntp_gettimex-time64 \ + tst-ppoll-time64 \ + tst-sigtimedwait-time64 \ + tst-timerfd-time64 \ + CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables # Generate the list of SYS_* macros for the system calls (__NR_* diff --git a/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c b/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c new file mode 100644 index 0000000000..2b6988b7c4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-adjtimex-time64.c @@ -0,0 +1 @@ +#include "tst-adjtimex.c" diff --git a/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c b/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c new file mode 100644 index 0000000000..9691e81229 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-clock_adjtime-time64.c @@ -0,0 +1 @@ +#include "tst-clock_adjtime.c" diff --git a/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c b/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c new file mode 100644 index 0000000000..30e7380b02 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-ntp_adjtime-time64.c @@ -0,0 +1 @@ +#include "tst-ntp_adjtime.c" diff --git a/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c b/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c new file mode 100644 index 0000000000..42caa66301 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-ntp_gettime-time64.c @@ -0,0 +1 @@ +#include "tst-ntp_gettime.c" diff --git a/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c b/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c new file mode 100644 index 0000000000..3f017b3c22 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-ntp_gettimex-time64.c @@ -0,0 +1 @@ +#include "tst-ntp_gettimex.c" diff --git a/sysdeps/unix/sysv/linux/tst-ppoll-time64.c b/sysdeps/unix/sysv/linux/tst-ppoll-time64.c new file mode 100644 index 0000000000..96ee2faee3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-ppoll-time64.c @@ -0,0 +1 @@ +#include "tst-ppoll.c" diff --git a/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c b/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c new file mode 100644 index 0000000000..1513e81749 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-sigtimedwait-time64.c @@ -0,0 +1 @@ +#include "tst-sigtimedwait.c" diff --git a/sysdeps/unix/sysv/linux/tst-timerfd-time64.c b/sysdeps/unix/sysv/linux/tst-timerfd-time64.c new file mode 100644 index 0000000000..bb17f48139 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-timerfd-time64.c @@ -0,0 +1 @@ +#include "tst-timerfd.c" diff --git a/sysvipc/Makefile b/sysvipc/Makefile index a534791928..86911803b5 100644 --- a/sysvipc/Makefile +++ b/sysvipc/Makefile @@ -32,6 +32,8 @@ routines := ftok \ tests := test-sysvmsg test-sysvsem test-sysvshm +tests-time64 := test-sysvmsg-time64 test-sysvsem-time64 test-sysvshm-time64 + include ../Rules CFLAGS-msgrcv.c += -fexceptions -fasynchronous-unwind-tables diff --git a/sysvipc/test-sysvmsg-time64.c b/sysvipc/test-sysvmsg-time64.c new file mode 100644 index 0000000000..c23e0c337e --- /dev/null +++ b/sysvipc/test-sysvmsg-time64.c @@ -0,0 +1 @@ +#include "test-sysvmsg.c" diff --git a/sysvipc/test-sysvsem-time64.c b/sysvipc/test-sysvsem-time64.c new file mode 100644 index 0000000000..05c95068cd --- /dev/null +++ b/sysvipc/test-sysvsem-time64.c @@ -0,0 +1 @@ +#include "test-sysvsem.c" diff --git a/sysvipc/test-sysvshm-time64.c b/sysvipc/test-sysvshm-time64.c new file mode 100644 index 0000000000..8e2963f563 --- /dev/null +++ b/sysvipc/test-sysvshm-time64.c @@ -0,0 +1 @@ +#include "test-sysvshm.c" diff --git a/time/Makefile b/time/Makefile index 805c79c4d0..c84bd5d3ec 100644 --- a/time/Makefile +++ b/time/Makefile @@ -52,6 +52,24 @@ tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \ tst-settimeofday tst-itimer tst-gmtime tst-timegm \ tst-timespec_get tst-timespec_getres +tests-time64 := \ + tst-adjtime-time64 \ + tst-clock-time64 \ + tst-clock2-time64 \ + tst-clock_nanosleep-time64 \ + tst-clock_settime-time64 \ + tst-cpuclock1-time64 \ + tst-ctime-time64 \ + tst-difftime-time64 \ + tst-gmtime-time64 \ + tst-itimer-time64 \ + tst-mktime4-time64 \ + tst-settimeofday-time64 \ + tst-timegm-time64 \ + tst-timespec_get-time64 \ + tst-timespec_getres-time64 \ + tst-y2039-time64 + include ../Rules ifeq ($(run-built-tests),yes) diff --git a/time/tst-adjtime-time64.c b/time/tst-adjtime-time64.c new file mode 100644 index 0000000000..097d6efc4b --- /dev/null +++ b/time/tst-adjtime-time64.c @@ -0,0 +1 @@ +#include diff --git a/time/tst-clock-time64.c b/time/tst-clock-time64.c new file mode 100644 index 0000000000..a1349678c8 --- /dev/null +++ b/time/tst-clock-time64.c @@ -0,0 +1 @@ +#include "tst-clock.c" diff --git a/time/tst-clock2-time64.c b/time/tst-clock2-time64.c new file mode 100644 index 0000000000..897f47b287 --- /dev/null +++ b/time/tst-clock2-time64.c @@ -0,0 +1 @@ +#include "tst-clock2.c" diff --git a/time/tst-clock_nanosleep-time64.c b/time/tst-clock_nanosleep-time64.c new file mode 100644 index 0000000000..c8638aa3d2 --- /dev/null +++ b/time/tst-clock_nanosleep-time64.c @@ -0,0 +1 @@ +#include "tst-clock_nanosleep.c" diff --git a/time/tst-clock_settime-time64.c b/time/tst-clock_settime-time64.c new file mode 100644 index 0000000000..328b04a030 --- /dev/null +++ b/time/tst-clock_settime-time64.c @@ -0,0 +1 @@ +#include diff --git a/time/tst-cpuclock1-time64.c b/time/tst-cpuclock1-time64.c new file mode 100644 index 0000000000..5a7ffa27ac --- /dev/null +++ b/time/tst-cpuclock1-time64.c @@ -0,0 +1 @@ +#include "tst-cpuclock1.c" diff --git a/time/tst-ctime-time64.c b/time/tst-ctime-time64.c new file mode 100644 index 0000000000..24a5ae98ed --- /dev/null +++ b/time/tst-ctime-time64.c @@ -0,0 +1 @@ +#include "tst-ctime.c" diff --git a/time/tst-ctime.c b/time/tst-ctime.c index e89a906bf8..884d69bfa0 100644 --- a/time/tst-ctime.c +++ b/time/tst-ctime.c @@ -24,6 +24,7 @@ static int do_test (void) { char *str; + char strb[32]; time_t t; /* Use glibc time zone extension "TZ=:" to to guarantee that UTC @@ -36,11 +37,21 @@ do_test (void) str = ctime (&t); TEST_COMPARE_STRING (str, "Thu Jan 1 00:00:00 1970\n"); + /* Same as before but with ctime_r. */ + str = ctime_r (&t, strb); + TEST_VERIFY (str == strb); + TEST_COMPARE_STRING (str, "Thu Jan 1 00:00:00 1970\n"); + /* Check if the max time value for 32 bit time_t can be converted. */ t = 0x7fffffff; str = ctime (&t); TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n"); + /* Same as before but with ctime_r. */ + str = ctime_r (&t, strb); + TEST_VERIFY (str == strb); + TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:07 2038\n"); + /* Check if we run on port with 32 bit time_t size */ time_t tov; if (__builtin_add_overflow (t, 1, &tov)) @@ -50,6 +61,11 @@ do_test (void) str = ctime (&tov); TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n"); + /* Same as before but with ctime_r. */ + str = ctime_r (&tov, strb); + TEST_VERIFY (str == strb); + TEST_COMPARE_STRING (str, "Tue Jan 19 03:14:08 2038\n"); + return 0; } diff --git a/time/tst-difftime-time64.c b/time/tst-difftime-time64.c new file mode 100644 index 0000000000..751ce6c483 --- /dev/null +++ b/time/tst-difftime-time64.c @@ -0,0 +1 @@ +#include "tst-difftime.c" diff --git a/time/tst-gmtime-time64.c b/time/tst-gmtime-time64.c new file mode 100644 index 0000000000..0df11c1913 --- /dev/null +++ b/time/tst-gmtime-time64.c @@ -0,0 +1 @@ +#include "tst-gmtime.c" diff --git a/time/tst-itimer-time64.c b/time/tst-itimer-time64.c new file mode 100644 index 0000000000..ddd2efa175 --- /dev/null +++ b/time/tst-itimer-time64.c @@ -0,0 +1 @@ +#include