1
/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
1
/* Copyright (C) 2005-2012 Free Software Foundation, Inc.
2
2
This file is part of the GNU C Library.
4
4
The GNU C Library is free software; you can redistribute it and/or
30
30
#include <kernel-features.h>
32
#if __ASSUME_STAT64_SYSCALL == 0
33
# include <xstatconv.h>
37
# if __ASSUME_STAT64_SYSCALL == 0
38
/* The variable is shared between all wrappers around *stat64 calls.
39
This is the definition. */
40
extern int __have_no_stat64;
44
32
/* Get information about the file NAME in BUF. */
113
# if __ASSUME_STAT64_SYSCALL > 0
114
101
if (flag & AT_SYMLINK_NOFOLLOW)
115
102
result = INTERNAL_SYSCALL (lstat64, err, 2, CHECK_STRING (file),
120
107
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
122
# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0
109
# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0
123
110
if (st->__st_ino != (__ino_t) st->st_ino)
124
111
st->st_ino = st->__st_ino;
129
struct kernel_stat kst;
131
if (! __have_no_stat64)
133
if (flag & AT_SYMLINK_NOFOLLOW)
134
result = INTERNAL_SYSCALL (lstat64, err, 2, CHECK_STRING (file),
137
result = INTERNAL_SYSCALL (stat64, err, 2, CHECK_STRING (file),
140
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
142
# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0
143
if (st->__st_ino != (__ino_t) st->st_ino)
144
st->st_ino = st->__st_ino;
148
if (INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
151
__have_no_stat64 = 1;
155
if (flag & AT_SYMLINK_NOFOLLOW)
156
result = INTERNAL_SYSCALL (lstat, err, 2, CHECK_STRING (file),
159
result = INTERNAL_SYSCALL (stat, err, 2, CHECK_STRING (file),
162
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
163
return __xstat64_conv (vers, &kst, st);
167
115
__atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);