diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-04-02 18:19:59 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-04-02 18:19:59 -0400 |
| commit | 8fd0fddce5d44344dd7914ae86a4d976b99f9cc3 (patch) | |
| tree | 69d6a1b6e32e8c8a622eb149c0e60f33f426996d /std/io.zig | |
| parent | 0594487a2e98e18a18c0c6bdb2532c5e36fc6ea7 (diff) | |
| download | zig-8fd0fddce5d44344dd7914ae86a4d976b99f9cc3.tar.gz zig-8fd0fddce5d44344dd7914ae86a4d976b99f9cc3.zip | |
zig build system progress
* In-progress os.ChildProcess.spawn implementation. See #204
* Add explicit cast from integer to error. Closes #294
* fix casting from error to integer
* fix compiler crash when initializing variable to undefined
with no type
Diffstat (limited to 'std/io.zig')
| -rw-r--r-- | std/io.zig | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/std/io.zig b/std/io.zig index 109ed4072e..89b3a8c21f 100644 --- a/std/io.zig +++ b/std/io.zig @@ -13,22 +13,18 @@ const mem = @import("mem.zig"); const Buffer0 = @import("cstr.zig").Buffer0; const fmt = @import("fmt.zig"); -pub const stdin_fileno = 0; -pub const stdout_fileno = 1; -pub const stderr_fileno = 2; - pub var stdin = InStream { - .fd = stdin_fileno, + .fd = system.STDIN_FILENO, }; pub var stdout = OutStream { - .fd = stdout_fileno, + .fd = system.STDOUT_FILENO, .buffer = undefined, .index = 0, }; pub var stderr = OutStream { - .fd = stderr_fileno, + .fd = system.STDERR_FILENO, .buffer = undefined, .index = 0, }; @@ -234,7 +230,6 @@ pub const InStream = struct { if (read_err > 0) { switch (read_err) { errno.EINTR => continue, - errno.EINVAL => unreachable, errno.EFAULT => unreachable, errno.EBADF => return error.BadFd, @@ -247,7 +242,7 @@ pub const InStream = struct { } return index; }, - else => @compileError("unsupported OS"), + else => @compileError("Unsupported OS"), } } |
