1818
1919const std = @import ("std" );
2020const builtin = @import ("builtin" );
21- const os = std .os ;
21+ const posix = std .posix ;
2222const io = std .io ;
2323const assert = std .debug .assert ;
2424
@@ -28,15 +28,15 @@ pub const Stream = struct {
2828 alloc : std.mem.Allocator ,
2929 conn : * tcp.Conn ,
3030
31- handle : std.os .socket_t ,
31+ handle : posix .socket_t ,
3232
3333 pub fn close (self : Stream ) void {
34- os .closeSocket (self .handle );
34+ posix .closeSocket (self .handle );
3535 self .alloc .destroy (self .conn );
3636 }
3737
38- pub const ReadError = os .ReadError ;
39- pub const WriteError = os .WriteError ;
38+ pub const ReadError = posix .ReadError ;
39+ pub const WriteError = posix .WriteError ;
4040
4141 pub const Reader = io .Reader (Stream , ReadError , read );
4242 pub const Writer = io .Writer (Stream , WriteError , write );
@@ -55,8 +55,8 @@ pub const Stream = struct {
5555 };
5656 }
5757
58- pub fn readv (s : Stream , iovecs : []const os .iovec ) ReadError ! usize {
59- return os .readv (s .handle , iovecs );
58+ pub fn readv (s : Stream , iovecs : []const posix .iovec ) ReadError ! usize {
59+ return posix .readv (s .handle , iovecs );
6060 }
6161
6262 /// Returns the number of bytes read. If the number read is smaller than
@@ -105,7 +105,7 @@ pub const Stream = struct {
105105
106106 /// See https://github.com/ziglang/zig/issues/7699
107107 /// See equivalent function: `std.fs.File.writev`.
108- pub fn writev (self : Stream , iovecs : []const os .iovec_const ) WriteError ! usize {
108+ pub fn writev (self : Stream , iovecs : []const posix .iovec_const ) WriteError ! usize {
109109 if (iovecs .len == 0 ) return 0 ;
110110 const first_buffer = iovecs [0 ].iov_base [0.. iovecs [0 ].iov_len ];
111111 return try self .write (first_buffer );
@@ -115,7 +115,7 @@ pub const Stream = struct {
115115 /// order to handle partial writes from the underlying OS layer.
116116 /// See https://github.com/ziglang/zig/issues/7699
117117 /// See equivalent function: `std.fs.File.writevAll`.
118- pub fn writevAll (self : Stream , iovecs : []os .iovec_const ) WriteError ! void {
118+ pub fn writevAll (self : Stream , iovecs : []posix .iovec_const ) WriteError ! void {
119119 if (iovecs .len == 0 ) return ;
120120
121121 var i : usize = 0 ;
0 commit comments