]> 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 16:34:51 +0000 (13:34 -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 9fde64d55cd3b97c991524cae31beef0b143fa24..627435073718b889d7b2222720cecc5b1d409082 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -103,6 +103,7 @@ The following bugs are resolved with this release:
     AT_SYMLINK_NOFOLLOW
   [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.34
index 0bb379c94d7cf779b1192fefae361398732509fb..4381033d6e16c2e385ebea592e286ff3fa4bfc6b 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 c1e233b49c8d7f37e005dd0f768374b0ce21e5ea..d45b0c17489fbbbb5f6fb3c2e07498fc98f4e614 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;