diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2025-04-15 10:36:51 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2025-04-15 10:36:51 -0400 |
commit | 0885d1e2839bb5a74fcec2107c9d1f061cb9c4a9 (patch) | |
tree | fb2b043b2ad955f6f0ee8e33ff346afec1000a0e /src/bfstd.c | |
parent | 99ee1a95551cd869c56f5ee0a07047a35e8900d6 (diff) | |
download | bfs-0885d1e2839bb5a74fcec2107c9d1f061cb9c4a9.tar.xz |
bfstd: Add a tcsetwinsize() polyfill
Diffstat (limited to 'src/bfstd.c')
-rw-r--r-- | src/bfstd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bfstd.c b/src/bfstd.c index 64cc605..4269d55 100644 --- a/src/bfstd.c +++ b/src/bfstd.c @@ -568,6 +568,14 @@ int xtcgetwinsize(int fd, struct winsize *ws) { #endif } +int xtcsetwinsize(int fd, const struct winsize *ws) { +#if BFS_HAS_TCSETWINSIZE + return tcsetwinsize(fd, ws); +#else + return ioctl(fd, TIOCSWINSZ, ws); +#endif +} + int dup_cloexec(int fd) { #ifdef F_DUPFD_CLOEXEC return fcntl(fd, F_DUPFD_CLOEXEC, 0); |