[MPlayer-dev-eng] [RFC] purpose on ioctls in osdep/getch2?
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Dec 9 13:46:30 CET 2006
Hello,
does anyone know why we use all this ifdef crap? The whole code is only
used when termios.h is available, and in addition tcgetattr/tcsetattr is
in POSIX, and I personally tested that it definitely is also available
on at least Apple and FreeBSD.
So why do we try to use ioctls?
Here part of the code:
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__) || defined(_AIX)
tcgetattr(0,&tio_orig);
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) || defined(__DragonFly__)
ioctl(0,TIOCGETA,&tio_orig);
#else
ioctl(0,TCGETS,&tio_orig);
#endif
Do you know of anything speaking against just replacing it by
tcgetattr(0,&tio_orig);
Greetings,
Reimar Döffinger
More information about the MPlayer-dev-eng
mailing list