| author | |
| committer | |
| log | cd5f4de2a684ab0a3383ff328516243a6e850201 |
| tree | a421b07b96689a975091f941e94f0d3f3bac0740 |
| parent | bf1cbebea1fd846c982e568ef4f013dfaf232e3e |
| signature |
5 files changed, 12 insertions(+), 8 deletions(-)
lib/std/event/fs.zig+6-3| ... | @@ -415,7 +415,8 @@ pub fn openPosix( | ... | @@ -415,7 +415,8 @@ pub fn openPosix( |
| 415 | pub fn openRead(loop: *Loop, path: []const u8) File.OpenError!fd_t { | 415 | pub fn openRead(loop: *Loop, path: []const u8) File.OpenError!fd_t { |
| 416 | switch (builtin.os) { | 416 | switch (builtin.os) { |
| 417 | .macosx, .linux, .freebsd, .netbsd, .dragonfly => { | 417 | .macosx, .linux, .freebsd, .netbsd, .dragonfly => { |
| 418 | const flags = os.O_LARGEFILE | os.O_RDONLY | os.O_CLOEXEC; | 418 | const O_LARGEFILE = if (@hasDecl(os, "O_LARGEFILE")) os.O_LARGEFILE else 0; |
| 419 | const flags = O_LARGEFILE | os.O_RDONLY | os.O_CLOEXEC; | ||
| 419 | return openPosix(loop, path, flags, File.default_mode); | 420 | return openPosix(loop, path, flags, File.default_mode); |
| 420 | }, | 421 | }, |
| 421 | 422 | ||
| ... | @@ -448,7 +449,8 @@ pub fn openWriteMode(loop: *Loop, path: []const u8, mode: File.Mode) File.OpenEr | ... | @@ -448,7 +449,8 @@ pub fn openWriteMode(loop: *Loop, path: []const u8, mode: File.Mode) File.OpenEr |
| 448 | .netbsd, | 449 | .netbsd, |
| 449 | .dragonfly, | 450 | .dragonfly, |
| 450 | => { | 451 | => { |
| 451 | const flags = os.O_LARGEFILE | os.O_WRONLY | os.O_CREAT | os.O_CLOEXEC | os.O_TRUNC; | 452 | const O_LARGEFILE = if (@hasDecl(os, "O_LARGEFILE")) os.O_LARGEFILE else 0; |
| 453 | const flags = O_LARGEFILE | os.O_WRONLY | os.O_CREAT | os.O_CLOEXEC | os.O_TRUNC; | ||
| 452 | return openPosix(loop, path, flags, File.default_mode); | 454 | return openPosix(loop, path, flags, File.default_mode); |
| 453 | }, | 455 | }, |
| 454 | .windows => return windows.CreateFile( | 456 | .windows => return windows.CreateFile( |
| ... | @@ -472,7 +474,8 @@ pub fn openReadWrite( | ... | @@ -472,7 +474,8 @@ pub fn openReadWrite( |
| 472 | ) File.OpenError!fd_t { | 474 | ) File.OpenError!fd_t { |
| 473 | switch (builtin.os) { | 475 | switch (builtin.os) { |
| 474 | .macosx, .linux, .freebsd, .netbsd, .dragonfly => { | 476 | .macosx, .linux, .freebsd, .netbsd, .dragonfly => { |
| 475 | const flags = os.O_LARGEFILE | os.O_RDWR | os.O_CREAT | os.O_CLOEXEC; | 477 | const O_LARGEFILE = if (@hasDecl(os, "O_LARGEFILE")) os.O_LARGEFILE else 0; |
| 478 | const flags = O_LARGEFILE | os.O_RDWR | os.O_CREAT | os.O_CLOEXEC; | ||
| 476 | return openPosix(loop, path, flags, mode); | 479 | return openPosix(loop, path, flags, mode); |
| 477 | }, | 480 | }, |
| 478 | 481 |
lib/std/event/loop.zig+2-1| ... | @@ -856,7 +856,8 @@ pub const Loop = struct { | ... | @@ -856,7 +856,8 @@ pub const Loop = struct { |
| 856 | }, | 856 | }, |
| 857 | .Close => |*msg| noasync os.close(msg.fd), | 857 | .Close => |*msg| noasync os.close(msg.fd), |
| 858 | .WriteFile => |*msg| blk: { | 858 | .WriteFile => |*msg| blk: { |
| 859 | const flags = os.O_LARGEFILE | os.O_WRONLY | os.O_CREAT | | 859 | const O_LARGEFILE = if (@hasDecl(os, "O_LARGEFILE")) os.O_LARGEFILE else 0; |
| 860 | const flags = O_LARGEFILE | os.O_WRONLY | os.O_CREAT | | ||
| 860 | os.O_CLOEXEC | os.O_TRUNC; | 861 | os.O_CLOEXEC | os.O_TRUNC; |
| 861 | const fd = noasync os.openC(msg.path.ptr, flags, msg.mode) catch |err| { | 862 | const fd = noasync os.openC(msg.path.ptr, flags, msg.mode) catch |err| { |
| 862 | msg.result = err; | 863 | msg.result = err; |
lib/std/fs/file.zig+4-2| ... | @@ -66,7 +66,8 @@ pub const File = struct { | ... | @@ -66,7 +66,8 @@ pub const File = struct { |
| 66 | const path_w = try windows.cStrToPrefixedFileW(path); | 66 | const path_w = try windows.cStrToPrefixedFileW(path); |
| 67 | return openWriteModeW(&path_w, file_mode); | 67 | return openWriteModeW(&path_w, file_mode); |
| 68 | } | 68 | } |
| 69 | const flags = os.O_LARGEFILE | os.O_WRONLY | os.O_CREAT | os.O_CLOEXEC | os.O_TRUNC; | 69 | const O_LARGEFILE = if (@hasDecl(os, "O_LARGEFILE")) os.O_LARGEFILE else 0; |
| 70 | const flags = O_LARGEFILE | os.O_WRONLY | os.O_CREAT | os.O_CLOEXEC | os.O_TRUNC; | ||
| 70 | const fd = try os.openC(path, flags, file_mode); | 71 | const fd = try os.openC(path, flags, file_mode); |
| 71 | return openHandle(fd); | 72 | return openHandle(fd); |
| 72 | } | 73 | } |
| ... | @@ -105,7 +106,8 @@ pub const File = struct { | ... | @@ -105,7 +106,8 @@ pub const File = struct { |
| 105 | const path_w = try windows.cStrToPrefixedFileW(path); | 106 | const path_w = try windows.cStrToPrefixedFileW(path); |
| 106 | return openWriteNoClobberW(&path_w, file_mode); | 107 | return openWriteNoClobberW(&path_w, file_mode); |
| 107 | } | 108 | } |
| 108 | const flags = os.O_LARGEFILE | os.O_WRONLY | os.O_CREAT | os.O_CLOEXEC | os.O_EXCL; | 109 | const O_LARGEFILE = if (@hasDecl(os, "O_LARGEFILE")) os.O_LARGEFILE else 0; |
| 110 | const flags = O_LARGEFILE | os.O_WRONLY | os.O_CREAT | os.O_CLOEXEC | os.O_EXCL; | ||
| 109 | const fd = try os.openC(path, flags, file_mode); | 111 | const fd = try os.openC(path, flags, file_mode); |
| 110 | return openHandle(fd); | 112 | return openHandle(fd); |
| 111 | } | 113 | } |
lib/std/os/bits/darwin.zig-1| ... | @@ -267,7 +267,6 @@ pub const SA_USERTRAMP = 0x0100; | ... | @@ -267,7 +267,6 @@ pub const SA_USERTRAMP = 0x0100; |
| 267 | /// signal handler with SA_SIGINFO args with 64bit regs information | 267 | /// signal handler with SA_SIGINFO args with 64bit regs information |
| 268 | pub const SA_64REGSET = 0x0200; | 268 | pub const SA_64REGSET = 0x0200; |
| 269 | 269 | ||
| 270 | pub const O_LARGEFILE = 0x0000; | ||
| 271 | pub const O_PATH = 0x0000; | 270 | pub const O_PATH = 0x0000; |
| 272 | 271 | ||
| 273 | pub const F_OK = 0; | 272 | pub const F_OK = 0; |
lib/std/os/bits/netbsd.zig-1| ... | @@ -292,7 +292,6 @@ pub const O_CLOEXEC = 0x00400000; | ... | @@ -292,7 +292,6 @@ pub const O_CLOEXEC = 0x00400000; |
| 292 | 292 | ||
| 293 | pub const O_ASYNC = 0x0040; | 293 | pub const O_ASYNC = 0x0040; |
| 294 | pub const O_DIRECT = 0x00080000; | 294 | pub const O_DIRECT = 0x00080000; |
| 295 | pub const O_LARGEFILE = 0; | ||
| 296 | pub const O_NOATIME = 0; | 295 | pub const O_NOATIME = 0; |
| 297 | pub const O_PATH = 0; | 296 | pub const O_PATH = 0; |
| 298 | pub const O_TMPFILE = 0; | 297 | pub const O_TMPFILE = 0; |