Skip to content

Commit

Permalink
Auto merge of #2485 - DimitrisJim:freebsd_ai_consts, r=Amanieu
Browse files Browse the repository at this point in the history
Add AI_* constants to freebdslike platforms.

For dragonfly, some of the constants (`AI_MASK`, `AI_V4MAPPED_CFG` and `AI_DEFAULT`) are behind a `__BSD_VISIBLE` define. What's the best way to handle these?

Header files for [dragonfly](https://git.quantumachine.net/mirror/DragonFlyBSD/src/branch/master/include/netdb.h) and [freebsd](https://cgit.freebsd.org/src/tree/include/netdb.h).

For now, I've just added all common names to `freebdslike`.
  • Loading branch information
bors committed Oct 28, 2021
2 parents 5fe832a + a5da2c2 commit 90ebf43
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libc-test/semver/freebsd.txt
Expand Up @@ -55,6 +55,13 @@ AIO_ALLDONE
AIO_CANCELED
AIO_LISTIO_MAX
AIO_NOTCANCELED
AI_PASSIVE
AI_CANONNAME
AI_NUMERICHOST
AI_NUMERICSERV
AI_ALL
AI_ADDRCONFIG
AI_V4MAPPED
ALTMON_1
ALTMON_10
ALTMON_11
Expand Down
8 changes: 8 additions & 0 deletions src/unix/bsd/freebsdlike/mod.rs
Expand Up @@ -724,6 +724,14 @@ pub const POLLSTANDARD: ::c_short = ::POLLIN
| ::POLLHUP
| ::POLLNVAL;

pub const AI_PASSIVE: ::c_int = 0x00000001;
pub const AI_CANONNAME: ::c_int = 0x00000002;
pub const AI_NUMERICHOST: ::c_int = 0x00000004;
pub const AI_NUMERICSERV: ::c_int = 0x00000008;
pub const AI_ALL: ::c_int = 0x00000100;
pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
pub const AI_V4MAPPED: ::c_int = 0x00000800;

pub const EAI_AGAIN: ::c_int = 2;
pub const EAI_BADFLAGS: ::c_int = 3;
pub const EAI_FAIL: ::c_int = 4;
Expand Down

0 comments on commit 90ebf43

Please sign in to comment.