Skip to content

Commit

Permalink
test: get libaio symbols via dlsym_fatal(RTLD_NEXT, ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenningerk committed Mar 19, 2024
1 parent bd93f1d commit 544c799
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions tests/sbd-testbed.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,11 @@ init (void)
orig_fopen = (orig_fopen_f_type)dlsym_fatal(RTLD_NEXT,"fopen");
orig_fclose = (orig_fclose_f_type)dlsym_fatal(RTLD_NEXT,"fclose");

handle = dlopen("libaio.so.1", RTLD_NOW);
if (!handle) {
fprintf(stderr, "Failed opening libaio.so.1\n");
exit(1);
}
orig_io_setup = (orig_io_setup_f_type)dlsym_fatal(handle,"io_setup");
orig_io_destroy = (orig_io_destroy_f_type)dlsym_fatal(handle,"io_destroy");
orig_io_submit = (orig_io_submit_f_type)dlsym_fatal(handle,"io_submit");
orig_io_getevents = (orig_io_getevents_f_type)dlsym_fatal(handle,"io_getevents");
orig_io_cancel = (orig_io_cancel_f_type)dlsym_fatal(handle,"io_cancel");
dlclose(handle);
orig_io_setup = (orig_io_setup_f_type)dlsym_fatal(RTLD_NEXT,"io_setup");
orig_io_destroy = (orig_io_destroy_f_type)dlsym_fatal(RTLD_NEXT,"io_destroy");
orig_io_submit = (orig_io_submit_f_type)dlsym_fatal(RTLD_NEXT,"io_submit");
orig_io_getevents = (orig_io_getevents_f_type)dlsym_fatal(RTLD_NEXT,"io_getevents");
orig_io_cancel = (orig_io_cancel_f_type)dlsym_fatal(RTLD_NEXT,"io_cancel");

value = getenv("SBD_PRELOAD_LOG");
if (value) {
Expand Down

0 comments on commit 544c799

Please sign in to comment.