[uClibc-cvs] uClibc/libc/sysdeps/linux/common getdents64.c,1.1,1.2 syscalls.c,1.97,1.98
Erik Andersen
andersen at codepoet.org
Mon Feb 3 22:00:49 UTC 2003
Update of /var/cvs/uClibc/libc/sysdeps/linux/common
In directory winder:/tmp/cvs-serv18955/libc/sysdeps/linux/common
Modified Files:
getdents64.c syscalls.c
Log Message:
Fixup compile on 2.2.x kernels when UCLIBC_HAS_LFS is enabled
Index: getdents64.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/getdents64.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- getdents64.c 28 Jan 2003 11:06:01 -0000 1.1
+++ getdents64.c 3 Feb 2003 22:00:46 -0000 1.2
@@ -17,9 +17,6 @@
02111-1307 USA. */
#include <features.h>
-
-#ifdef __UCLIBC_HAS_LFS__
-
#include <alloca.h>
#include <assert.h>
#include <errno.h>
@@ -28,11 +25,13 @@
#include <stdint.h>
#include <string.h>
#include <unistd.h>
+#include <sysdep.h>
#include <sys/param.h>
#include <sys/types.h>
-#include <sysdep.h>
#include <sys/syscall.h>
+#if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64
+
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
@@ -103,6 +102,12 @@
kdp = (struct kernel_dirent64 *) (((char *) kdp) + kdp->d_reclen);
}
return (char *) dp - buf;
+}
+#else
+ssize_t __getdents (int fd, char *buf, size_t nbytes);
+ssize_t __getdents64 (int fd, char *buf, size_t nbytes)
+{
+ return(__getdents(fd, buf, nbytes));
}
#endif /* __UCLIBC_HAS_LFS__ */
Index: syscalls.c
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/syscalls.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- syscalls.c 28 Jan 2003 11:06:02 -0000 1.97
+++ syscalls.c 3 Feb 2003 22:00:46 -0000 1.98
@@ -969,7 +969,8 @@
#ifdef L___syscall_stat
#define __NR___syscall_stat __NR_stat
#include <unistd.h>
-#include <sys/stat.h>
+#define _SYS_STAT_H
+#include <bits/stat.h>
#include "xstatconv.h"
_syscall2(int, __syscall_stat, const char *, file_name, struct kernel_stat *, buf);
int stat(const char * file_name, struct stat * buf)
@@ -991,7 +992,8 @@
#ifdef L___syscall_lstat
#define __NR___syscall_lstat __NR_lstat
#include <unistd.h>
-#include <sys/stat.h>
+#define _SYS_STAT_H
+#include <bits/stat.h>
#include <bits/kernel_stat.h>
#include "xstatconv.h"
_syscall2(int, __syscall_lstat, const char *, file_name, struct kernel_stat *, buf);
@@ -1014,7 +1016,8 @@
#ifdef L___syscall_fstat
#define __NR___syscall_fstat __NR_fstat
#include <unistd.h>
-#include <sys/stat.h>
+#define _SYS_STAT_H
+#include <bits/stat.h>
#include <bits/kernel_stat.h>
#include "xstatconv.h"
_syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf);
@@ -1767,10 +1770,10 @@
//#define __NR_fcntl64 221
#ifdef L__fcntl64
#ifdef __UCLIBC_HAS_LFS__
-#ifdef __NR_fcntl64
-#define __NR__fcntl64 __NR_fcntl64
#include <stdarg.h>
#include <fcntl.h>
+#ifdef __NR_fcntl64
+#define __NR__fcntl64 __NR_fcntl64
extern int _fcntl64(int fd, int cmd, long arg);
_syscall3(int, _fcntl64, int, fd, int, cmd, long, arg);
@@ -1787,8 +1790,18 @@
return _fcntl64(fd, command, arg);
}
#else
-extern int __libc_fcntl(int fd, int command, ...);
-weak_alias(__libc_fcntl, fcntl64)
+extern int _fcntl(int fd, int cmd, long arg);
+int fcntl64(int fd, int command, ...)
+{
+ long arg;
+ va_list list;
+
+ va_start(list, command);
+ arg = va_arg(list, long);
+
+ va_end(list);
+ return _fcntl(fd, command, arg);
+}
#endif
#endif
#endif
More information about the uClibc-cvs
mailing list