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>
13 #include "xstatconv.h"
15 int fstat(int fd, struct stat *buf)
19 /* normal stat call has limited values for various stat elements
20 * e.g. uid device major/minor etc.
21 * so we use 64 variant if available
22 * in order to get newer versions of stat elements
24 struct kernel_stat64 kbuf;
25 result = INLINE_SYSCALL(fstat64, 2, fd, &kbuf);
27 __xstat32_conv(&kbuf, buf);
30 struct kernel_stat kbuf;
32 result = INLINE_SYSCALL(fstat, 2, fd, &kbuf);
34 __xstat_conv(&kbuf, buf);
39 libc_hidden_def(fstat)
41 #if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__
42 strong_alias_untyped(fstat,fstat64)
43 libc_hidden_def(fstat64)