I would like to take advantage of CFStream on Mac OS X to be able to read/write asynchronously to a file descriptor that is a serial communication device. I need access to the file descriptor so that I can control and change the device settings through ioctl.
While it seems that one can get access to a native socket fd when using the socket-oriented stream operations, I have not seen any way to either open a file with the CFCreateXxxStreamWithFile API and then get a file descriptor (and even then, I would really need a pair from the same fd so I can set options for read/write) or a way to create CFStreams from existing file descriptors.
Is there a way, or is there a library allowing to do so (akin to AyncCococaSocket)? Or am I relegated to doing my own threaded operation and/or GCD (which would limit myself to 10.6 and above)?
Thanks for help!