aboutsummaryrefslogtreecommitdiff
path: root/std/os/linux.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-04-17 02:58:42 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-04-17 06:47:20 -0400
commit47336abae3992ef343bd9cb6099b89bad1dfb634 (patch)
tree4b05465b2d964d8110b9c912b81d82d6dfcada19 /std/os/linux.zig
parentd16ce67106796011706e9f3653bb843c21c9d708 (diff)
downloadzig-47336abae3992ef343bd9cb6099b89bad1dfb634.tar.gz
zig-47336abae3992ef343bd9cb6099b89bad1dfb634.zip
improvements to zig build system and unwrap error safety
* zig build system: create standard dynamic library sym links * unwrapping an error results in a panic message that contains the error name * rename error.SysResources to error.SystemResources * add std.os.symLink * add std.os.deleteFile
Diffstat (limited to 'std/os/linux.zig')
-rw-r--r--std/os/linux.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/std/os/linux.zig b/std/os/linux.zig
index 640a915b77..2214fb8dd1 100644
--- a/std/os/linux.zig
+++ b/std/os/linux.zig
@@ -287,6 +287,10 @@ pub fn read(fd: i32, buf: &u8, count: usize) -> usize {
arch.syscall3(arch.SYS_read, usize(fd), usize(buf), count)
}
+pub fn symlink(existing: &const u8, new: &const u8) -> usize {
+ arch.syscall2(arch.SYS_symlink, usize(existing), usize(new))
+}
+
pub fn pread(fd: i32, buf: &u8, count: usize, offset: usize) -> usize {
arch.syscall4(arch.SYS_pread, usize(fd), usize(buf), count, offset)
}
@@ -340,6 +344,10 @@ pub fn kill(pid: i32, sig: i32) -> usize {
arch.syscall2(arch.SYS_kill, usize(pid), usize(sig))
}
+pub fn unlink(path: &const u8) -> usize {
+ arch.syscall1(arch.SYS_unlink, usize(path))
+}
+
pub fn waitpid(pid: i32, status: &i32, options: i32) -> usize {
arch.syscall4(arch.SYS_wait4, usize(pid), usize(status), usize(options), 0)
}