]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
posix: Use 64 bit stat for posix_fallocate fallback (BZ# 29207)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 31 May 2022 15:17:20 +0000 (12:17 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 1 Jun 2022 17:16:28 +0000 (14:16 -0300)
This is a missing spot initially from 52a5fe70a2c77935.

Checked on i686-linux-gnu.

(cherry picked from commit 574ba60fc8a7fb35e6216e2fdecc521acab7ffd2)

NEWS
sysdeps/posix/posix_fallocate.c
sysdeps/posix/posix_fallocate64.c

diff --git a/NEWS b/NEWS
index ef700e0e2ccc3b8f3766acdb37d18f3e18159543..6783d18015ecdc9224cbfab83ee550e547c52e96 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,7 @@ The following bugs are resolved with this release:
     failure
   [29203] libc: daemon is not y2038 aware
   [29204] libc: getusershell is not 2038 aware
+  [29207] libc: posix_fallocate fallback implementation is not y2038
 
 \f
 Version 2.35
index 037d328647ff7ebcf72e6d2a6df32f4400872034..9720e71cc66c07d5874dedbbb35059923046259f 100644 (file)
@@ -30,7 +30,7 @@
 int
 posix_fallocate (int fd, __off_t offset, __off_t len)
 {
-  struct stat64 st;
+  struct __stat64_t64 st;
 
   if (offset < 0 || len < 0)
     return EINVAL;
@@ -48,7 +48,7 @@ posix_fallocate (int fd, __off_t offset, __off_t len)
   }
 
   /* We have to make sure that this is really a regular file.  */
-  if (__fstat64 (fd, &st) != 0)
+  if (__fstat64_time64 (fd, &st) != 0)
     return EBADF;
   if (S_ISFIFO (st.st_mode))
     return ESPIPE;
index a670ee0a39e739e54ad42f083d1f381871881eab..bf984f7f91098a671d24324a5e34b23046db073b 100644 (file)
@@ -30,7 +30,7 @@
 int
 __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
 {
-  struct stat64 st;
+  struct __stat64_t64 st;
 
   if (offset < 0 || len < 0)
     return EINVAL;
@@ -48,7 +48,7 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
   }
 
   /* We have to make sure that this is really a regular file.  */
-  if (__fstat64 (fd, &st) != 0)
+  if (__fstat64_time64 (fd, &st) != 0)
     return EBADF;
   if (S_ISFIFO (st.st_mode))
     return ESPIPE;