diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-09-06 16:59:22 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-09-06 16:59:22 -0400 |
| commit | 7e59f4ff69f9a8634c4e8d49cea95a3b55dbe771 (patch) | |
| tree | 36535ecb427b8ef23e884965703a7198bd7cd797 /std/os/linux.zig | |
| parent | 1f2548ec5f19bf2e7ab66b0349f4953499897b10 (diff) | |
| download | zig-7e59f4ff69f9a8634c4e8d49cea95a3b55dbe771.tar.gz zig-7e59f4ff69f9a8634c4e8d49cea95a3b55dbe771.zip | |
std: add os.sleep
Diffstat (limited to 'std/os/linux.zig')
| -rw-r--r-- | std/os/linux.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/std/os/linux.zig b/std/os/linux.zig index 903548ef09..d57e966ab5 100644 --- a/std/os/linux.zig +++ b/std/os/linux.zig @@ -459,6 +459,10 @@ pub fn waitpid(pid: i32, status: &i32, options: i32) -> usize { arch.syscall4(arch.SYS_wait4, usize(pid), @ptrToInt(status), @bitCast(usize, isize(options)), 0) } +pub fn nanosleep(req: &const timespec, rem: ?×pec) -> usize { + arch.syscall2(arch.SYS_nanosleep, @ptrToInt(req), @ptrToInt(rem)) +} + const NSIG = 65; const sigset_t = [128]u8; const all_mask = []u8 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; |
