Skip to content

Commit c956664

Browse files
committed
Attempt to load libbpf.so by alternative name
1 parent 4c0dddf commit c956664

File tree

1 file changed

+5
-2
lines changed
  • src/one/nio/os/native

1 file changed

+5
-2
lines changed

src/one/nio/os/native/bpf.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ Java_one_nio_os_bpf_Bpf_progLoad(JNIEnv* env, jclass cls, jstring pathname, jint
5151
if (bpf_prog_load == NULL) {
5252
void* libbpf = dlopen("libbpf.so", RTLD_LAZY | RTLD_GLOBAL);
5353
if (libbpf == NULL) {
54-
throw_by_name(env, "java/lang/UnsupportedOperationException", "Failed to load libbpf.so");
55-
return -EINVAL;
54+
libbpf = dlopen("libbpf.so.0", RTLD_LAZY | RTLD_GLOBAL);
55+
if (libbpf == NULL) {
56+
throw_by_name(env, "java/lang/UnsupportedOperationException", "Failed to load libbpf.so");
57+
return -EINVAL;
58+
}
5659
}
5760
bpf_prog_load = dlsym(libbpf, "bpf_prog_load");
5861
if (bpf_prog_load == NULL) {

0 commit comments

Comments
 (0)