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

Add setdomainname function #1244

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yuki0iq
Copy link

@yuki0iq yuki0iq commented Dec 17, 2024

No description provided.

name: *const c::c_char,
len: c::size_t
) via SYS_setdomainname -> c::c_int
}
Copy link
Member

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?

Copy link
Author

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)

Copy link
Member

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 cfgs?

I also filed rust-lang/libc#4212 to add the declarations to libc for Android.

Copy link
Author

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
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

Successfully merging this pull request may close these issues.

2 participants