Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › c › POLL Public Constant POLL Doc Source Public Constant std.c.POLL
pub const POLL = switch (native_os ) File c.zig: 1704
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847 pub const POLL = switch (native_os ) {
.linux => linux .POLL ,
.emscripten => emscripten .POLL ,
.wasi => struct {
pub const RDNORM = 0x1 ;
pub const WRNORM = 0x2 ;
pub const IN = RDNORM ;
pub const OUT = WRNORM ;
pub const ERR = 0x1000 ;
pub const HUP = 0x2000 ;
pub const NVAL = 0x4000 ;
},
.windows => ws2_32 .POLL ,
.driverkit , .ios , .maccatalyst , .macos , .tvos , .visionos , .watchos => struct {
pub const IN = 0x001 ;
pub const PRI = 0x002 ;
pub const OUT = 0x004 ;
pub const RDNORM = 0x040 ;
pub const WRNORM = OUT ;
pub const RDBAND = 0x080 ;
pub const WRBAND = 0x100 ;
pub const EXTEND = 0x0200 ;
pub const ATTRIB = 0x0400 ;
pub const NLINK = 0x0800 ;
pub const WRITE = 0x1000 ;
pub const ERR = 0x008 ;
pub const HUP = 0x010 ;
pub const NVAL = 0x020 ;
pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL ;
},
.freebsd => struct {
/// any readable data available.
pub const IN = 0x0001 ;
/// OOB/Urgent readable data.
pub const PRI = 0x0002 ;
/// file descriptor is writeable.
pub const OUT = 0x0004 ;
/// non-OOB/URG data available.
pub const RDNORM = 0x0040 ;
/// no write type differentiation.
pub const WRNORM = OUT ;
/// OOB/Urgent readable data.
pub const RDBAND = 0x0080 ;
/// OOB/Urgent data can be written.
pub const WRBAND = 0x0100 ;
/// like IN, except ignore EOF.
pub const INIGNEOF = 0x2000 ;
/// some poll error occurred.
pub const ERR = 0x0008 ;
/// file descriptor was "hung up".
pub const HUP = 0x0010 ;
/// requested events "invalid".
pub const NVAL = 0x0020 ;
pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL ;
},
.illumos => struct {
pub const IN = 0x0001 ;
pub const PRI = 0x0002 ;
pub const OUT = 0x0004 ;
pub const RDNORM = 0x0040 ;
pub const WRNORM = .OUT ;
pub const RDBAND = 0x0080 ;
pub const WRBAND = 0x0100 ;
/// Read-side hangup.
pub const RDHUP = 0x4000 ;
/// Non-testable events (may not be specified in events).
pub const ERR = 0x0008 ;
pub const HUP = 0x0010 ;
pub const NVAL = 0x0020 ;
/// Events to control `/dev/poll` (not specified in revents)
pub const REMOVE = 0x0800 ;
pub const ONESHOT = 0x1000 ;
pub const ET = 0x2000 ;
},
.dragonfly , .netbsd => struct {
/// Testable events (may be specified in events field).
pub const IN = 0x0001 ;
pub const PRI = 0x0002 ;
pub const OUT = 0x0004 ;
pub const RDNORM = 0x0040 ;
pub const WRNORM = OUT ;
pub const RDBAND = 0x0080 ;
pub const WRBAND = 0x0100 ;
/// Non-testable events (may not be specified in events field).
pub const ERR = 0x0008 ;
pub const HUP = 0x0010 ;
pub const NVAL = 0x0020 ;
},
.haiku => struct {
/// any readable data available
pub const IN = 0x0001 ;
/// file descriptor is writeable
pub const OUT = 0x0002 ;
pub const RDNORM = IN ;
pub const WRNORM = OUT ;
/// priority readable data
pub const RDBAND = 0x0008 ;
/// priority data can be written
pub const WRBAND = 0x0010 ;
/// high priority readable data
pub const PRI = 0x0020 ;
/// errors pending
pub const ERR = 0x0004 ;
/// disconnected
pub const HUP = 0x0080 ;
/// invalid file descriptor
pub const NVAL = 0x1000 ;
},
.openbsd => struct {
pub const IN = 0x0001 ;
pub const PRI = 0x0002 ;
pub const OUT = 0x0004 ;
pub const ERR = 0x0008 ;
pub const HUP = 0x0010 ;
pub const NVAL = 0x0020 ;
pub const RDNORM = 0x0040 ;
pub const NORM = RDNORM ;
pub const WRNORM = OUT ;
pub const RDBAND = 0x0080 ;
pub const WRBAND = 0x0100 ;
},
// https://github.com/SerenityOS/serenity/blob/265764ff2fec038855193296588a887fc322d76a/Kernel/API/POSIX/poll.h#L15-L24
.serenity => struct {
pub const IN = 0x0001 ;
pub const PRI = 0x0002 ;
pub const OUT = 0x0004 ;
pub const ERR = 0x0008 ;
pub const HUP = 0x0010 ;
pub const NVAL = 0x0020 ;
pub const RDNORM = IN ;
pub const WRNORM = OUT ;
pub const WRBAND = 0x1000 ;
pub const RDHUP = 0x2000 ;
},
else => void ,
}