#include <signal.h>
#include <fcntl.h>
#include <errno.h>
-#include <sys/errno.h>
#include <sys/param.h>
#include <sys/time.h>
#include <sys/sysctl.h>
#include <sys/mount.h>
extern int getdirentries(int fd, char *buf, int nbytes, long *basep);
+
+/* NetBSD post 2.0 has the statfs system call (if COMPAT_20), but does
+ not have struct statfs. In this case don't implement fstatfs.
+ FIXME: Should implement fstatvfs. */
+#ifndef HAVE_STRUCT_STATFS
+#undef HAVE_FSTATFS
+#endif
+
#else
/* If this is not netbsd, don't allow fstatfs or getdirentries at this time */
emul_write_buffer(&t, addr, sizeof(t), processor, cia);
}
-
+#ifdef HAVE_GETTIMEOFDAY
STATIC_INLINE_EMUL_NETBSD void
write_timezone(unsigned_word addr,
struct timezone tz,
H2T(tz.tz_dsttime);
emul_write_buffer(&tz, addr, sizeof(tz), processor, cia);
}
-
+#endif
#ifdef HAVE_GETDIRENTRIES
STATIC_INLINE_EMUL_NETBSD void
int elf_binary;
os_emul_data *bsd_data;
device *vm;
+ char *filename;
/* check that this emulation is really for us */
if (name != NULL && strcmp(name, "netbsd") != 0)
(unsigned long)(top_of_stack - stack_size));
tree_parse(vm, "./nr-bytes 0x%x", stack_size);
+ filename = tree_quote_property (bfd_get_filename(image));
tree_parse(root, "/openprom/vm/map-binary/file-name %s",
- bfd_get_filename(image));
+ filename);
+ free (filename);
/* finish the init */
tree_parse(root, "/openprom/init/register/pc 0x%lx",
0 /*data*/
};
-#endif _EMUL_NETBSD_C_
+#endif /* _EMUL_NETBSD_C_ */