Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty iterator on OpenBSD. #45

Open
vext01 opened this issue Sep 26, 2019 · 1 comment
Open

Empty iterator on OpenBSD. #45

vext01 opened this issue Sep 26, 2019 · 1 comment

Comments

@vext01
Copy link

vext01 commented Sep 26, 2019

Hi,

This is kind of expected (as you clearly say you only support Linux and Mac right now), but findshlibs doesn't work on OpenBSD:

extern crate findshlibs;
use findshlibs::{Segment, SharedLibrary, TargetSharedLibrary};

fn main() {
    println!("hello");
    TargetSharedLibrary::each(|shlib| {
        println!("{}", shlib.name().to_string_lossy());

        for seg in shlib.segments() {
            println!("    {}: segment {}",
                     seg.actual_virtual_memory_address(shlib),
                     seg.name());
        }
    });
    println!("/hello");
}

prints:

hello
/hello

It probably isn't difficult to get this working on OpenBSD. Before I heard of findshlibs I wrote a similar lib called phdrs which does work on OpenBSD. IIRC the callback struct is a little different, but the API is pretty much the same.

https://github.com/softdevteam/phdrs/

@fitzgen
Copy link
Member

fitzgen commented Sep 26, 2019

If you want to get *bsd support working in findshlibs, that would be most welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants