mirror of
https://github.com/llvm/llvm-project.git
synced 2026-10-26 13:53:31 +08:00
OpenBSD's posix_openpt() fails with EINVAL if any flag other than O_RDWR and O_NOCTTY is passed. ProcessLaunchInfo::SetUpPtyRedirection() passes O_CLOEXEC, so lldb-server could not launch a process with its stdio on a pseudo terminal, and the LLDBServerTests failed. On OpenBSD, open the primary without O_CLOEXEC and set FD_CLOEXEC with fcntl() afterwards. Add a unit test that opens a pseudo terminal with O_CLOEXEC.