This functionality is needed according to POSIX. Additionally, some
logic had to be changed in order for the ptsname to be correct for the
manager terminal (ptmx). If you want to obtain a pty, you must go
through the `posix_openpt`-`grantpt`-`unlockpt`-`ptsname`-`open`
process. Alternatively, relibc as a function called `openpty`.
This is part of my ptyd series. This can be safely merged once the MRs
for relibc/ and userutils/ are merged at the same time.
EOF used to be triggered by unmounting a scheme, but this is no longer
the case since namespaces got moved to userspace. Unmounting now only
closes the scheme root fd.
Pty::path is a manual implementation of write! that also allocates.
Using write! avoids the alloc and is simpler too.
The original function didn't return an error even if called with a small
buffer and this version preserves that.
This is a POSIX extension to disable control chars when set in the c_cc
array. Fish and other programs use it.
See:
* redox-os/relibc!689
* redox-os/termios!3