+static void write_pid(pid_t pid, const char *pidfile)
+{
+ FILE *fpid;
+
+ fpid = fopen(pidfile, "w");
+ if (!fpid) {
+ log_err("fio: failed opening pid file %s\n", pidfile);
+ return;
+ }
+
+ fprintf(fpid, "%u\n", (unsigned int) pid);
+}
+
+/*
+ * If pidfile is specified, background us.
+ */
+int fio_start_server(char *pidfile)