This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: quetions about tcgetattr()


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]