On e.g. Alpine Linux, the following are set by configure:
bash_cv_struct_winsize_ioctl='yes'
bash_cv_struct_winsize_termios='yes'
bash_cv_struct_winsize_header='ioctl_h'
ac_cv_func_tcgetwinsize='yes'
and so config.h ends up with:
#define STRUCT_WINSIZE_IN_SYS_IOCTL 1
/* #undef STRUCT_WINSIZE_IN_TERMIOS */
#define HAVE_TCGETWINSIZE 1
This causes termios.h to not get included by lib/sh/winsize.c:
#if defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined
(STRUCT_WINSIZE_IN_SYS_IOCTL)
# include <termios.h>
#endif
and a build failure:
winsize.c:95:20: error: call to undeclared function 'tcgetwinsize'; ISO C99
and later do not support implicit function declarations
[-Wimplicit-function-declaration]
95 | if (tty >= 0 && (tcgetwinsize (tty, &win) == 0) && win.ws_row > 0
&& win.ws_col > 0)
| ^