-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Conversation
base/libdl.jl
Outdated
@@ -205,6 +205,43 @@ if is_linux() | |||
end | |||
end # linux-only | |||
|
|||
if Sys.KERNEL == :FreeBSD |
There was a problem hiding this comment.
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()
.
There was a problem hiding this comment.
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§ion=3
There was a problem hiding this comment.
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()
.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
DL_ITERATE_PHDR(3):
https://www.freebsd.org/cgi/man.cgi?query=dl_iterate_phdr&apropos=0&sektion=3&manpath=FreeBSD+12-current&arch=default&format=html