[uClibc-cvs] uClibc/libc/sysdeps/linux/common xstatconv.h,NONE,1.1 Makefile,1.72,1.73 syscalls.c,1.95,1.96 xstatconv.c,1.1,1.2

Erik Andersen andersen at codepoet.org
Fri Jan 24 11:52:55 UTC 2003


Update of /var/cvs/uClibc/libc/sysdeps/linux/common
In directory winder:/tmp/cvs-serv18668

Modified Files:
	Makefile syscalls.c xstatconv.c 
Added Files:
	xstatconv.h 
Log Message:
I thought it would be smaller to inline since these funcs are small.
Well, not inlining saves 300 bytes, so do that instead. 
 -Erik


--- NEW FILE: xstatconv.h ---
/* 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 at 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);


Index: Makefile
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/Makefile,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- Makefile	23 Jan 2003 17:55:17 -0000	1.72
+++ Makefile	24 Jan 2003 11:52:51 -0000	1.73
@@ -25,7 +25,7 @@
 	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

Index: syscalls.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/syscalls.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- syscalls.c	24 Jan 2003 11:44:03 -0000	1.95
+++ syscalls.c	24 Jan 2003 11:52:51 -0000	1.96
@@ -970,8 +970,7 @@
 #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)
 {
@@ -994,7 +993,7 @@
 #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)
 {
@@ -1017,7 +1016,7 @@
 #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)
 {
@@ -1676,7 +1675,7 @@
 #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)
 {
@@ -1698,7 +1697,7 @@
 #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)
 {
@@ -1720,7 +1719,7 @@
 #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)
 {

Index: xstatconv.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/xstatconv.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- xstatconv.c	24 Jan 2003 11:44:03 -0000	1.1
+++ xstatconv.c	24 Jan 2003 11:52:51 -0000	1.2
@@ -20,7 +20,19 @@
    Modified for uClibc by Erik Andersen <andersen at 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;
@@ -59,7 +71,7 @@
 #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;




More information about the uClibc-cvs mailing list