Revert "[runtime] Fix the computation of token sizes in ppdb files, the PDB stream...
[mono.git] / mono / metadata / nacl-stub.c
index 83494def459eb6b950edf09339c7466e8d4ff56f..e7fcb2d03b407e68d84dea83dc51469ee32bddb2 100644 (file)
@@ -1,16 +1,81 @@
-
 #if defined(__native_client__)
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "nacl-stub.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;
+}
+
+#ifdef USE_NEWLIB
+dev_t makedev(int maj, int min)
+{
+       return (maj)*256+(min);
+}
+
+int utime(const char *filename, const void *times)
+{
+       errno = EACCES;
+       return -1;
+}
+
+int kill(pid_t pid, int sig)
+{
+       errno = EACCES;
+       return -1;
+}
+
+int getrusage(int who, void *usage)
+{
+       errno = EACCES;
+       return -1;
+}
+
+int lstat(const char *path, struct stat *buf)
+{
+       return stat (path, buf);
+}
+
+int getdtablesize(void)
+{
+#ifdef OPEN_MAX
+  return OPEN_MAX;
+#else
+  return 256;
+#endif
+}
+
+size_t getpagesize(void)
+{
+#ifdef PAGE_SIZE
+  return PAGE_SIZE;
+#else
+  return 4096;
+#endif
+}
+
+int sem_trywait(sem_t *sem) {
+  g_assert_not_reached ();
+  return -1;
+}
+
+int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout) {
+  g_assert_not_reached ();
+  return -1;
+}
+
 #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