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 /* need to hide the 64bit prototype or the strong_alias()
11 * will fail when __NR_fstat64 doesnt exist */
12 #define fstat64 __hidefstat64
14 #include <sys/syscall.h>
17 #include "xstatconv.h"
21 /* libc_hidden_proto(fstat) */
23 #define __NR___syscall_fstat __NR_fstat
24 static __inline__ _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf)
26 int fstat(int fd, struct stat *buf)
29 struct kernel_stat kbuf;
31 result = __syscall_fstat(fd, &kbuf);
33 __xstat_conv(&kbuf, buf);
37 libc_hidden_def(fstat)
39 #if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__
40 extern __typeof(fstat) fstat64;
41 libc_hidden_proto(fstat64)
42 strong_alias(fstat,fstat64)
43 libc_hidden_def(fstat64)