diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-02-22 00:56:29 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-02-22 00:56:29 +0000 |
commit | 467c76b0c7f5463ab034041e0350926a4c60eeb2 (patch) | |
tree | ea12e026cca18fd364ddc4ef99b100c9632e6b09 /ldso/include/dl-syscall.h | |
parent | deea2d5cfa08046c0901c1ee75d7cc021c4f2deb (diff) |
move _dl_mmap_check_error() to related mmap bits of code as pointed out by Nicolas Bellido
Diffstat (limited to 'ldso/include/dl-syscall.h')
-rw-r--r-- | ldso/include/dl-syscall.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h index 27af703e8..7845ad9de 100644 --- a/ldso/include/dl-syscall.h +++ b/ldso/include/dl-syscall.h @@ -45,18 +45,6 @@ #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 @@ -134,6 +122,12 @@ static inline _syscall2(int, _dl_gettimeofday, struct timeval *, tv, struct time #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 @@ static inline void * _dl_mmap(void * addr, unsigned long size, int prot, } #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 @@ static inline void * _dl_mmap(void * addr, unsigned long size, int prot, 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_ */ |