[comp.unix.i386] TIOCGWINSZ & SIGWINCH: who needs 'em?

john@jwt.UUCP (John Temples) (08/22/90)

While compiling a new software package (trn), I was again stung by
the fact that the definition of TIOCGWINSZ in my ESIX system led the
software to believe I had "struct winsize" defined.  Other incorrect
assumptions were made based on the definition of SIGWINCH.  I ended
up having to edit the source files and #undef these two constants to
get the package to compile.

Is there any reason that these constants are defined in a System
V/386 system?  Are they actually supported?  So many times, I have
seen people on the net running into problems because of these two.
Is there any reason I shouldn't just comment them out of the system
include files?
-- 
John W. Temples -- john@jwt.UUCP (uunet!jwt!john)

tneff@bfmny0.BFM.COM (Tom Neff) (08/22/90)

In article <2037@jwt.UUCP> john@jwt.UUCP (John Temples) writes:
>While compiling a new software package (trn), I was again stung by
>the fact that the definition of TIOCGWINSZ in my ESIX system led the
>software to believe I had "struct winsize" defined.  

If your system has <sys/ptem.h>, take a look at it.

When I have problems with TIOCGWINSZ, I add these lines:

	#include <sys/types.h>
	#include <sys/stream.h>
	#include <sys/ptem.h>

and everything's usually OK afterwards.  It's not an ESIX specific
problem -- I believe all the V/386 3.2 products have it.

-- 
A doubled signature is the devil's work. ** Tom Neff <tneff@bfmny0.BFM.COM>
-- 
A doubled signature is the devil's work. ** Tom Neff <tneff@bfmny0.BFM.COM>

pcg@cs.aber.ac.uk (Piercarlo Grandi) (08/27/90)

On 21 Aug 90 18:26:59 GMT, john@jwt.UUCP (John Temples) said:

john> While compiling a new software package (trn), I was again stung by
john> the fact that the definition of TIOCGWINSZ in my ESIX system led the
john> software to believe I had "struct winsize" defined.

AT&T has put the definitions of these two things in some non obvious
place. have a look round /usr/include/sys...

john> Is there any reason that these constants are defined in a System
john> V/386 system?  Are they actually supported?

Yes, because you can hav windows or funny sizes "screens" at the other
end of a stream, or of an xt line, or whatever.

john> Is there any reason I shouldn't just comment them out of the system
john> include files?

For vanilla applications, there is no reason whatever. If you run
windowing, you had better put them in. Where on earth will your
application or curses library find the window "screen" size otherwise?

Oh, I wish that the UNIX tty subsystem were not as bad as it has been
traditionally. I only pray that streams will soon be used throughout
(read SVR4), as they offer some more elegant way of addressing many
problems (ptys, etc...).
--
Piercarlo "Peter" Grandi           | ARPA: pcg%uk.ac.aber.cs@nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcsun!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk