@@ -25,6 +25,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#ifndef XSTAT_IS_XSTAT64
#include "overflow.h"
/* Get information about the file NAME in BUF. */
@@ -41,3 +42,4 @@ __lxstat (int vers, const char *name, struct stat *buf)
return -1;
}
hidden_def (__lxstat)
+#endif
@@ -15,6 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#define __lxstat __lxstat_disable
#include <errno.h>
#include <stddef.h>
@@ -36,3 +37,9 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf)
return -1;
}
hidden_def (__lxstat64)
+
+#undef __lxstat
+#ifdef XSTAT_IS_XSTAT64
+strong_alias (__lxstat64, __lxstat)
+hidden_ver (__lxstat64, __lxstat)
+#endif
@@ -25,6 +25,7 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#ifndef XSTAT_IS_XSTAT64
#include "overflow.h"
/* Get information about the file NAME in BUF. */
@@ -41,3 +42,4 @@ __xstat (int vers, const char *name, struct stat *buf)
return -1;
}
hidden_def (__xstat)
+#endif
@@ -15,6 +15,7 @@
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
+#define __xstat __xstat_disable
#include <errno.h>
#include <stddef.h>
@@ -36,3 +37,9 @@ __xstat64 (int vers, const char *name, struct stat64 *buf)
return -1;
}
hidden_def (__xstat64)
+
+#undef __xstat
+#ifdef XSTAT_IS_XSTAT64
+strong_alias (__xstat64, __xstat)
+hidden_ver (__xstat64, __xstat)
+#endif
If XSTAT_IS_XSTAT64 is enabled, there's no difference between that syscalls and their 64-bit versions. It also means that struct stat has no pads, and stat_overflow() is not needed. So we can reuse lxstat64 and xstat64. In this patch, syscalls are redirected to their 64-bit versions. At now, the only user of it is aarch64/ilp32 that is under development, but the patch may be applied separately because it's generic. 2016-09-09: Yury Norov <ynorov@caviumnetworks.com> * sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c: don't declare __lxstat() and symbols if XSTAT_IS_XSTAT64 is enabled. * sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c: declare __lxstat symbols if XSTAT_IS_XSTAT64 is enabled. * sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c: don't declare __xstat() and symbols if XSTAT_IS_XSTAT64 is enabled. * sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c: declare __xstat symbols if XSTAT_IS_XSTAT64 is enabled. Signed-off-by: Yury Norov <ynorov@caviumnetworks.com> --- sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c | 2 ++ sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c | 7 +++++++ sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c | 2 ++ sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c | 7 +++++++ 4 files changed, 18 insertions(+)