Module: xenomai-3
Branch: stable-3.0.x
Commit: 8e7aa675267a4d7756cf122914230908a5bf7c68
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8e7aa675267a4d7756cf122914230908a5bf7c68

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sat Apr 15 15:22:55 2017 +0200

lib/cobalt: handle direct mmap64(), open64() wrapping to 32bit versions

---

 lib/cobalt/rtdm.c     |    4 ++++
 lib/cobalt/wrappers.c |    5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/cobalt/rtdm.c b/lib/cobalt/rtdm.c
index 7bdbffd..1907090 100644
--- a/lib/cobalt/rtdm.c
+++ b/lib/cobalt/rtdm.c
@@ -480,7 +480,11 @@ COBALT_IMPL(void *, mmap64, (void *addr, size_t length, 
int prot, int flags,
        }
 
 regular:
+#if mmap64 == mmap
+       return __STD(mmap(addr, length, prot, flags, fd, offset));
+#else
        return __STD(mmap64(addr, length, prot, flags, fd, offset));
+#endif
 }
 
 COBALT_IMPL(void *, mmap, (void *addr, size_t length, int prot, int flags,
diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c
index 5fa313b..8bd9190 100644
--- a/lib/cobalt/wrappers.c
+++ b/lib/cobalt/wrappers.c
@@ -177,7 +177,7 @@ int __real_open(const char *path, int oflag, ...)
        return open(path, oflag, mode);
 }
 
-/* rtdm */
+#if open64 != open
 __weak
 int __real_open64(const char *path, int oflag, ...)
 {
@@ -192,6 +192,7 @@ int __real_open64(const char *path, int oflag, ...)
 
        return open64(path, oflag, mode);
 }
+#endif
 
 __weak
 int __real_socket(int protocol_family, int socket_type, int protocol)
@@ -353,12 +354,14 @@ void *__real_mmap(void *addr, size_t length, int prot, 
int flags,
        return mmap(addr, length, prot, flags, fd, offset);
 }
 
+#if mmap64 != mmap
 __weak
 void *__real_mmap64(void *addr, size_t length, int prot, int flags,
                  int fd, off64_t offset)
 {
        return mmap64(addr, length, prot, flags, fd, offset);
 }
+#endif
 
 __weak
 int __real_vfprintf(FILE *stream, const char *fmt, va_list args)


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to