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

Libdl: implement dllist on FreeBSD #20675

Merged
merged 2 commits into from
Feb 20, 2017
Merged

Conversation

base/libdl.jl Outdated
@@ -205,6 +205,43 @@ if is_linux()
end
end # linux-only

if Sys.KERNEL == :FreeBSD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this entirely unique to FreeBSD, or will it apply to Dragonfly and other BSDs? If the latter, this should be if is_bsd() && !is_apple().

Copy link
Member Author

@iblislin iblislin Feb 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the manual, found that they share the same c struct in the first 4 field, but not sure the behaviour is consistent or not.

I will install VMs and try later.

NetBSD: http://netbsd.gw.com/cgi-bin/man-cgi?dl_iterate_phdr+3+NetBSD-7.0
OpenBSD: http://man.openbsd.org/OpenBSD-current/man3/dl_iterate_phdr.3
DragonflyBSD: https://www.dragonflybsd.org/cgi/web-man?command=dl_iterate_phdr&section=3

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior is same on NetBSD and Dragonfly. But OpenBSD will get compilation error with
#include <link.h>. (link.h is described on OpenBSD's manual, seems there are some syntax error in the header file)

I decide to use f is_bsd() && !is_apple().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On more question: is sutable to use @static macro here? I just found that the if is_linux section in this file do not use @static. what is the reason?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need @static at the top level 99% of the time since that's already what the branch is doing.

@ararslan ararslan added the system:freebsd Affects only FreeBSD label Feb 19, 2017
@ararslan ararslan merged commit baf1900 into JuliaLang:master Feb 20, 2017
@iblislin iblislin deleted the fbsd-libdl branch February 21, 2017 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:freebsd Affects only FreeBSD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants