]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / generic / wordsize-32 / xstat64.c
CommitLineData
688903eb 1/* Copyright (C) 2011-2018 Free Software Foundation, Inc.
a63c7fa1
CM
2 This file is part of the GNU C Library.
3 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
ab84e3ff
PE
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
a63c7fa1 18
a0941175
SE
19/* Hide the prototype for __xstat so that GCC will not complain about
20 the different function signature if it is aliased to __xstat64.
21 If XSTAT_IS_XSTAT64 is set to non-zero then the stat and stat64
22 structures have an identical layout but different type names. */
23
24#define __xstat __xstat_disable
25
a63c7fa1
CM
26#include <errno.h>
27#include <stddef.h>
28#include <fcntl.h>
29#include <sys/stat.h>
30#include <kernel_stat.h>
31
32#include <sysdep.h>
33#include <sys/syscall.h>
34
35/* Get information about the file NAME in BUF. */
36int
37__xstat64 (int vers, const char *name, struct stat64 *buf)
38{
39 if (vers == _STAT_VER_KERNEL)
40 return INLINE_SYSCALL (fstatat64, 4, AT_FDCWD, name, buf, 0);
41
42 errno = EINVAL;
43 return -1;
44}
45hidden_def (__xstat64)
a0941175
SE
46
47#undef __xstat
48#if XSTAT_IS_XSTAT64
49strong_alias (__xstat64, __xstat)
50hidden_ver (__xstat64, __xstat)
51#endif