Disable sockets and locking when using NACL.
[mono.git] / mono / io-layer / locking.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