From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id CA778385840C; Tue, 12 Mar 2024 19:32:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA778385840C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710271948; bh=W4GAANlxT7NASNIsdSgka9qPXaEXkbry8tLlBhzr0CI=; h=From:To:Subject:Date:From; b=GlruoUDbmuKcV4ZxMvGCNN1zHOPo1EFjIHqc7NInR13Gl7NmxOAxPe7OArxmBoRGc C3b16MkI30m9uDt7oH0kUbVctT5uIa3GoF/W4h1F7xxR13l6eaPcmNmPUUOi8VwXeu 7y4eBfHwpBbsANmMnygaBx3F+fvAcyFlpux/WTR4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/release/2.35/master] support: use 64-bit time_t (bug 30111) X-Act-Checkin: glibc X-Git-Author: Andreas Schwab X-Git-Refname: refs/heads/release/2.35/master X-Git-Oldrev: d47c5e4db7924bb10efe14b787c4bd868b604e48 X-Git-Newrev: a24adf3572ad23fc5098d4cc62ff821cff1ef3c5 Message-Id: <20240312193228.CA778385840C@sourceware.org> Date: Tue, 12 Mar 2024 19:32:28 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a24adf3572ad23fc5098d4cc62ff821cff1ef3c5 commit a24adf3572ad23fc5098d4cc62ff821cff1ef3c5 Author: Andreas Schwab Date: Tue Feb 28 10:37:18 2023 -0300 support: use 64-bit time_t (bug 30111) Ensure to use 64-bit time_t in the test infrastructure. (cherry picked from commit 3bfdc4e2bceb601b90c81a9baa73c1904db58b2f) Diff: --- support/Makefile | 18 ++++++++++++++++++ support/shell-container.c | 2 -- support/support_can_chroot.c | 4 ++-- support/support_copy_file.c | 2 +- support/support_descriptor_supports_holes.c | 2 +- support/test-container.c | 2 -- 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/support/Makefile b/support/Makefile index ee62869a55..2658130d82 100644 --- a/support/Makefile +++ b/support/Makefile @@ -238,6 +238,24 @@ 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-delayed_exit.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 +CFLAGS-shell-container.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 +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_process_state.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_subprocess.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 +CFLAGS-xmkdirp.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 +# This is required to get an mkstemp which can create large files on some +# 32-bit platforms. +CFLAGS-temp_file.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 + ifeq (,$(CXX)) LINKS_DSO_PROGRAM = links-dso-program-c else diff --git a/support/shell-container.c b/support/shell-container.c index 6698061b9b..019a6c47d1 100644 --- a/support/shell-container.c +++ b/support/shell-container.c @@ -16,8 +16,6 @@ License along with the GNU C Library; if not, see . */ -#define _FILE_OFFSET_BITS 64 - #include #include #include diff --git a/support/support_can_chroot.c b/support/support_can_chroot.c index ca0e5f7ef4..43979f7c3f 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 9a936b37c7..52ed90fae0 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 d9bcade1cf..83f02f7cf6 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); diff --git a/support/test-container.c b/support/test-container.c index c837c4d758..984be36a03 100644 --- a/support/test-container.c +++ b/support/test-container.c @@ -16,8 +16,6 @@ License along with the GNU C Library; if not, see . */ -#define _FILE_OFFSET_BITS 64 - #include #include #include