-struct PMEMblkpool_s;
-typedef struct PMEMblkpool_s PMEMblkpool;
-
-PMEMblkpool *(*pmemblk_create) (const char *, size_t, size_t, mode_t) = NULL;
-PMEMblkpool *(*pmemblk_open) (const char *, size_t) = NULL;
-void (*pmemblk_close) (PMEMblkpool *) = NULL;
-size_t(*pmemblk_nblock) (PMEMblkpool *) = NULL;
-size_t(*pmemblk_bsize) (PMEMblkpool *) = NULL;
-int (*pmemblk_read) (PMEMblkpool *, void *, off_t) = NULL;
-int (*pmemblk_write) (PMEMblkpool *, const void *, off_t) = NULL;
-
-int load_libpmemblk(const char *path)
-{
- void *dl;
-
- if (NULL == path)
- path = "libpmemblk.so";
-
- dl = dlopen(path, RTLD_NOW | RTLD_NODELETE);
- if (NULL == dl)
- goto errorout;
-
- if (NULL == (pmemblk_create = dlsym(dl, "pmemblk_create")))
- goto errorout;
- if (NULL == (pmemblk_open = dlsym(dl, "pmemblk_open")))
- goto errorout;
- if (NULL == (pmemblk_close = dlsym(dl, "pmemblk_close")))
- goto errorout;
- if (NULL == (pmemblk_nblock = dlsym(dl, "pmemblk_nblock")))
- goto errorout;
- if (NULL == (pmemblk_bsize = dlsym(dl, "pmemblk_bsize")))
- goto errorout;
- if (NULL == (pmemblk_read = dlsym(dl, "pmemblk_read")))
- goto errorout;
- if (NULL == (pmemblk_write = dlsym(dl, "pmemblk_write")))
- goto errorout;
-
- return 0;
-
-errorout:
- log_err("fio: unable to load libpmemblk: %s\n", dlerror());
- if (NULL != dl)
- dlclose(dl);
-
- return (-1);
-
-} /* load_libpmemblk() */
-