Skip to content
Browse files

Disable sockets and a few other things when using NACL.

  • Loading branch information...
1 parent 9ff986b commit 3c88e47f3e6d80e92ca8d923dac38a8ea5572b98 @elijahtaylor elijahtaylor committed with vargaz Aug 17, 2010
Showing with 38 additions and 0 deletions.
  1. +1 −0 mono/metadata/Makefile.am
  2. +5 −0 mono/metadata/console-unix.c
  3. +16 −0 mono/metadata/nacl-stub.c
  4. +12 −0 mono/metadata/rand.c
  5. +4 −0 mono/metadata/socket-io.c
View
1 mono/metadata/Makefile.am
@@ -142,6 +142,7 @@ libmonoruntime_la_SOURCES = \
mono-wsq.h \
monitor.c \
monitor.h \
+ nacl-stub.c \
normalization-tables.h \
null-gc.c \
number-formatter.h \
View
5 mono/metadata/console-unix.c
@@ -6,6 +6,9 @@
*
* Copyright (C) 2005-2009 Novell, Inc. (http://www.novell.com)
*/
+#if defined(__native_client__)
+#include "console-null.c"
+#else
#include <config.h>
#include <glib.h>
@@ -485,3 +488,5 @@ ves_icall_System_ConsoleDriver_TtySetup (MonoString *keypad, MonoString *teardow
return TRUE;
}
+#endif /* #if defined(__native_client__) */
+
View
16 mono/metadata/nacl-stub.c
@@ -0,0 +1,16 @@
+
+#if defined(__native_client__)
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <eglib/src/glib.h>
+#include <errno.h>
+#include <sys/types.h>
+
+struct group *getgrnam(const char *name) { return NULL; }
+struct group *getgrgid(gid_t gid) { errno=EIO; return NULL; }
+int fsync(int fd) { errno=EINVAL; return -1; }
+dev_t makedev(guint32 maj, guint32 min) { return (maj)*256+(min); }
+
+#endif
View
12 mono/metadata/rand.c
@@ -26,6 +26,17 @@
#include <mono/metadata/rand.h>
#include <mono/metadata/exception.h>
+#if defined(__native_client__)
+#include <errno.h>
+
+static void
+get_entropy_from_server (const char *path, guchar *buf, int len)
+{
+ return;
+}
+
+#else /* defined(__native_client__) */
+
#if !defined(HOST_WIN32)
#include <sys/socket.h>
#include <sys/un.h>
@@ -96,6 +107,7 @@ get_entropy_from_server (const char *path, guchar *buf, int len)
close (file);
}
#endif
+#endif /* __native_client__ */
#if defined (HOST_WIN32)
View
4 mono/metadata/socket-io.c
@@ -11,6 +11,8 @@
#include <config.h>
+#ifndef DISABLE_SOCKETS
+
#include <glib.h>
#include <string.h>
#include <stdlib.h>
@@ -3075,3 +3077,5 @@ void mono_network_cleanup(void)
WSACleanup();
}
+
+#endif /* #ifndef DISABLE_SOCKETS */

0 comments on commit 3c88e47

Please sign in to comment.
Something went wrong with that request. Please try again.