Well, not inlining saves 300 bytes, so do that instead.
-Erik
cmsg_nxthdr.c longjmp.c open64.c ftruncate64.c \
truncate64.c getrlimit64.c setrlimit64.c creat64.c mmap64.c \
llseek.c pread_write.c _exit.c setuid.c sync.c getdirname.c \
- sendfile64.c
+ sendfile64.c xstatconv.c
ifneq ($(strip $(EXCLUDE_BRK)),y)
CSRC+=sbrk.c
endif
#define __NR___syscall_stat __NR_stat
#include <unistd.h>
#include <sys/stat.h>
-#include <bits/kernel_stat.h>
-#include "xstatconv.c"
+#include "xstatconv.h"
_syscall2(int, __syscall_stat, const char *, file_name, struct kernel_stat *, buf);
int stat(const char * file_name, struct stat * buf)
{
#include <unistd.h>
#include <sys/stat.h>
#include <bits/kernel_stat.h>
-#include "xstatconv.c"
+#include "xstatconv.h"
_syscall2(int, __syscall_lstat, const char *, file_name, struct kernel_stat *, buf);
int lstat(const char * file_name, struct stat * buf)
{
#include <unistd.h>
#include <sys/stat.h>
#include <bits/kernel_stat.h>
-#include "xstatconv.c"
+#include "xstatconv.h"
_syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf);
int fstat(int fd, struct stat * buf)
{
#include <unistd.h>
#include <sys/stat.h>
#include <bits/kernel_stat.h>
-#include "xstatconv.c"
+#include "xstatconv.h"
_syscall2(int, __syscall_stat64, const char *, file_name, struct kernel_stat64 *, buf);
int stat64(const char * file_name, struct stat64 * buf)
{
#include <unistd.h>
#include <sys/stat.h>
#include <bits/kernel_stat.h>
-#include "xstatconv.c"
+#include "xstatconv.h"
_syscall2(int, __syscall_lstat64, const char *, file_name, struct kernel_stat64 *, buf);
int lstat64(const char * file_name, struct stat64 * buf)
{
#include <unistd.h>
#include <sys/stat.h>
#include <bits/kernel_stat.h>
-#include "xstatconv.c"
+#include "xstatconv.h"
_syscall2(int, __syscall_fstat64, int, filedes, struct kernel_stat64 *, buf);
int fstat64(int fd, struct stat64 * buf)
{
Modified for uClibc by Erik Andersen <andersen@codepoet.org>
*/
-static inline void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
+#define _GNU_SOURCE
+#define _LARGEFILE64_SOURCE
+#include <features.h>
+#undef __OPTIMIZE__
+/* We absolutely do _NOT_ want interfaces silently
+ * * * renamed under us or very bad things will happen... */
+#ifdef __USE_FILE_OFFSET64
+# undef __USE_FILE_OFFSET64
+#endif
+#include <sys/stat.h>
+#include "xstatconv.h"
+
+void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
{
/* Convert to current kernel version of `struct stat'. */
buf->st_dev = kbuf->st_dev;
#endif
}
-static inline void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf)
+void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf)
{
/* Convert to current kernel version of `struct stat64'. */
buf->st_dev = kbuf->st_dev;
--- /dev/null
+/* Convert between the kernel's `struct stat' format, and libc's.
+ Copyright (C) 1991,1995,1996,1997,2000,2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA.
+
+ Modified for uClibc by Erik Andersen <andersen@codepoet.org>
+ */
+
+/* Pull in whatever this particular arch's kernel thinks the kernel version of
+ * struct stat should look like. It turns out that each arch has a different
+ * opinion on the subject, and different kernel revs use different names... */
+#include <bits/kernel_stat.h>
+
+extern void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf);
+extern void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf);
+