terminal-util: add pty_open_peer() helper

This opens a pty peer in one go, and uses the new race-free TIOCGPTPEER
ioctl() to do so – if it is available.
This commit is contained in:
Lennart Poettering
2024-10-30 22:37:44 +01:00
parent fbd2679f66
commit fc9dc71a3f
3 changed files with 82 additions and 3 deletions
+3
View File
@@ -144,3 +144,6 @@ int terminal_get_size_by_dsr(int input_fd, int output_fd, unsigned *ret_rows, un
int terminal_fix_size(int input_fd, int output_fd);
int terminal_is_pty_fd(int fd);
int pty_open_peer_racefree(int fd, int mode);
int pty_open_peer(int fd, int mode);