This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: conversion of cyg_io_handle_t type to filedescriptor of type integer
- To: Thiagarajan Rajasekaran <rajt at connecttel dot com>
- Subject: Re: [ECOS] conversion of cyg_io_handle_t type to filedescriptor of type integer
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Tue, 17 Jul 2001 19:36:47 +0100
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat UK Ltd.
- References: <3B5479A4.7D8F88A5@connecttel.com>
Thiagarajan Rajasekaran wrote:
>
> Hi,
> I'm trying to use the ioctl(int fd, u_long cmd, void *data) defined in
> ecos/packages/net/tcpip/src/lib/ioctl.c for my task. This function needs
> filedescriptor fd as one of the parameters. In ECOS when you open a
> serial device it gives you a handle of type cyg_io_handle_t. Is there a
> way to get the filedescriptor from cyg_io_handle_t or I should write my
> own version of ioctl()?. Please reply to me asap.
Why do you need to use ioctl() when you can use something more appropriate
like cyg_io_get_config()?
But if you really want to implement it, the way to do it is with the fileio
package, and use open() instead of cyg_io_open() etc. Then fill in the
dev_fo_ioctl function in io/fileio/current/src/devfs.cxx.
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
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions http://www.redhat-techworld.com/