File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,21 @@ impl AsRawFd for io::Stderr {
115115 fn as_raw_fd ( & self ) -> RawFd { 2 }
116116}
117117
118+ #[ stable( feature = "asraw_stdio_locks" , since = "1.35.0" ) ]
119+ impl < ' a > AsRawFd for io:: StdinLock < ' a > {
120+ fn as_raw_fd ( & self ) -> RawFd { 0 }
121+ }
122+
123+ #[ stable( feature = "asraw_stdio_locks" , since = "1.35.0" ) ]
124+ impl < ' a > AsRawFd for io:: StdoutLock < ' a > {
125+ fn as_raw_fd ( & self ) -> RawFd { 1 }
126+ }
127+
128+ #[ stable( feature = "asraw_stdio_locks" , since = "1.35.0" ) ]
129+ impl < ' a > AsRawFd for io:: StderrLock < ' a > {
130+ fn as_raw_fd ( & self ) -> RawFd { 2 }
131+ }
132+
118133#[ stable( feature = "from_raw_os" , since = "1.1.0" ) ]
119134impl FromRawFd for net:: TcpStream {
120135 unsafe fn from_raw_fd ( fd : RawFd ) -> net:: TcpStream {
Original file line number Diff line number Diff line change @@ -95,3 +95,18 @@ impl AsRawFd for io::Stdout {
9595impl AsRawFd for io:: Stderr {
9696 fn as_raw_fd ( & self ) -> RawFd { libc:: STDERR_FILENO }
9797}
98+
99+ #[ stable( feature = "asraw_stdio_locks" , since = "1.35.0" ) ]
100+ impl < ' a > AsRawFd for io:: StdinLock < ' a > {
101+ fn as_raw_fd ( & self ) -> RawFd { libc:: STDIN_FILENO }
102+ }
103+
104+ #[ stable( feature = "asraw_stdio_locks" , since = "1.35.0" ) ]
105+ impl < ' a > AsRawFd for io:: StdoutLock < ' a > {
106+ fn as_raw_fd ( & self ) -> RawFd { libc:: STDOUT_FILENO }
107+ }
108+
109+ #[ stable( feature = "asraw_stdio_locks" , since = "1.35.0" ) ]
110+ impl < ' a > AsRawFd for io:: StderrLock < ' a > {
111+ fn as_raw_fd ( & self ) -> RawFd { libc:: STDERR_FILENO }
112+ }
Original file line number Diff line number Diff line change @@ -83,6 +83,27 @@ impl AsRawHandle for io::Stderr {
8383 }
8484}
8585
86+ #[ stable( feature = "asraw_stdio_locks" , since = "1.35.0" ) ]
87+ impl < ' a > AsRawHandle for io:: StdinLock < ' a > {
88+ fn as_raw_handle ( & self ) -> RawHandle {
89+ unsafe { c:: GetStdHandle ( c:: STD_INPUT_HANDLE ) as RawHandle }
90+ }
91+ }
92+
93+ #[ stable( feature = "asraw_stdio_locks" , since = "1.35.0" ) ]
94+ impl < ' a > AsRawHandle for io:: StdoutLock < ' a > {
95+ fn as_raw_handle ( & self ) -> RawHandle {
96+ unsafe { c:: GetStdHandle ( c:: STD_OUTPUT_HANDLE ) as RawHandle }
97+ }
98+ }
99+
100+ #[ stable( feature = "asraw_stdio_locks" , since = "1.35.0" ) ]
101+ impl < ' a > AsRawHandle for io:: StderrLock < ' a > {
102+ fn as_raw_handle ( & self ) -> RawHandle {
103+ unsafe { c:: GetStdHandle ( c:: STD_ERROR_HANDLE ) as RawHandle }
104+ }
105+ }
106+
86107#[ stable( feature = "from_raw_os" , since = "1.1.0" ) ]
87108impl FromRawHandle for fs:: File {
88109 unsafe fn from_raw_handle ( handle : RawHandle ) -> fs:: File {
You can’t perform that action at this time.
0 commit comments