Subject: ioctl (TIOCWINSZ) failed

From: [email-masked] (P.D.Bates)
Date: Wed, 17 Aug 1994 12:13:51 GMT

Subject: ioctl (TIOCWINSZ) failed
Newsgroups: comp.mail.pine
Summary: 
Keywords: 
X-Newsreader: TIN [version 1.1 PL9]

Hello there...

I've just compiled Pine3.89
on a Solaris 2.2 system and
it seems to be working fine...

The .pine-debug report however includes this line:

ioctl (TIOCWINSZ) failed :Invalid argument

Is this something I should 
be worried about?

Have I failed to compile it OK?

I would be most grateful
for any help on this matter...

Thanks!

Peter Bates

---

From: Dave King <[email-masked]>
Date: Wed, 17 Aug 1994 15:55:51 GMT

This behaviour is something that I've known about for a long time, but 
only fixed a couple of days ago with the help of Sequent support.

I have implemented this solution on DYNIX/ptx 2.0.4 and it works for me. 
It may or may not work for your operating system, but it's easy to try
out. 

I think you'll find what is happening is that ioctl() is being passed a
window size of 0,0 from UNIX which ioclt() considers to be an invalid
window size. I suspect this problem may be generic to SYSV Unix, perhaps
others can confirm this? 

Confirm what your shell "thinks" your current window dimensions are by
doing an "stty -a", and look for the "rows" and "cols"  values. If they 
are shown as 0 (zero), try this fix:

stty cols `tput cols` rows `tput lines`

This shoud use stty to set window dimensions to those defined in your 
terminfo database according to your TERM variable.

Run Pine again and check your .pine-debug file to see if ioctl is now 
reporting a correct window size.

If you find Pine (and your other programs) are happy with this, you could 
put the line in your /etc/profile.

I hope this helps. 

Dave
___________________________________________________________________
Dave King  Admin. Computing Services Manager, University of Bristol
RFC-822:   [email-masked]
X.400:     G=Dave;S=King;O=bristol;P=UK.AC;C=GB 
Telephone: 0117 9303961

---

From: [email-masked] (Richard Spitz)
Date: 22 Aug 1994 14:35:45 GMT

Dave King ([email-masked]) wrote:
: Confirm what your shell "thinks" your current window dimensions are by
: doing an "stty -a", and look for the "rows" and "cols"  values. If they 
: are shown as 0 (zero), try this fix:

: stty cols `tput cols` rows `tput lines`

Thank you very much for this info. Although "stty -a" didn't reveal
any info about the settings for "columns" and "rows" on our system
(SINIX 5.41, a SysVR4), I just tried your suggestion and it did indeed
resolve the ioctl error message.

One minor correction: On our system, the correct syntax is

stty columns `tput cols` rows `tput lines`
	^^^^

Regards, Richard
--
+----------------------------+-------------------------------------------+
| Dr. Richard Spitz          | INTERNET: [email-masked]   |
| EDV-Gruppe Anaesthesie     | Tel     : +49-89-7095-3421                |
| Klinikum Grosshadern       | FAX     : +49-89-7095-8886                |
| 81366 Munich, Germany      |                                           |
+----------------------------+-------------------------------------------+