Module: xenomai-forge
Branch: next
Commit: bcda9e43a2c6922522369f77ebbdf879527a692b
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=bcda9e43a2c6922522369f77ebbdf879527a692b

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Aug 21 18:06:28 2014 +0200

boilerplate/libc: add placeholders for shm_open(), shm_unlink()

---

 configure                                          |    4 ++-
 configure.ac                                       |    4 ++-
 include/boilerplate/libc.h                         |   16 +++++++++++
 include/xeno_config.h.in                           |    6 ++++
 .../arch/blackfin/include/asm/xenomai/syscall.h    |   15 ----------
 .../arch/nios2/include/asm/xenomai/syscall.h       |   29 --------------------
 6 files changed, 28 insertions(+), 46 deletions(-)

diff --git a/configure b/configure
index 8a71d58..7e767a5 100755
--- a/configure
+++ b/configure
@@ -13758,7 +13758,9 @@ for ac_func in pthread_mutexattr_setprotocol    \
                pthread_atfork                  \
                pthread_setname_np              \
                sched_getcpu                    \
-               clock_nanosleep
+               clock_nanosleep                 \
+               shm_open                        \
+               shm_unlink
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/configure.ac b/configure.ac
index d8f12af..393b2c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -511,7 +511,9 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol       \
                pthread_atfork                  \
                pthread_setname_np              \
                sched_getcpu                    \
-               clock_nanosleep])
+               clock_nanosleep                 \
+               shm_open                        \
+               shm_unlink])
 LIBS="$save_LIBS"
 
 dnl If we can't set the clock for condvar timeouts, then
diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h
index 9379124..b74c292 100644
--- a/include/boilerplate/libc.h
+++ b/include/boilerplate/libc.h
@@ -154,6 +154,22 @@ __weak inline int sched_getcpu(void)
 }
 #endif /* !HAVE_SCHED_GETCPU */
 
+#ifndef HAVE_SHM_OPEN
+__weak inline int shm_open(const char *name, int oflag, mode_t mode)
+{
+       errno = ENOSYS;
+       return -1;
+}
+#endif /* !HAVE_SHM_OPEN */
+
+#ifndef HAVE_SHM_UNLINK
+__weak inline int shm_unlink(const char *name)
+{
+       errno = ENOSYS;
+       return -1;
+}
+#endif /* !HAVE_SHM_UNLINK */
+
 #ifndef HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP
 #define pthread_mutexattr_setrobust_np(__attr, __robust)       \
        ({ ENOSYS; })
diff --git a/include/xeno_config.h.in b/include/xeno_config.h.in
index c3e84db..4484447 100644
--- a/include/xeno_config.h.in
+++ b/include/xeno_config.h.in
@@ -155,6 +155,12 @@
 /* Define to 1 if you have the `sched_getcpu' function. */
 #undef HAVE_SCHED_GETCPU
 
+/* Define to 1 if you have the `shm_open' function. */
+#undef HAVE_SHM_OPEN
+
+/* Define to 1 if you have the `shm_unlink' function. */
+#undef HAVE_SHM_UNLINK
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
diff --git a/lib/cobalt/arch/blackfin/include/asm/xenomai/syscall.h 
b/lib/cobalt/arch/blackfin/include/asm/xenomai/syscall.h
index 7005080..7e54476 100644
--- a/lib/cobalt/arch/blackfin/include/asm/xenomai/syscall.h
+++ b/lib/cobalt/arch/blackfin/include/asm/xenomai/syscall.h
@@ -55,19 +55,4 @@
 #define XENOMAI_SYSCALL5(op,a1,a2,a3,a4,a5) 
XENOMAI_DO_SYSCALL(5,op,a1,a2,a3,a4,a5)
 #define XENOMAI_SYSBIND(breq)              
XENOMAI_DO_SYSCALL(1,sc_cobalt_bind,breq)
 
-int shm_open(const char *name, int oflag, mode_t mode);
-inline __attribute__((weak))
-int shm_open(const char *name, int oflag, mode_t mode)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
-int shm_unlink(const char *name);
-inline __attribute__((weak)) int shm_unlink(const char *name)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 #endif /* !_LIB_COBALT_BLACKFIN_SYSCALL_H */
diff --git a/lib/cobalt/arch/nios2/include/asm/xenomai/syscall.h 
b/lib/cobalt/arch/nios2/include/asm/xenomai/syscall.h
index 3ba1138..ed82be1 100644
--- a/lib/cobalt/arch/nios2/include/asm/xenomai/syscall.h
+++ b/lib/cobalt/arch/nios2/include/asm/xenomai/syscall.h
@@ -152,33 +152,4 @@
 #define XENOMAI_SYSCALL5(op,a1,a2,a3,a4,a5) 
XENOMAI_DO_SYSCALL(5,op,a1,a2,a3,a4,a5)
 #define XENOMAI_SYSBIND(breq)              
XENOMAI_DO_SYSCALL(1,sc_cobalt_bind,breq)
 
-/*
- * uClibc does not always provide the following symbols for this arch;
- * provide placeholders here. Note: let the compiler decides whether
- * it wants to actually inline this routine, i.e. do not force
- * always_inline.
- */
-inline __attribute__((weak)) int pthread_atfork(void (*prepare)(void),
-                                               void (*parent)(void),
-                                               void (*child)(void))
-{
-       return 0;
-}
-
-#include <errno.h>
-
-inline __attribute__((weak)) int shm_open(const char *name,
-                                         int oflag,
-                                         mode_t mode)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
-inline __attribute__((weak)) int shm_unlink(const char *name)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 #endif /* !_LIB_COBALT_NIOS2_SYSCALL_H */


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

Reply via email to