Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.sysv386 Subject: Re: TIOCGWINSZ on SCO UNIX 3.2 Message-ID: <4679@auspex.auspex.com> Date: 4 Dec 90 20:29:48 GMT References: <9414@statware.UUCP> Distribution: na Organization: Auspex Systems, Santa Clara Lines: 27 > if (ioctl(0, TIOCGWINSZ, &xwin) == 0) ... >So far all I get is an errno of 22. *Sigh* time for another "egrep", 'cuz I sure haven't memorized the UNIX error numbers: auspex% egrep 22 /usr/include/sys/errno.h #define EINVAL 22 /* Invalid argument */ OK, there we go. EINVAL on an "ioctl()" call tends to indicate that the object on which you did the "ioctl()" doesn't support it. S5R3-ish systems *tend* not to support it on anything other than pseudo-ttys; are you doing this on a pseudo-tty, or on a real terminal (or perhaps on a "virtual terminal" or whatever the multiscreen thingies on 386 UNIXes are called)? If not, you may be stuck. >This code works fine on many other systems (different include files >though) such as Sun, HP, IBM RS/6000, DG AViiON, etc. Most of those systems probably adopted TIOCGWINSZ from BSD; you may also be using a window system terminal emulator or a remote login on those systems, in which case you'd probably be on a pseudo-tty. BSD didn't restrict TIOCGWINSZ to pseudo-ttys.