authorgravatar for 8965202+gpanders@users.noreply.github.comGreg Anders <8965202+gpanders@users.noreply.github.com> 2020-05-20 11:25:50-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-22 13:21:34-04:00
log64955deb72bf0aeaa551056cf3adf8442f82eccc
tree6306ef8d15836c7118487a630e9627fa9853990b
parent70239802c9f98aa2a7bc9bd87046d1b64deceedb

Add poll definitions for Darwin


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

lib/std/os/bits/darwin.zig+26
......@@ -1430,3 +1430,29 @@ pub const LOCK_SH = 1;
14301430pub const LOCK_EX = 2;
14311431pub const LOCK_UN = 8;
14321432pub const LOCK_NB = 4;
1433
1434pub const nfds_t = usize;
1435pub const pollfd = extern struct {
1436 fd: fd_t,
1437 events: i16,
1438 revents: i16,
1439};
1440
1441pub const POLLIN = 0x001;
1442pub const POLLPRI = 0x002;
1443pub const POLLOUT = 0x004;
1444pub const POLLRDNORM = 0x040;
1445pub const POLLWRNORM = POLLOUT;
1446pub const POLLRDBAND = 0x080;
1447pub const POLLWRBAND = 0x100;
1448
1449pub const POLLEXTEND = 0x0200;
1450pub const POLLATTRIB = 0x0400;
1451pub const POLLNLINK = 0x0800;
1452pub const POLLWRITE = 0x1000;
1453
1454pub const POLLERR = 0x008;
1455pub const POLLHUP = 0x010;
1456pub const POLLNVAL = 0x020;
1457
1458pub const POLLSTANDARD = POLLIN | POLLPRI | POLLOUT | POLLRDNORM | POLLRDBAND | POLLWRBAND | POLLERR | POLLHUP | POLLNVAL;