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
Support DragonFlyBSD #2
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
use libc::{c_int,c_ulong}; | ||
|
||
// socket | ||
|
||
pub const FIOSETOWN: c_ulong = 0x8004667c; | ||
pub const SIOCSPGRP: c_ulong = 0x80047308; | ||
pub const FIOGETOWN: c_ulong = 0x4004667b; | ||
pub const SIOCGPGRP: c_ulong = 0x40047309; | ||
|
||
// termios | ||
|
||
pub const TIOCEXCL: c_ulong = 0x2000740d; | ||
pub const TIOCNXCL: c_ulong = 0x2000740e; | ||
pub const TIOCSCTTY: c_ulong = 0x20007461; | ||
pub const TIOCGPGRP: c_ulong = 0x40047477; | ||
pub const TIOCSPGRP: c_ulong = 0x80047476; | ||
pub const TIOCOUTQ: c_ulong = 0x40047473; | ||
pub const TIOCSTI: c_ulong = 0x80017472; | ||
pub const TIOCGWINSZ: c_ulong = 0x40087468; | ||
pub const TIOCSWINSZ: c_ulong = 0x80087467; | ||
pub const TIOCMGET: c_ulong = 0x4004746a; | ||
pub const TIOCMBIS: c_ulong = 0x8004746c; | ||
pub const TIOCMBIC: c_ulong = 0x8004746b; | ||
pub const TIOCMSET: c_ulong = 0x8004746d; | ||
pub const FIONREAD: c_ulong = 0x4004667f; | ||
pub const TIOCCONS: c_ulong = 0x80047462; | ||
pub const TIOCPKT: c_ulong = 0x80047470; | ||
pub const FIONBIO: c_ulong = 0x8004667e; | ||
pub const TIOCNOTTY: c_ulong = 0x20007471; | ||
pub const TIOCSETD: c_ulong = 0x8004741b; | ||
pub const TIOCGETD: c_ulong = 0x4004741a; | ||
pub const FIONCLEX: c_ulong = 0x20006602; | ||
pub const FIOCLEX: c_ulong = 0x20006601; | ||
pub const FIOASYNC: c_ulong = 0x8004667d; | ||
|
||
// sockios | ||
|
||
pub const SIOCADDRT: c_ulong = 0x8040720a; | ||
pub const SIOCDELRT: c_ulong = 0x8040720b; | ||
pub const SIOCGIFCONF: c_ulong = 0xc0106924; | ||
pub const SIOCGIFFLAGS: c_ulong = 0xc0206911; | ||
pub const SIOCSIFFLAGS: c_ulong = 0x80206910; | ||
pub const SIOCGIFADDR: c_ulong = 0xc0206921; | ||
pub const SIOCSIFADDR: c_ulong = 0x8020690c; | ||
pub const SIOCGIFDSTADDR: c_ulong = 0xc0206922; | ||
pub const SIOCSIFDSTADDR: c_ulong = 0x8020690e; | ||
pub const SIOCGIFBRDADDR: c_ulong = 0xc0206923; | ||
pub const SIOCSIFBRDADDR: c_ulong = 0x80206913; | ||
pub const SIOCGIFNETMASK: c_ulong = 0xc0206925; | ||
pub const SIOCSIFNETMASK: c_ulong = 0x80206916; | ||
pub const SIOCGIFMETRIC: c_ulong = 0xc0206917; | ||
pub const SIOCSIFMETRIC: c_ulong = 0x80206918; | ||
pub const SIOCGIFMTU: c_ulong = 0xc0206933; | ||
pub const SIOCSIFMTU: c_ulong = 0x80206934; | ||
pub const SIOCADDMULTI: c_ulong = 0x80206931; | ||
pub const SIOCDELMULTI: c_ulong = 0x80206932; | ||
|
||
// modem control lines | ||
|
||
pub const TIOCM_LE: c_int = 0x00000001; | ||
pub const TIOCM_DTR: c_int = 0x00000002; | ||
pub const TIOCM_RTS: c_int = 0x00000004; | ||
pub const TIOCM_ST: c_int = 0x00000008; | ||
pub const TIOCM_SR: c_int = 0x00000010; | ||
pub const TIOCM_CTS: c_int = 0x00000020; | ||
pub const TIOCM_CAR: c_int = 0x00000040; | ||
pub const TIOCM_CD: c_int = 0x00000040; | ||
pub const TIOCM_RNG: c_int = 0x00000080; | ||
pub const TIOCM_RI: c_int = 0x00000080; | ||
pub const TIOCM_DSR: c_int = 0x00000100; | ||
|
||
extern "C" { | ||
pub fn ioctl(fildes: c_int, request: c_ulong, ...) -> c_int; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 there a good reason to use this macro instead of using
AC_CHECK_HEADERS()
inconfigure.ac
?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.
Dunno how to correctly do that with AC_CHECK_HEADERS, as it only needs to be included on DragonFly.
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.
@mneumann That's what autoconf takes care of. The autoconf philosophy is to test for features instead of platforms:
https://www.gnu.org/software/autoconf/manual/autoconf-2.62/html_node/Introduction.html#Introduction
If you're interested, I made some commits on top of your branch that do this with
AC_CHECK_HEADERS
: https://github.com/dcuddeback/ioctl-rs/compare/feature/dragonfly?expand=1#diff-ecc1a87332cffa717e3a14c626ae27cbL28