Make processes work on HP-UX
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index 81854818d6bd81ae3cd503a8eb4e4661d99bfc93..a8608f49fdd4023c6e54d4e3cf38ec14234498f5 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -1294,6 +1294,7 @@ static int fork_main(int shmid, int offset)
        struct thread_data *td;
        void *data, *ret;
 
+#ifndef __hpux
        data = shmat(shmid, NULL, 0);
        if (data == (void *) -1) {
                int __err = errno;
@@ -1301,6 +1302,12 @@ static int fork_main(int shmid, int offset)
                perror("shmat");
                return __err;
        }
+#else
+       /*
+        * HP-UX inherits shm mappings?
+        */
+       data = threads;
+#endif
 
        td = data + offset * sizeof(struct thread_data);
        ret = thread_main(td);