]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
linux: Remove stat-check.c
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Sun, 7 Feb 2021 18:45:15 +0000 (18:45 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 11 Feb 2021 11:02:16 +0000 (08:02 -0300)
The check is moved to LFS fstatat implementation (since it is the
code that actually implements the syscall).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
sysdeps/unix/sysv/linux/fstatat64.c
sysdeps/unix/sysv/linux/generic/Makefile
sysdeps/unix/sysv/linux/generic/stat-check.c [deleted file]

index ab41f19e94861f3c295fa66696dd235aa88e41e3..490226a8ec645abcdcaae9077677ecf60443ef09 100644 (file)
 #include <kstat_cp.h>
 #include <stat_t64_cp.h>
 
+#if __TIMESIZE == 64 \
+     && (__WORDSIZE == 32 \
+     && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
+/* Sanity check to avoid newer 32-bit ABI to support non-LFS calls.  */
+_Static_assert (sizeof (__off_t) == sizeof (__off64_t),
+                "__blkcnt_t and __blkcnt64_t must match");
+_Static_assert (sizeof (__ino_t) == sizeof (__ino64_t),
+                "__blkcnt_t and __blkcnt64_t must match");
+_Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
+                "__blkcnt_t and __blkcnt64_t must match");
+#endif
+
 int
 __fstatat64_time64 (int fd, const char *file, struct __stat64_t64 *buf,
                    int flag)
index 124f83a0abdd5f8eab8ffd52baaff73b81c70c4c..7e27e7977262031922ba7cec5849033a86f22789 100644 (file)
@@ -1,3 +1,3 @@
 ifeq ($(subdir),misc)
-sysdep_routines += epoll_create inotify_init stat-check
+sysdep_routines += epoll_create inotify_init
 endif
diff --git a/sysdeps/unix/sysv/linux/generic/stat-check.c b/sysdeps/unix/sysv/linux/generic/stat-check.c
deleted file mode 100644 (file)
index e09264d..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Static assert for __blkcnt64_t when __INO_T_MATCHES_INO64_T is defined.
-   Copyright (C) 2019-2021 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
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <sys/stat.h>
-#include <bits/typesizes.h>
-
-/* This is due to the layout code in bits/stat.h and the overflow handling in
-   wordsize-32/overflow.h, requiring either all or none of the three types
-   concerned to have padding.  */
-
-#if defined __INO_T_MATCHES_INO64_T
-_Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
-                "__blkcnt_t and __blkcnt64_t must match");
-#endif