Kernel: Move struct winsize definition to API/POSIX/termios.h

POSIX requires it to be defined in this header:
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/termios.h.html
"The <termios.h> header shall define the winsize structure, [...]"

This unbreaks the readline port after 8e34c970b5, which made it
use tc{get,set}winsize() instead of the ioctl.
Previously, it failed to compile with a -Wincompatible-pointer-types
warning:

"expected 'struct winsize *' but argument is of type 'struct winsize *'"

ioctl() takes the argument as a vararg, so it didn't trigger this
warning.
This commit is contained in:
Sönke Holz authored and Nico Weber committed 2026-11-03 13:18:30 -05:00
1 parent d85d1a984f
commit 312b4440bf
2 files changed
+8 -7

No files matched your search

-7
View File
@@ -11,13 +11,6 @@
extern "C" {
#endif
struct winsize {
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel;
unsigned short ws_ypixel;
};
struct GraphicsConnectorProperties {
unsigned char multihead_support;
unsigned char doublebuffer_support;
+8
View File
@@ -28,6 +28,14 @@ struct termios {
speed_t c_ospeed;
};
// https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/termios.h.html#tag_14_77_03_07
struct winsize {
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel;
unsigned short ws_ypixel;
};
/* c_cc characters */
#define VINTR 0
#define VQUIT 1