diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-04-10 15:00:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-10 15:00:45 -0400 |
| commit | a6e288d5fe51d5373fa995b5eec2dd2325c1ea9f (patch) | |
| tree | 583c2fbf0a708c222e3cc7a493f93b0a2e9da16b /lib/std/os/linux.zig | |
| parent | 121307679bd1ffeaa8a290a826396662f26a4ac1 (diff) | |
| parent | 5951211d3fc348fc37a86abc9906acf4ee796883 (diff) | |
| download | zig-a6e288d5fe51d5373fa995b5eec2dd2325c1ea9f.tar.gz zig-a6e288d5fe51d5373fa995b5eec2dd2325c1ea9f.zip | |
Merge pull request #4711 from leroycep/feature-file-locks
Add lock option to File.OpenFlags and File.CreateFlags
Diffstat (limited to 'lib/std/os/linux.zig')
| -rw-r--r-- | lib/std/os/linux.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig index 1ed8370274..87ee198985 100644 --- a/lib/std/os/linux.zig +++ b/lib/std/os/linux.zig @@ -592,6 +592,10 @@ pub fn fcntl(fd: fd_t, cmd: i32, arg: usize) usize { return syscall3(.fcntl, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, cmd)), arg); } +pub fn flock(fd: fd_t, operation: i32) usize { + return syscall2(.flock, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, operation))); +} + var vdso_clock_gettime = @ptrCast(?*const c_void, init_vdso_clock_gettime); // We must follow the C calling convention when we call into the VDSO |
