eina: fix build on NetBSD.
authorcedric <cedric>
Wed, 13 Jul 2011 08:51:19 +0000 (08:51 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Jul 2011 08:51:19 +0000 (08:51 +0000)
NOTE: we need a fallback for shm_open that will work on BSD system.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@61324 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
src/include/eina_inline_lock_posix.x
src/lib/eina_file.c

index 5ba540e..dc087f0 100644 (file)
@@ -586,6 +586,8 @@ AC_CHECK_FUNCS([openat], [AC_DEFINE(HAVE_OPENAT)], [])
 AC_CHECK_FUNCS([statat], [AC_DEFINE(HAVE_STATAT)], [])
 AC_CHECK_FUNCS([fpathconf], [AC_DEFINE(HAVE_FPATHCONF)], [])
 
+AC_CHECK_FUNCS([shm_open], [AC_DEFINE(HAVE_SHMOPEN)], [])
+
 ### Modules
 
 if test "x${have_default_mempool}" = "xyes" ; then
index 1c54fca..825edf0 100644 (file)
@@ -28,6 +28,8 @@
 # include <pthread.h>
 #endif
 
+#include <sys/time.h>
+
 #ifdef EINA_HAVE_DEBUG_THREADS
 #include <stdlib.h>
 #include <string.h>
index e3796e9..33a8e70 100644 (file)
@@ -751,7 +751,11 @@ eina_file_open(const char *filename, Eina_Bool shared)
    */
 
    if (shared)
+#ifdef HAVE_SHMOPEN
      fd = shm_open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
+#else
+     return NULL;
+#endif
    else
      fd = open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);