libroot: add tcgetwinsize() and tcsetwinsize() for POSIX.1/2024

Change-Id: I46c0b7b5b9c8e7c74278a6e10e9b83142db21d94
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8520
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Jérôme Duval 2024-11-04 18:48:50 +01:00 committed by waddlesplash
parent 7a4e12b7b8
commit 7190c0f117
2 changed files with 15 additions and 0 deletions

View File

@ -234,6 +234,8 @@ extern int tcflow(int fd, int action);
extern int tcflush(int fd, int queueSelector);
extern pid_t tcgetsid(int fd);
extern int tcsetsid(int fd, pid_t pid);
extern int tcgetwinsize(int fd, struct winsize* winsize);
extern int tcsetwinsize(int fd, const struct winsize* winsize);
#ifdef __cplusplus
}

View File

@ -194,3 +194,16 @@ tcsetsid(int fd, pid_t pid)
return ioctl(fd, TIOCSCTTY, NULL);
}
int
tcgetwinsize(int fd, struct winsize* winsize)
{
return ioctl(fd, TIOCGWINSZ, winsize, sizeof(*winsize));
}
int
tcsetwinsize(int fd, const struct winsize* winsize)
{
return ioctl(fd, TIOCSWINSZ, winsize, sizeof(*winsize));
}