Jef Driesen
2009-12-15 20:11:17 UTC
Hi,
Is there some way to detect the difference between a file descriptor
that refers to a pseudo terminal and a real serial port? My application
works with real serial ports, but for testing I use pseudo terminals.
But they do not appear to support some of the ioctl's for setting
DTR/RTS lines, asserting breaks, etc. Thus for testing, I replace those
functions with stubs that do nothing and always return success. But that
means I have to build two variants of my application, and I would like
to replace that with a runtime check. But I don't know if that is possible.
Thanks in advance,
Jef
Is there some way to detect the difference between a file descriptor
that refers to a pseudo terminal and a real serial port? My application
works with real serial ports, but for testing I use pseudo terminals.
But they do not appear to support some of the ioctl's for setting
DTR/RTS lines, asserting breaks, etc. Thus for testing, I replace those
functions with stubs that do nothing and always return success. But that
means I have to build two variants of my application, and I would like
to replace that with a runtime check. But I don't know if that is possible.
Thanks in advance,
Jef