@@ -45,8 +45,8 @@ public struct StandardIOMessageConnection: MessageConnection {
4545 /// directly to `stdin` and `stdout` as WASI doesn't support
4646 /// `dup{,2}`.
4747 public init ( ) throws {
48- let inputFD = fileno ( _stdin )
49- let outputFD = fileno ( _stdout )
48+ let inputFD = fileno ( swift_syntax_stdin )
49+ let outputFD = fileno ( swift_syntax_stdout )
5050 self . init ( inputFileDescriptor: inputFD, outputFileDescriptor: outputFD)
5151 }
5252 #else
@@ -60,29 +60,29 @@ public struct StandardIOMessageConnection: MessageConnection {
6060 public init ( ) throws {
6161 // Duplicate the `stdin` file descriptor, which we will then use for
6262 // receiving messages from the plugin host.
63- let inputFD = dup ( fileno ( _stdin ) )
63+ let inputFD = dup ( fileno ( swift_syntax_stdin ) )
6464 guard inputFD >= 0 else {
65- throw IOError . systemError ( function: " dup(fileno(stdin)) " , errno: _errno )
65+ throw IOError . systemError ( function: " dup(fileno(stdin)) " , errno: swift_syntax_errno )
6666 }
6767
6868 // Having duplicated the original standard-input descriptor, we close
6969 // `stdin` so that attempts by the plugin to read console input (which
7070 // are usually a mistake) return errors instead of blocking.
71- guard close ( fileno ( _stdin ) ) >= 0 else {
72- throw IOError . systemError ( function: " close(fileno(stdin)) " , errno: _errno )
71+ guard close ( fileno ( swift_syntax_stdin ) ) >= 0 else {
72+ throw IOError . systemError ( function: " close(fileno(stdin)) " , errno: swift_syntax_errno )
7373 }
7474
7575 // Duplicate the `stdout` file descriptor, which we will then use for
7676 // sending messages to the plugin host.
77- let outputFD = dup ( fileno ( _stdout ) )
77+ let outputFD = dup ( fileno ( swift_syntax_stdout ) )
7878 guard outputFD >= 0 else {
79- throw IOError . systemError ( function: " dup(fileno(stdout)) " , errno: _errno )
79+ throw IOError . systemError ( function: " dup(fileno(stdout)) " , errno: swift_syntax_errno )
8080 }
8181
8282 // Having duplicated the original standard-output descriptor, redirect
8383 // `stdout` to `stderr` so that all free-form text output goes there.
84- guard dup2 ( fileno ( _stderr ) , fileno ( _stdout ) ) >= 0 else {
85- throw IOError . systemError ( function: " dup2(fileno(stderr), fileno(stdout)) " , errno: _errno )
84+ guard dup2 ( fileno ( swift_syntax_stderr ) , fileno ( swift_syntax_stdout ) ) >= 0 else {
85+ throw IOError . systemError ( function: " dup2(fileno(stderr), fileno(stdout)) " , errno: swift_syntax_errno )
8686 }
8787
8888 #if canImport(ucrt)
@@ -101,7 +101,7 @@ public struct StandardIOMessageConnection: MessageConnection {
101101 let endPtr = ptr. advanced ( by: buffer. count)
102102 while ptr != endPtr {
103103 switch write ( outputFileDescriptor, ptr, numericCast ( endPtr - ptr) ) {
104- case - 1 : throw IOError . systemError ( function: " write(_:_:_:) " , errno: _errno )
104+ case - 1 : throw IOError . systemError ( function: " write(_:_:_:) " , errno: swift_syntax_errno )
105105 case 0 : throw IOError . systemError ( function: " write " , errno: 0 ) /* unreachable */
106106 case let n: ptr += Int ( n)
107107 }
@@ -116,7 +116,7 @@ public struct StandardIOMessageConnection: MessageConnection {
116116 let endPtr = ptr. advanced ( by: buffer. count)
117117 while ptr != endPtr {
118118 switch read ( inputFileDescriptor, ptr, numericCast ( endPtr - ptr) ) {
119- case - 1 : throw IOError . systemError ( function: " read(_:_:_:) " , errno: _errno )
119+ case - 1 : throw IOError . systemError ( function: " read(_:_:_:) " , errno: swift_syntax_errno )
120120 case 0 : throw IOError . readReachedEndOfInput
121121 case let n: ptr += Int ( n)
122122 }
0 commit comments