Skip to content

Commit 57e2434

Browse files
committed
VirtualTerminal: adjust write syscall handling on GNU
When building against the GNU Linux environment, `unistd` is not a valid submodule, so update the `write` syscall spelling to `Glibc.write` instead of the Darwin `unistd.write`.
1 parent e752e14 commit 57e2434

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/VirtualTerminal/Platform/POSIXTerminal.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,11 @@ internal final actor POSIXTerminal: VTTerminal {
278278
/// - Screen clearing and scrolling commands
279279
/// - Other VT100/ANSI control sequences
280280
public func write(_ string: String) {
281+
#if GNU
282+
_ = Glibc.write(self.hOut, string, string.utf8.count)
283+
#else
281284
_ = unistd.write(self.hOut, string, string.utf8.count)
285+
#endif
282286
}
283287
}
284288

0 commit comments

Comments
 (0)