1 #include <sys/types.h> 2 #include <sys/stat.h> 3 #include <fcntl.h> 4 #include <sys/param.h> 5 #include <errno.h> 6 #include <stdlib.h> 7 #include <sys/select.h> 8 #if HAVE_LIBAIO_H 9 #include <libaio.h> 10 #endif 11 #include <sys/uio.h> 12 #include <assert.h> 13 #include <unistd.h> 14 #include <stdio.h> 15 #include <string.h> 16 17 /* Fatal error handler */ 18 static void io_error(const char *func, int rc) 19 { 20 if (rc == -ENOSYS) 21 fprintf(stderr, "AIO not in this kernel\n"); 22 else if (rc < 0) 23 fprintf(stderr, "%s: %s\n", func, strerror(-rc)); 24 else 25 fprintf(stderr, "%s: error %d\n", func, rc); 26 27 exit(1); 28 } 29