PC parallel port support (Mark Jonckheere)
[qemu] / osdep.c
diff --git a/osdep.c b/osdep.c
index 83f5a77..087a5c2 100644 (file)
--- a/osdep.c
+++ b/osdep.c
@@ -144,6 +144,22 @@ void *shmat(int shmid, const void *shmaddr, int shmflg)
 }
 
 /****************************************************************/
+/* sigaction bypassing the threads */
+
+static int kernel_sigaction(int signum, const struct qemu_sigaction *act, 
+                            struct qemu_sigaction *oldact, 
+                            int sigsetsize)
+{
+    QEMU_SYSCALL4(rt_sigaction, signum, act, oldact, sigsetsize);
+}
+
+int qemu_sigaction(int signum, const struct qemu_sigaction *act, 
+                   struct qemu_sigaction *oldact)
+{
+    return kernel_sigaction(signum, act, oldact, 8);
+}
+
+/****************************************************************/
 /* memory allocation */
 
 //#define DEBUG_MALLOC
@@ -294,6 +310,16 @@ void *qemu_mallocz(size_t size)
     return ptr;
 }
 
+char *qemu_strdup(const char *str)
+{
+    char *ptr;
+    ptr = qemu_malloc(strlen(str) + 1);
+    if (!ptr)
+        return NULL;
+    strcpy(ptr, str);
+    return ptr;
+}
+
 /****************************************************************/
 /* printf support */