diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2010-10-02 19:48:13 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2010-10-02 19:48:13 +0000 |
commit | 87889d40ebb114829668bdcd35902a2ecce69330 (patch) | |
tree | 3c63b9c47767f8c5922d33eecffac1cffb5651ee /gnu | |
parent | 8480ff445c0d4a759514dc9df33c8a00de9b4117 (diff) |
Suggest modern TIOCGSIZE, not the old sgtty TIOCGWINSZ.
On OpenBSD they are identical but new code should use the new name.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/perl/pod/perlfaq8.pod | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gnu/usr.bin/perl/pod/perlfaq8.pod b/gnu/usr.bin/perl/pod/perlfaq8.pod index 08a5b038b45..e69107d562e 100644 --- a/gnu/usr.bin/perl/pod/perlfaq8.pod +++ b/gnu/usr.bin/perl/pod/perlfaq8.pod @@ -231,10 +231,10 @@ This is more portable than the raw C<ioctl>, but not as illustrative: require 'sys/ioctl.ph'; - die "no TIOCGWINSZ " unless defined &TIOCGWINSZ; + die "no TIOCGSIZE " unless defined &TIOCGSIZE; open(TTY, "+</dev/tty") or die "No tty: $!"; - unless (ioctl(TTY, &TIOCGWINSZ, $winsize='')) { - die sprintf "$0: ioctl TIOCGWINSZ (%08x: $!)\n", &TIOCGWINSZ; + unless (ioctl(TTY, &TIOCGSIZE, $winsize='')) { + die sprintf "$0: ioctl TIOCGSIZE (%08x: $!)\n", &TIOCGSIZE; } ($row, $col, $xpixel, $ypixel) = unpack('S4', $winsize); print "(row,col) = ($row,$col)"; |