MCPcopy Create free account
hub / github.com/NetHack/NetHack / getwindowsz

Function getwindowsz

sys/share/ioctl.c:95–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93#endif /* AUX */
94
95void
96getwindowsz(void)
97{
98#ifdef USE_WIN_IOCTL
99 /*
100 * ttysize is found on Suns and BSD
101 * winsize is found on Suns, BSD, and Ultrix
102 */
103 struct winsize ttsz;
104
105 if (ioctl(fileno(stdin), (int) TIOCGWINSZ, (char *) &ttsz) != -1) {
106 /*
107 * Use the kernel's values for lines and columns if it has
108 * any idea.
109 */
110 if (ttsz.ws_row)
111 LI = ttsz.ws_row;
112 if (ttsz.ws_col)
113 CO = ttsz.ws_col;
114 }
115#endif
116}
117
118void
119getioctls(void)

Callers 1

getioctlsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected