1
1
use fortanix_sgx_abi as abi;
2
2
3
- use crate :: io;
3
+ use crate :: io:: { self , BorrowedCursor , IoSlice , IoSliceMut } ;
4
4
#[ cfg( not( test) ) ]
5
5
use crate :: slice;
6
6
#[ cfg( not( test) ) ]
@@ -28,6 +28,19 @@ impl io::Read for Stdin {
28
28
fn read ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < usize > {
29
29
with_std_fd ( abi:: FD_STDIN , |fd| fd. read ( buf) )
30
30
}
31
+
32
+ fn read_buf ( & mut self , buf : BorrowedCursor < ' _ > ) -> io:: Result < ( ) > {
33
+ with_std_fd ( abi:: FD_STDIN , |fd| fd. read_buf ( buf) )
34
+ }
35
+
36
+ fn read_vectored ( & mut self , bufs : & mut [ IoSliceMut < ' _ > ] ) -> io:: Result < usize > {
37
+ with_std_fd ( abi:: FD_STDIN , |fd| fd. read_vectored ( bufs) )
38
+ }
39
+
40
+ #[ inline]
41
+ fn is_read_vectored ( & self ) -> bool {
42
+ true
43
+ }
31
44
}
32
45
33
46
impl Stdout {
@@ -44,6 +57,15 @@ impl io::Write for Stdout {
44
57
fn flush ( & mut self ) -> io:: Result < ( ) > {
45
58
with_std_fd ( abi:: FD_STDOUT , |fd| fd. flush ( ) )
46
59
}
60
+
61
+ fn write_vectored ( & mut self , bufs : & [ IoSlice < ' _ > ] ) -> io:: Result < usize > {
62
+ with_std_fd ( abi:: FD_STDOUT , |fd| fd. write_vectored ( bufs) )
63
+ }
64
+
65
+ #[ inline]
66
+ fn is_write_vectored ( & self ) -> bool {
67
+ true
68
+ }
47
69
}
48
70
49
71
impl Stderr {
@@ -60,6 +82,15 @@ impl io::Write for Stderr {
60
82
fn flush ( & mut self ) -> io:: Result < ( ) > {
61
83
with_std_fd ( abi:: FD_STDERR , |fd| fd. flush ( ) )
62
84
}
85
+
86
+ fn write_vectored ( & mut self , bufs : & [ IoSlice < ' _ > ] ) -> io:: Result < usize > {
87
+ with_std_fd ( abi:: FD_STDERR , |fd| fd. write_vectored ( bufs) )
88
+ }
89
+
90
+ #[ inline]
91
+ fn is_write_vectored ( & self ) -> bool {
92
+ true
93
+ }
63
94
}
64
95
65
96
pub const STDIN_BUF_SIZE : usize = crate :: sys:: io:: DEFAULT_BUF_SIZE ;
0 commit comments