11use fortanix_sgx_abi as abi;
22
3- use crate :: io;
3+ use crate :: io:: { self , BorrowedCursor , IoSlice , IoSliceMut } ;
44#[ cfg( not( test) ) ]
55use crate :: slice;
66#[ cfg( not( test) ) ]
@@ -28,6 +28,19 @@ impl io::Read for Stdin {
2828 fn read ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < usize > {
2929 with_std_fd ( abi:: FD_STDIN , |fd| fd. read ( buf) )
3030 }
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+ }
3144}
3245
3346impl Stdout {
@@ -44,6 +57,15 @@ impl io::Write for Stdout {
4457 fn flush ( & mut self ) -> io:: Result < ( ) > {
4558 with_std_fd ( abi:: FD_STDOUT , |fd| fd. flush ( ) )
4659 }
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+ }
4769}
4870
4971impl Stderr {
@@ -60,6 +82,15 @@ impl io::Write for Stderr {
6082 fn flush ( & mut self ) -> io:: Result < ( ) > {
6183 with_std_fd ( abi:: FD_STDERR , |fd| fd. flush ( ) )
6284 }
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+ }
6394}
6495
6596pub const STDIN_BUF_SIZE : usize = crate :: sys:: io:: DEFAULT_BUF_SIZE ;
0 commit comments