From patchwork Thu Feb 23 15:55:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 1747014 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=dzEhtMtR; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PMyLJ1hvmz245y for ; Fri, 24 Feb 2023 02:56:08 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 00D343858439 for ; Thu, 23 Feb 2023 15:56:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00D343858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677167763; bh=jM7u9u1aj1UExac5RSGVfos7RftIz2L1/zynrB9Gpx0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dzEhtMtRdooxdA0DHZtZfydgtSiYN9GPUpy8yZrSaOiwnbJVVHLV7ZQf09b4SBYbr Zp4V2VbGQMt/Ozm9j9JCwO/ixswxUOrjj92KH5qzz+FXxd6+QuvozN/Y0h2OifSokO veIj0WwtBNfxt2M530S+mzKLshMqQWS3kWMMVIiY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 615CF385840F for ; Thu, 23 Feb 2023 15:55:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 615CF385840F Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 9B36E2090F for ; Thu, 23 Feb 2023 15:55:47 +0000 (UTC) Received: from hawking.suse.de (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id 8A70A2C141 for ; Thu, 23 Feb 2023 15:55:47 +0000 (UTC) Received: by hawking.suse.de (Postfix, from userid 17005) id F0342442EF3; Thu, 23 Feb 2023 16:55:46 +0100 (CET) To: libc-alpha@sourceware.org Subject: [PATCH] support: use 64-bit time_t (bug 30111) X-Yow: RELATIVES!! Date: Thu, 23 Feb 2023 16:55:46 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Andreas Schwab via Libc-alpha From: Andreas Schwab Reply-To: Andreas Schwab Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Ensure to use 64-bit time_t in the test infrastructure. --- support/Makefile | 10 ++++++++++ support/support_can_chroot.c | 4 ++-- support/support_copy_file.c | 2 +- support/support_descriptor_supports_holes.c | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/support/Makefile b/support/Makefile index b29b7eb505..1df57d10fc 100644 --- a/support/Makefile +++ b/support/Makefile @@ -238,6 +238,16 @@ CFLAGS-support_paths.c = \ CFLAGS-timespec.c += -fexcess-precision=standard CFLAGS-timespec-time64.c += -fexcess-precision=standard +# Ensure that general support files use 64-bit time_t +CFLAGS-support_can_chroot.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 +CFLAGS-support_copy_file.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 +CFLAGS-support_copy_file_range.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 +CFLAGS-support_descriptor_supports_holes.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 +CFLAGS-support_descriptors.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 +CFLAGS-support_stat_nanoseconds.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 +CFLAGS-support_test_main.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 +CFLAGS-test-container.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 + ifeq (,$(CXX)) LINKS_DSO_PROGRAM = links-dso-program-c else diff --git a/support/support_can_chroot.c b/support/support_can_chroot.c index 7d9f91205d..7b4f491b53 100644 --- a/support/support_can_chroot.c +++ b/support/support_can_chroot.c @@ -29,14 +29,14 @@ static void callback (void *closure) { int *result = closure; - struct stat64 before; + struct stat before; xstat ("/dev", &before); if (chroot ("/dev") != 0) { *result = errno; return; } - struct stat64 after; + struct stat after; xstat ("/", &after); TEST_VERIFY (before.st_dev == after.st_dev); TEST_VERIFY (before.st_ino == after.st_ino); diff --git a/support/support_copy_file.c b/support/support_copy_file.c index 50ff87b9f1..f3e0a2d1b7 100644 --- a/support/support_copy_file.c +++ b/support/support_copy_file.c @@ -24,7 +24,7 @@ void support_copy_file (const char *from, const char *to) { - struct stat64 st; + struct stat st; xstat (from, &st); int fd_from = xopen (from, O_RDONLY, 0); mode_t mode = st.st_mode & 0777; diff --git a/support/support_descriptor_supports_holes.c b/support/support_descriptor_supports_holes.c index 7af5934808..91db216bf0 100644 --- a/support/support_descriptor_supports_holes.c +++ b/support/support_descriptor_supports_holes.c @@ -40,7 +40,7 @@ support_descriptor_supports_holes (int fd) block_headroom = 32, }; - struct stat64 st; + struct stat st; xfstat (fd, &st); if (!S_ISREG (st.st_mode)) FAIL_EXIT1 ("descriptor %d does not refer to a regular file", fd);