/* Detecting file changes using modification times.
- Copyright (C) 2017-2020 Free Software Foundation, Inc.
+ Copyright (C) 2017-2024 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
void
__file_change_detection_for_stat (struct file_change_detection *file,
- const struct stat64 *st)
+ const struct __stat64_t64 *st)
{
if (S_ISDIR (st->st_mode))
/* Treat as empty file. */
{
file->size = st->st_size;
file->ino = st->st_ino;
- file->mtime = st->st_mtim;
- file->ctime = st->st_ctim;
+ file->mtime = (struct __timespec64) { st->st_mtim.tv_sec,
+ st->st_mtim.tv_nsec };
+ file->ctime = (struct __timespec64) { st->st_ctim.tv_sec,
+ st->st_ctim.tv_nsec };
}
}
libc_hidden_def (__file_change_detection_for_stat)
__file_change_detection_for_path (struct file_change_detection *file,
const char *path)
{
- struct stat64 st;
- if (stat64 (path, &st) != 0)
+ struct __stat64_t64 st;
+ if (__stat64_time64 (path, &st) != 0)
switch (errno)
{
case EACCES:
/* Other errors are fatal. */
return false;
}
- else /* stat64 was successfull. */
+ else /* stat64 was successful. */
{
__file_change_detection_for_stat (file, &st);
return true;
}
else
{
- struct stat64 st;
- if (fstat64 (__fileno (fp), &st) != 0)
+ struct __stat64_t64 st;
+ if (__fstat64_time64 (__fileno (fp), &st) != 0)
/* If we already have a file descriptor, all errors are fatal. */
return false;
else