From 6096dc5f94bf69cb73b0fc89d36bf125f7ff6467 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 14 Jul 2019 03:06:20 -0400 Subject: move some of the installation from cmake to zig build This moves the installation of shipped source files from large CMakeLists.txt lists to zig build recursive directory installation. On my computer a cmake `make install` takes 2.4 seconds even when it has to do nothing, and prints a lot of unnecessary lines to stdout that say "up-to-date: [some file it is installing]". After this commit, the default output of `make` is down to 1 second, and it does not print any junk to stdout. Further, a `make install` is no longer required and `make` is sufficient. This closes #2874. It also closes #2585. `make` now always invokes `zig build` for installing files and libuserland.a, and zig's own caching system makes that go fast. --- std/os/linux.zig | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'std/os/linux.zig') diff --git a/std/os/linux.zig b/std/os/linux.zig index 9d3746418f..053f30d265 100644 --- a/std/os/linux.zig +++ b/std/os/linux.zig @@ -94,6 +94,15 @@ pub inline fn vfork() usize { return @inlineCall(syscall0, SYS_vfork); } +pub fn futimens(fd: i32, times: *const [2]timespec) usize { + return utimensat(fd, null, times, 0); +} + +// TODO https://github.com/ziglang/zig/issues/265 +pub fn utimensat(dirfd: i32, path: ?[*]const u8, times: *const [2]timespec, flags: u32) usize { + return syscall4(SYS_utimensat, @bitCast(usize, isize(dirfd)), @ptrToInt(path), @ptrToInt(times), flags); +} + pub fn futex_wait(uaddr: *const i32, futex_op: u32, val: i32, timeout: ?*timespec) usize { return syscall4(SYS_futex, @ptrToInt(uaddr), futex_op, @bitCast(u32, val), @ptrToInt(timeout)); } -- cgit v1.2.3