Not sure what we should do here when this fails, so just emit a warning
for now to satisfy unused result compiler warnings. We can see if any
users actually notice here.
+2021-05-06 Mike Frysinger <vapier@gentoo.org>
+
+ * emulos.c: Include errno.h & stdio.h.
+ (emul_write): Print a warning when the write fails.
+
2021-05-04 Mike Frysinger <vapier@gentoo.org>
* dv-m68hc11.c (struct m68hc11cpu): Change attach_size to unsigned int.
#endif
#ifndef WIN32
+#include <errno.h>
+#include <stdio.h>
#include <sys/types.h>
#include <sys/time.h>
while (size)
{
uint8 val = memory_read8 (cpu, addr);
-
- write(0, &val, 1);
+
+ if (write (0, &val, 1) != 1)
+ printf ("write failed: %s\n", strerror (errno));
addr ++;
size--;
}