diff options
| author | Chris Heyes <rumcode@icloud.com> | 2020-05-02 19:14:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-02 14:14:46 -0400 |
| commit | 8ebcca6734e07aea29098ca4c63c0216b3099d0e (patch) | |
| tree | 37f85f4c35f3107da778958ee2cedbe51192b03c /lib/std/os.zig | |
| parent | 33705d06bb7025813422a7104c24370f0a29dd75 (diff) | |
| download | zig-8ebcca6734e07aea29098ca4c63c0216b3099d0e.tar.gz zig-8ebcca6734e07aea29098ca4c63c0216b3099d0e.zip | |
Get evented io code paths to build on macOS (#5233)
* Get evented io code paths to build on macOS
* Use mode_t instead of usize where appropriate
Diffstat (limited to 'lib/std/os.zig')
| -rw-r--r-- | lib/std/os.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig index 9502e8d9df..5a502035d5 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -374,7 +374,7 @@ pub fn readv(fd: fd_t, iov: []const iovec) ReadError!usize { const first = iov[0]; return read(fd, first.iov_base[0..first.iov_len]); } - + const iov_count = math.cast(u31, iov.len) catch math.maxInt(u31); while (true) { // TODO handle the case when iov_len is too large and get rid of this @intCast @@ -859,7 +859,7 @@ pub const OpenError = error{ /// Open and possibly create a file. Keeps trying if it gets interrupted. /// See also `openC`. /// TODO support windows -pub fn open(file_path: []const u8, flags: u32, perm: usize) OpenError!fd_t { +pub fn open(file_path: []const u8, flags: u32, perm: mode_t) OpenError!fd_t { const file_path_c = try toPosixPath(file_path); return openZ(&file_path_c, flags, perm); } @@ -869,7 +869,7 @@ pub const openC = @compileError("deprecated: renamed to openZ"); /// Open and possibly create a file. Keeps trying if it gets interrupted. /// See also `open`. /// TODO support windows -pub fn openZ(file_path: [*:0]const u8, flags: u32, perm: usize) OpenError!fd_t { +pub fn openZ(file_path: [*:0]const u8, flags: u32, perm: mode_t) OpenError!fd_t { while (true) { const rc = system.open(file_path, flags, perm); switch (errno(rc)) { |
