X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=engines%2Ffio-engine-libaio.c;h=c0f280b51ed447e1d125f2ee4c2806ffbd10c87b;hp=1848dcc4398164d3c9c241377709e538b7c97435;hb=34cfcdafa994a0a75120e498c51eda08bde5df72;hpb=c06aa240c904becbafb8457ed3b828cf0d38a180 diff --git a/engines/fio-engine-libaio.c b/engines/fio-engine-libaio.c index 1848dcc4..c0f280b5 100644 --- a/engines/fio-engine-libaio.c +++ b/engines/fio-engine-libaio.c @@ -10,6 +10,8 @@ #include "fio.h" #include "os.h" +#ifdef FIO_HAVE_LIBAIO + #define ev_to_iou(ev) (struct io_u *) ((unsigned long) (ev)->obj) struct libaio_data { @@ -138,3 +140,24 @@ struct ioengine_ops ioengine = { .event = fio_libaio_event, .cleanup = fio_libaio_cleanup, }; + +#else /* FIO_HAVE_LIBAIO */ + +/* + * When we have a proper configure system in place, we simply wont build + * and install this io engine. For now install a crippled version that + * just complains and fails to load. + */ +static int fio_libaio_init(struct thread_data fio_unused *td) +{ + fprintf(stderr, "fio: libaio not available\n"); + return 1; +} + +struct ioengine_ops ioengine = { + .name = "libaio", + .version = FIO_IOOPS_VERSION, + .init = fio_libaio_init, +}; + +#endif