t/io_uring: enable support for registered buffers for passthrough
[fio.git] / backend.c
index e5bb4e259034b29af86fbaed018ae64c7bb288db..fe614f6e1cf025aaf1e24f5b25118d4b1f8ab862 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -90,6 +90,25 @@ static void sig_int(int sig)
        }
 }
 
+#ifdef WIN32
+static void sig_break(int sig)
+{
+       struct thread_data *td;
+       int i;
+
+       sig_int(sig);
+
+       /**
+        * Windows terminates all job processes on SIGBREAK after the handler
+        * returns, so give them time to wrap-up and give stats
+        */
+       for_each_td(td, i) {
+               while (td->runstate < TD_EXITED)
+                       sleep(1);
+       }
+}
+#endif
+
 void sig_show_status(int sig)
 {
        show_running_run_stats();
@@ -112,7 +131,7 @@ static void set_sig_handlers(void)
 /* Windows uses SIGBREAK as a quit signal from other applications */
 #ifdef WIN32
        memset(&act, 0, sizeof(act));
-       act.sa_handler = sig_int;
+       act.sa_handler = sig_break;
        act.sa_flags = SA_RESTART;
        sigaction(SIGBREAK, &act, NULL);
 #endif
@@ -2432,10 +2451,8 @@ reap:
                                                        strerror(ret));
                        } else {
                                pid_t pid;
-                               struct fio_file **files;
                                void *eo;
                                dprint(FD_PROCESS, "will fork\n");
-                               files = td->files;
                                eo = td->eo;
                                read_barrier();
                                pid = fork();
@@ -2446,9 +2463,6 @@ reap:
                                        _exit(ret);
                                } else if (i == fio_debug_jobno)
                                        *fio_debug_jobp = pid;
-                               // freeing previously allocated memory for files
-                               // this memory freed MUST NOT be shared between processes, only the pointer itself may be shared within TD
-                               free(files);
                                free(eo);
                                free(fd);
                                fd = NULL;