File tree 3 files changed +51
-0
lines changed
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 {
115
115
fn as_raw_fd ( & self ) -> RawFd { 2 }
116
116
}
117
117
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
+
118
133
#[ stable( feature = "from_raw_os" , since = "1.1.0" ) ]
119
134
impl FromRawFd for net:: TcpStream {
120
135
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 {
95
95
impl AsRawFd for io:: Stderr {
96
96
fn as_raw_fd ( & self ) -> RawFd { libc:: STDERR_FILENO }
97
97
}
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 {
83
83
}
84
84
}
85
85
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
+
86
107
#[ stable( feature = "from_raw_os" , since = "1.1.0" ) ]
87
108
impl FromRawHandle for fs:: File {
88
109
unsafe fn from_raw_handle ( handle : RawHandle ) -> fs:: File {
You can’t perform that action at this time.
0 commit comments