aboutsummaryrefslogtreecommitdiff
path: root/std/os/darwin.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-09-19 09:46:41 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-09-19 09:46:41 -0400
commit751ab72a82a0edc4c5c129c6675a33d3cd57fa73 (patch)
tree54ddc2a4c43b83e85293d8795fe6b21b10e889c9 /std/os/darwin.zig
parent86eb1836682cecea199748842767cf2d9cc2ea62 (diff)
downloadzig-751ab72a82a0edc4c5c129c6675a33d3cd57fa73.tar.gz
zig-751ab72a82a0edc4c5c129c6675a33d3cd57fa73.zip
std: fix os.sleep on darwin and windows
Diffstat (limited to 'std/os/darwin.zig')
-rw-r--r--std/os/darwin.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/std/os/darwin.zig b/std/os/darwin.zig
index 05acceba29..0cec438e5f 100644
--- a/std/os/darwin.zig
+++ b/std/os/darwin.zig
@@ -221,6 +221,10 @@ pub fn readlink(noalias path: &const u8, noalias buf_ptr: &u8, buf_len: usize) -
errnoWrap(c.readlink(path, buf_ptr, buf_len))
}
+pub fn nanosleep(req: &const timespec, rem: ?&timespec) -> usize {
+ errnoWrap(c.nanosleep(req, rem))
+}
+
pub fn realpath(noalias filename: &const u8, noalias resolved_name: &u8) -> usize {
if (c.realpath(filename, resolved_name) == null) @bitCast(usize, -isize(*c._errno())) else 0
}
@@ -255,6 +259,8 @@ pub fn sigaction(sig: u5, noalias act: &const Sigaction, noalias oact: ?&Sigacti
pub const sigset_t = c.sigset_t;
pub const empty_sigset = sigset_t(0);
+pub const timespec = c.timespec;
+
/// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall.
pub const Sigaction = struct {
handler: extern fn(i32),