[vlc-devel] [vlc-commits] help: use direct ioctl() rather than spawning stty to get console width

Rémi Denis-Courmont remi at remlab.net
Sat Oct 26 17:30:28 CEST 2013


Le samedi 26 octobre 2013 12:02:30 Rafaël Carré a écrit :
> Please fix, the struct is in termio.h although you might want to use
> another interface:
> 
>        Use of ioctl makes for nonportable programs.  Use the POSIX interface
> described in termios(3) whenever possible.

I could not find any POSIX support for console width, in termios(3), stty(1) or 
anywhere else.

The "size" parameter to "stty" is a GNU/coreutils extension and a convenience 
wrapper to the Linux-specific ioctl() for shell scripting. In other words, the 
current code is not portable, but the previous code was even less so.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list