-struct PMEMblkpool_s;
-typedef struct PMEMblkpool_s PMEMblkpool;
-
-PMEMblkpool* (*pmemblk_create_ptr)(const char*, size_t, size_t, mode_t) = NULL;
-PMEMblkpool* (*pmemblk_open_ptr)(const char*, size_t) = NULL;
-void (*pmemblk_close_ptr)(PMEMblkpool*) = NULL;
-size_t (*pmemblk_nblock_ptr)(PMEMblkpool*) = NULL;
-size_t (*pmemblk_bsize_ptr)(PMEMblkpool*) = NULL;
-int (*pmemblk_read_ptr)(PMEMblkpool*, void*, off_t) = NULL;
-int (*pmemblk_write_ptr)(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_ptr = dlsym(dl, "pmemblk_create")))
- goto errorout;
- if (NULL == (pmemblk_open_ptr = dlsym(dl, "pmemblk_open")))
- goto errorout;
- if (NULL == (pmemblk_close_ptr = dlsym(dl, "pmemblk_close")))
- goto errorout;
- if (NULL == (pmemblk_nblock_ptr = dlsym(dl, "pmemblk_nblock")))
- goto errorout;
- if (NULL == (pmemblk_bsize_ptr = dlsym(dl, "pmemblk_bsize")))
- goto errorout;
- if (NULL == (pmemblk_read_ptr = dlsym(dl, "pmemblk_read")))
- goto errorout;
- if (NULL == (pmemblk_write_ptr = 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() */
-
-#define pmemblk_create pmemblk_create_ptr
-#define pmemblk_open pmemblk_open_ptr
-#define pmemblk_close pmemblk_close_ptr
-#define pmemblk_nblock pmemblk_nblock_ptr
-#define pmemblk_bsize pmemblk_bsize_ptr
-#define pmemblk_read pmemblk_read_ptr
-#define pmemblk_write pmemblk_write_ptr
-