[ECOS] quetions about tcgetattr()

Jonathan Larmour jlarmour@redhat.com
Mon Oct 1 10:27:00 GMT 2001


li hui wrote:
> 
> I had writen a short program. I use function
> cyg_io_lookup("dev/tty0",handle) to get the device
> handle, and then i use function
> tcgetattr(handle,&termios) to get the runtime
> parametres, but it is failed. I was puzzled by this
> problem!
> I really get the device handle successfully, why i
> can't get the device tuntime parameters by using
> tcgetattr() funtion?

The first argument to tcgetattr() is a file descriptor, as returned by the
POSIX function open(), not a handle as returned by cyg_io_lookup().

You should instead use open() to open /dev/termios0 (look in the termios
configuration options to see the mapping between termios devices and the
underlying real serial devices).

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine



More information about the Ecos-discuss mailing list