# Fix AI/NI flag definitions for BSD systems · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/73f863a6fb1e844ec312345b3160e3987fe6586d)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 73f863a6fb1e844ec312345b3160e3987fe6586d

Requested commit: 73f863a6fb1e844ec312345b3160e3987fe6586d

Commit: 73f863a6fb1e844ec312345b3160e3987fe6586d

Tree: 7bb94da2681a168c3b0bfbd8e5b0615aa0a7f280

Author: Lukas Lalinsky

Committer: Alex Rønne Petersen

## Message

```
Fix AI/NI flag definitions for BSD systems

Add missing AI flags for NetBSD and OpenBSD:
- NetBSD: Add AI.SRV flag at bit 11 (0x00000800)
- OpenBSD: Add AI.EXT flag at bit 3 and AI.FQDN flag at bit 5

Add missing NI (getnameinfo) flag definitions for all BSDs and Darwin:
- FreeBSD/Haiku: NOFQDN, NUMERICHOST, NAMEREQD, NUMERICSERV, DGRAM, NUMERICSCOPE
- DragonFly/NetBSD: Same flags with NUMERICSCOPE at bit 6 (deprecated WITHSCOPEID at bit 5 is skipped)
- OpenBSD: NUMERICHOST, NUMERICSERV, NOFQDN, NAMEREQD, DGRAM (no NUMERICSCOPE)
- macOS/Darwin: NOFQDN, NUMERICHOST, NAMEREQD, NUMERICSERV, DGRAM, NUMERICSCOPE at bit 8 (deprecated WITHSCOPEID at bit 5 is skipped)

References:
- NetBSD: https://github.com/NetBSD/src/blob/trunk/include/netdb.h
- OpenBSD: https://github.com/openbsd/src/blob/master/include/netdb.h
- FreeBSD: https://github.com/freebsd/freebsd-src/blob/master/include/netdb.h
- DragonFly BSD: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/include/netdb.h
- Haiku: https://github.com/haiku/haiku/blob/master/headers/posix/netdb.h
- macOS/Darwin: https://github.com/apple-oss-distributions/Libinfo/blob/main/lookup.subproj/netdb.h

```

## Parents

- [f0a3df98d35417313854d77e671f35ea9e86d82c](https://git.cafe/gitcafe/zig/commit/f0a3df98d35417313854d77e671f35ea9e86d82c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/73f863a6fb1e844ec312345b3160e3987fe6586d?format=markdown)
