summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/wordsize-64
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-01-30 09:30:09 +0000
committerJakub Jelinek <jakub@redhat.com>2006-01-30 09:30:09 +0000
commit3e543bc56346540cbf73fd48d0172fc6a588efd5 (patch)
treeb2c3502b6596d238ac861cc82cafdc6f8b84e143 /sysdeps/unix/sysv/linux/wordsize-64
parent06f313e361a523605ba6d4c9cdc67a7353cd367c (diff)
Updated to fedora-glibc-20060130T0922
Diffstat (limited to 'sysdeps/unix/sysv/linux/wordsize-64')
-rw-r--r--sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c b/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
index faa028cf26..0c37495575 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006 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
@@ -28,15 +28,40 @@
#include <sys/stat.h>
#include <sysdep.h>
+#include <kernel-features.h>
#include <sys/syscall.h>
#include <bp-checks.h>
+
/* Get information about the file NAME relative to FD in ST. */
int
__fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
{
- if ((vers != _STAT_VER_KERNEL && vers != _STAT_VER_LINUX)
- || (flag & ~AT_SYMLINK_NOFOLLOW) != 0)
+ if (vers != _STAT_VER_KERNEL && vers != _STAT_VER_LINUX)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ int res;
+
+#ifdef __NR_newfstatat
+# ifndef __ASSUME_ATFCTS
+ if (__have_atfcts >= 0)
+# endif
+ {
+ res = INLINE_SYSCALL (newfstatat, 4, fd, file, st, flag);
+# ifndef __ASSUME_ATFCTS
+ if (res == -1 && errno == ENOSYS)
+ __have_atfcts = -1;
+ else
+# endif
+ return res;
+ }
+#endif
+
+#ifndef __ASSUME_ATFCTS
+ if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
{
__set_errno (EINVAL);
return -1;
@@ -63,7 +88,6 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
}
INTERNAL_SYSCALL_DECL (err);
- int res;
if (flag & AT_SYMLINK_NOFOLLOW)
res = INTERNAL_SYSCALL (lstat, err, 2, file, CHECK_1 (st));
@@ -77,6 +101,8 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
}
return res;
+#endif
}
#undef __fxstatat64
strong_alias (__fxstatat, __fxstatat64);
+strong_alias (__fxstatat64, __GI___fxstatat64)