Disable sockets and locking when using NACL.
authorElijah Taylor <elijahtaylor@google.com>
Tue, 17 Aug 2010 05:29:25 +0000 (07:29 +0200)
committerZoltan Varga <vargaz@gmail.com>
Tue, 17 Aug 2010 05:30:37 +0000 (07:30 +0200)
mono/io-layer/locking.c
mono/io-layer/sockets.c

index 17d8acac6bfecbc89e4007b8a61255a14e08e7d0..a3439d019ce745ea2c20a8112f9a802ceb0366fc 100644 (file)
 gboolean
 _wapi_lock_file_region (int fd, off_t offset, off_t length)
 {
+#if defined(__native_client__)
+       printf("WARNING: locking.c: _wapi_lock_file_region(): fcntl() not available on Native Client!\n");
+       // behave as below -- locks are not available
+       return(TRUE);
+#else
        struct flock lock_data;
        int ret;
 
@@ -58,11 +63,16 @@ _wapi_lock_file_region (int fd, off_t offset, off_t length)
        }
 
        return(TRUE);
+#endif /* __native_client__ */
 }
 
 gboolean
 _wapi_unlock_file_region (int fd, off_t offset, off_t length)
 {
+#if defined(__native_client__)
+       printf("WARNING: locking.c: _wapi_unlock_file_region(): fcntl() not available on Native Client!\n");
+       return (TRUE);
+#else
        struct flock lock_data;
        int ret;
 
@@ -98,6 +108,7 @@ _wapi_unlock_file_region (int fd, off_t offset, off_t length)
        }
 
        return(TRUE);
+#endif /* __native_client__ */
 }
 
 gboolean
index edb8e3aad1d2852a3cdf0e1bb0e06bbffc9431f4..f2221767a49004291c4a288055ae77e6d4837b98 100644 (file)
@@ -7,6 +7,8 @@
  * (C) 2002 Ximian, Inc.
  */
 
+#ifndef DISABLE_SOCKETS
+
 #include <config.h>
 #include <glib.h>
 #include <pthread.h>
@@ -1581,3 +1583,5 @@ int WSASend (guint32 fd, WapiWSABuf *buffers, guint32 count, guint32 *sent,
        *sent = ret;
        return 0;
 }
+
+#endif /* ifndef DISABLE_SOCKETS */