mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
support: use 64-bit time_t (bug 30111)
Ensure to use 64-bit time_t in the test infrastructure.
This commit is contained in:
parent
db9c100749
commit
3bfdc4e2bc
6 changed files with 22 additions and 8 deletions
|
@ -238,6 +238,24 @@ CFLAGS-support_paths.c = \
|
||||||
CFLAGS-timespec.c += -fexcess-precision=standard
|
CFLAGS-timespec.c += -fexcess-precision=standard
|
||||||
CFLAGS-timespec-time64.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))
|
ifeq (,$(CXX))
|
||||||
LINKS_DSO_PROGRAM = links-dso-program-c
|
LINKS_DSO_PROGRAM = links-dso-program-c
|
||||||
else
|
else
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
License along with the GNU C Library; if not, see
|
License along with the GNU C Library; if not, see
|
||||||
<https://www.gnu.org/licenses/>. */
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#define _FILE_OFFSET_BITS 64
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -29,14 +29,14 @@ static void
|
||||||
callback (void *closure)
|
callback (void *closure)
|
||||||
{
|
{
|
||||||
int *result = closure;
|
int *result = closure;
|
||||||
struct stat64 before;
|
struct stat before;
|
||||||
xstat ("/dev", &before);
|
xstat ("/dev", &before);
|
||||||
if (chroot ("/dev") != 0)
|
if (chroot ("/dev") != 0)
|
||||||
{
|
{
|
||||||
*result = errno;
|
*result = errno;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
struct stat64 after;
|
struct stat after;
|
||||||
xstat ("/", &after);
|
xstat ("/", &after);
|
||||||
TEST_VERIFY (before.st_dev == after.st_dev);
|
TEST_VERIFY (before.st_dev == after.st_dev);
|
||||||
TEST_VERIFY (before.st_ino == after.st_ino);
|
TEST_VERIFY (before.st_ino == after.st_ino);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
void
|
void
|
||||||
support_copy_file (const char *from, const char *to)
|
support_copy_file (const char *from, const char *to)
|
||||||
{
|
{
|
||||||
struct stat64 st;
|
struct stat st;
|
||||||
xstat (from, &st);
|
xstat (from, &st);
|
||||||
int fd_from = xopen (from, O_RDONLY, 0);
|
int fd_from = xopen (from, O_RDONLY, 0);
|
||||||
mode_t mode = st.st_mode & 0777;
|
mode_t mode = st.st_mode & 0777;
|
||||||
|
|
|
@ -40,7 +40,7 @@ support_descriptor_supports_holes (int fd)
|
||||||
block_headroom = 32,
|
block_headroom = 32,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct stat64 st;
|
struct stat st;
|
||||||
xfstat (fd, &st);
|
xfstat (fd, &st);
|
||||||
if (!S_ISREG (st.st_mode))
|
if (!S_ISREG (st.st_mode))
|
||||||
FAIL_EXIT1 ("descriptor %d does not refer to a regular file", fd);
|
FAIL_EXIT1 ("descriptor %d does not refer to a regular file", fd);
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
License along with the GNU C Library; if not, see
|
License along with the GNU C Library; if not, see
|
||||||
<https://www.gnu.org/licenses/>. */
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#define _FILE_OFFSET_BITS 64
|
|
||||||
|
|
||||||
#include <array_length.h>
|
#include <array_length.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
Loading…
Add table
Reference in a new issue