-
Notifications
You must be signed in to change notification settings - Fork 166
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
Add setdomainname function #1244
base: main
Are you sure you want to change the base?
Conversation
880e8f7
to
3d49429
Compare
name: *const c::c_char, | ||
len: c::size_t | ||
) via SYS_setdomainname -> c::c_int | ||
} |
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.
At a quick glance, the libc crate does have declarations for setdomainname
; could you comment on why tthis uses syscall!
instead of just libc::setdomainname
?
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.
Turns out libc::setdomainname
isn't there for android (failed CI)
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.
It's unfortunate to make non-Linux users use a weak symbol though. Could you use libc::setdomainname
on all platforms except Android using cfg
s?
I also filed rust-lang/libc#4212 to add the declarations to libc for Android.
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.
Fixed
Use weak `setdomainname` only for android; remove this special case once [libc#4212] is merged. [libc#4212]: rust-lang/libc#4212
bfff3ae
to
8c3ac99
Compare
8c3ac99
to
ebeb70e
Compare
No description provided.