using ioctl() to get window-size

Dave Decot decot at hpisod2.HP.COM
Wed Oct 3 11:26:15 AEST 1990


> I have a program that wants to get the current window size of the terminal
> (the number of rows and columns).  I would like to do this using ioctl().
> I know that POSIX compliant systems (and some POSIX conforming hopefuls)
> have a TIOCGWINSZ mask for ioctl(). This works just fine and dandy. Is

POSIX compliant systems need not even have a function called ioctl(),
much less any TIOCGWINSZ functionality available through it.

> there some other way to get this info from ioctl other than via TIOCGWINSZ??
> If so, how portable is it (AT&T only? BSD only? SunOS only? ...)?

For those systems that have this capability, that's about the most common
way to do it.  It appears to be mostly on systems derived from SunOS
(such as System VR3).

Dave Decot



More information about the Comp.unix.questions mailing list