1 /* vi: set sw=4 ts=4: */
5 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
16 #if defined __NR_fstatat64 && !defined __NR_stat
19 int stat(const char *file_name, struct stat *buf)
21 return fstatat(AT_FDCWD, file_name, buf, 0);
25 # include "xstatconv.h"
27 int stat(const char *file_name, struct stat *buf)
31 /* normal stat call has limited values for various stat elements
32 * e.g. uid device major/minor etc.
33 * so we use 64 variant if available
34 * in order to get newer versions of stat elements
36 struct kernel_stat64 kbuf;
37 result = INLINE_SYSCALL(stat64, 2, file_name, &kbuf);
39 __xstat32_conv(&kbuf, buf);
42 struct kernel_stat kbuf;
44 result = INLINE_SYSCALL(stat, 2, file_name, &kbuf);
46 __xstat_conv(&kbuf, buf);
48 # endif /* __NR_stat64 */
51 #endif /* __NR_fstat64 */
54 #if ! defined __NR_stat64 && ! defined __NR_fstatat64 && \
55 defined __UCLIBC_HAS_LFS__
56 strong_alias_untyped(stat,stat64)
57 libc_hidden_def(stat64)