From 63bc1ed6d037c1e9754d9a28ee50e6d4101e1937 Mon Sep 17 00:00:00 2001 From: Elijah Taylor Date: Tue, 17 Aug 2010 07:29:25 +0200 Subject: [PATCH] Disable sockets and locking when using NACL. --- mono/io-layer/locking.c | 11 +++++++++++ mono/io-layer/sockets.c | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/mono/io-layer/locking.c b/mono/io-layer/locking.c index 17d8acac6bf..a3439d019ce 100644 --- a/mono/io-layer/locking.c +++ b/mono/io-layer/locking.c @@ -23,6 +23,11 @@ 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 diff --git a/mono/io-layer/sockets.c b/mono/io-layer/sockets.c index edb8e3aad1d..f2221767a49 100644 --- a/mono/io-layer/sockets.c +++ b/mono/io-layer/sockets.c @@ -7,6 +7,8 @@ * (C) 2002 Ximian, Inc. */ +#ifndef DISABLE_SOCKETS + #include #include #include @@ -1581,3 +1583,5 @@ int WSASend (guint32 fd, WapiWSABuf *buffers, guint32 count, guint32 *sent, *sent = ret; return 0; } + +#endif /* ifndef DISABLE_SOCKETS */ -- 2.25.1