file descriptors and handles for serial

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


I have a code using the serial port where I am using
cyg_io_set/get_config(), that are operating with handles.
Now I'd like to use a select() call that needs
a filedescriptor.

- Should I use cyg_fp_get() to get a handle from a file
  descriptor describing a device (apropos, shouldn't
  dev_open() in fileio\current\src\devfs.cxx set the f_type
  to CYG_FILE_TYPE_DEVICE instead of _FILE?)

- or is there a way to control everything controllable by
  cyg_io_set_config using an ioctl?

I know I can rewrite the code to use cyg_io_read and aborting
a timed out read via a set_config; the problem is that the
code I am hacking is part of an abstraction only storing
one number for both sockets and serial ports. Mixing
descriptors and handles and marking what is what would make
the code quite ugly.


Before posting, please read the FAQ:
and search the list archive:

[Linux Embedded]     [U-Boot V2]     [Linux Kernel]     [Linux MIPS]     [Linux ARM]     [Linux for the Blind]     [Linux Resources]     [Photo]     [Yosemite]     [ISDN Cause Codes]     [ECOS Home]

Add to Google Powered by Linux