svn commit: trunk/uClibc/ldso/include

vapier at uclibc.org vapier at uclibc.org
Wed Feb 22 00:56:29 UTC 2006


Author: vapier
Date: 2006-02-21 16:56:29 -0800 (Tue, 21 Feb 2006)
New Revision: 14171

Log:
move _dl_mmap_check_error() to related mmap bits of code as pointed out by Nicolas Bellido

Modified:
   trunk/uClibc/ldso/include/dl-syscall.h


Changeset:
Modified: trunk/uClibc/ldso/include/dl-syscall.h
===================================================================
--- trunk/uClibc/ldso/include/dl-syscall.h	2006-02-22 00:51:01 UTC (rev 14170)
+++ trunk/uClibc/ldso/include/dl-syscall.h	2006-02-22 00:56:29 UTC (rev 14171)
@@ -45,20 +45,8 @@
 #define	S_IWRITE	0200	/* Write by owner.  */
 #define	S_IEXEC		0100	/* Execute by owner.  */
 
-/* Stuff for _dl_mmap */
-#if 0
-#define MAP_FAILED	((void *) -1)
-#define _dl_mmap_check_error(X) (((void *)X) == MAP_FAILED)
-#else
-#ifndef _dl_MAX_ERRNO
-#define _dl_MAX_ERRNO 4096
-#endif
-#define _dl_mmap_check_error(__res) \
-	(((long)__res) < 0 && ((long)__res) >= -_dl_MAX_ERRNO)
-#endif
 
 
-
 /* Here are the definitions for some syscalls that are used
    by the dynamic linker.  The idea is that we want to be able
    to call these before the errno symbol is dynamicly linked, so
@@ -134,6 +122,12 @@
 #endif
 
 #ifdef __NR_mmap
+#ifndef _dl_MAX_ERRNO
+# define _dl_MAX_ERRNO 4096
+#endif
+#define _dl_mmap_check_error(__res) \
+	(((long)__res) < 0 && ((long)__res) >= -_dl_MAX_ERRNO)
+
 #ifdef __UCLIBC_MMAP_HAS_6_ARGS__
 #define __NR__dl_mmap __NR_mmap
 static inline _syscall6(void *, _dl_mmap, void *, start, size_t, length,
@@ -157,6 +151,9 @@
 }
 #endif
 #elif defined __NR_mmap2
+
+#define MAP_FAILED	((void *) -1)
+#define _dl_mmap_check_error(X) (((void *)X) == MAP_FAILED)
 #define __NR___syscall_mmap2       __NR_mmap2
 static inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr,
 		size_t, len, int, prot, int, flags, int, fd, off_t, offset);
@@ -171,7 +168,7 @@
 		fd, (off_t) (offset >> MMAP2_PAGE_SHIFT)));
 }
 #else
-#error "Your architecture doesn't seem to provide mmap() !?"
+# error "Your architecture doesn't seem to provide mmap() !?"
 #endif
 
 #endif /* _LD_SYSCALL_H_ */




More information about the uClibc-cvs mailing list