This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: quetions about tcgetattr()
- To: li hui <lhbyron at yahoo dot com>
- Subject: Re: [ECOS] quetions about tcgetattr()
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Mon, 01 Oct 2001 18:27:03 +0100
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat UK Ltd.
- References: <20010929074930.64920.qmail@web14701.mail.yahoo.com>
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