I've ran ktrace(1) on some Linux application and noticed that it has a lot calls like this: 97754 app CALL linux_ioctl(0xf,0x5401 ,0xbfbfbc78) 97754 app RET linux_ioctl -1 errno 25 Inappropriate ioctl for device 0x5401 stands for TCGETS on Linux. As I understand this ioctl is obsolete and is replaced by tcgetattr() (?). It's better to not return errno but to do what tcgetattr() does. This will take out one more potential point of failure for some Linux apps.
Responsible Changed From-To: freebsd-bugs->freebsd-emulation reclassify.
> > Description: > I've ran ktrace(1) on some Linux application and noticed that it has a > lot calls like this: > 97754 app CALL linux_ioctl(0xf,0x5401 ,0xbfbfbc78) > 97754 app RET linux_ioctl -1 errno 25 Inappropriate ioctl for device > 0x5401 stands for TCGETS on Linux. As I understand this ioctl is > obsolete > and is replaced by tcgetattr() (?). Actually it not absolutelly so, tcgetattr() it is a glibc function which uses ioctl TCGETS inside. > It's better to not return errno but to do what tcgetattr() does. > This will take out one more potential point of failure for some Linux > apps. I think that the author should give more information, at least explain on what specifies a file descriptor. thnx! -- Have fun! chd
Chagin Dmitry wrote: > Actually it not absolutelly so, tcgetattr() it is a glibc function > which uses ioctl TCGETS inside. > Actually on FreeBSD tcgetattr() is typedefed to ioctl TCGETA. In short this PR asks to implement TCGETS in Linux emulator. > > I think that the author should give more information, at least explain > on what specifies a file descriptor. Which author?
Here is the relevant piece of information I found on usenet: << TCGETA is the predecessor to *TCGETS*. It uses the termio structure, not the termios structure. The difference is that the flag members in termio are of type unsigned short, while in termios they're tcflag_t, which is unsigned long on a Sun. >>
On Tue, 5 Aug 2008, Yuri wrote: > Chagin Dmitry wrote: >> Actually it not absolutelly so, tcgetattr() it is a glibc function >> which uses ioctl TCGETS inside. >> > > Actually on FreeBSD tcgetattr() is typedefed to ioctl TCGETA. > > In short this PR asks to implement TCGETS in Linux emulator. > It is already implemented, see sys/compat/linux/linux_ioctl.c from line 670 tcgetattr fails if file descriptor is not a tty, may be problem here? >> >> I think that the author should give more information, at least explain >> on what specifies a file descriptor. > > Which author? > certainly, author ot the PR -- Have fun! chd