authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-10-21 16:29:15+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-12-29 10:40:00-07:00
log2c16a9668632be83c5e1bb0baeb00d221bb0eca1
tree470eefadeda659f705f5c1ec8056d42386dfe4ac
parentdc810eb73b08edfc445f2ce043806be00a236abf

std: Fix poll definitions for FreeBSD/Darwin


2 files changed, 26 insertions(+), 1 deletions(-)

lib/std/os/bits/darwin.zig+1-1
......@@ -1461,7 +1461,7 @@ pub const LOCK_EX = 2;
14611461pub const LOCK_UN = 8;
14621462pub const LOCK_NB = 4;
14631463
1464pub const nfds_t = usize;
1464pub const nfds_t = u32;
14651465pub const pollfd = extern struct {
14661466 fd: fd_t,
14671467 events: i16,
lib/std/os/bits/freebsd.zig+25
......@@ -1480,3 +1480,28 @@ pub const rlimit = extern struct {
14801480pub const SHUT_RD = 0;
14811481pub const SHUT_WR = 1;
14821482pub const SHUT_RDWR = 2;
1483
1484pub const nfds_t = u32;
1485
1486pub const pollfd = extern struct {
1487 fd: fd_t,
1488 events: i16,
1489 revents: i16,
1490};
1491
1492/// any readable data available.
1493pub const POLLIN = 0x0001;
1494/// OOB/Urgent readable data.
1495pub const POLLPRI = 0x0002;
1496/// file descriptor is writeable.
1497pub const POLLOUT = 0x0004;
1498/// non-OOB/URG data available.
1499pub const POLLRDNORM = 0x0040;
1500/// no write type differentiation.
1501pub const POLLWRNORM = POLLOUT;
1502/// OOB/Urgent readable data.
1503pub const POLLRDBAND = 0x0080;
1504/// OOB/Urgent data can be written.
1505pub const POLLWRBAND = 0x0100;
1506/// like POLLIN, except ignore EOF.
1507pub const POLLINIGNEOF = 0x2000;