summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/fstatat.c
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2012-12-11 12:51:33 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2013-02-20 13:45:12 +0100
commit82fd359bcccb162d78c3b7fbd572ac074aee98e9 (patch)
treedabe2edd5ad7b5273e1276d9aff712ce7e485462 /libc/sysdeps/linux/common/fstatat.c
parentcb529f08cfe1fd6ca86e13bac5934dc8cf1c6355 (diff)
fstatat{64}: No conversion code is needed for new architectures
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/common/fstatat.c')
-rw-r--r--libc/sysdeps/linux/common/fstatat.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/common/fstatat.c b/libc/sysdeps/linux/common/fstatat.c
index a0bc3cd3a..06c3ab912 100644
--- a/libc/sysdeps/linux/common/fstatat.c
+++ b/libc/sysdeps/linux/common/fstatat.c
@@ -19,12 +19,23 @@
int fstatat(int fd, const char *file, struct stat *buf, int flag)
{
int ret;
+# ifdef __ARCH_HAS_DEPRECATED_SYSCALLS__
struct kernel_stat64 kbuf;
-
ret = INLINE_SYSCALL(fstatat64, 4, fd, file, &kbuf, flag);
if (ret == 0)
__xstat32_conv(&kbuf, buf);
-
+# else
+ ret = INLINE_SYSCALL(fstatat64, 4, fd, file, buf, flag);
+ if (ret == 0) {
+ /* Did we overflow */
+ if (buf->__pad1 || buf->__pad2 || buf->__pad3
+ || buf->__pad4 || buf->__pad5 || buf->__pad6
+ || buf->__pad7) {
+ __set_errno(EOVERFLOW);
+ return -1;
+ }
+ }
+# endif /* __ARCH_HAS_DEPRECATED_SYSCALLS__ */
return ret;
}
#else