Hi, I've been hacking a lot the last couple days to try to figure out how to get the file descriptor for a socket created with open-tcp-client on Linux. I've finally got it figured out, and to do it I obtain the rdevice for the port via the condition variable and in C cast it to a ___device_tcp_client_struct to extract the 's' field (the file descrip- tor). There's only one problem: whereas ___device_stream_struct is defined in os_io.h and I can conveniently include it from my C code, the definition of ___device_tcp_client_struct is in os_io.c and I had to copy it out and paste it into my code. Is there something about that definition that makes its location in the C source (rather than the header) necessary? I'd prefer to just #include something, but if the only way is to copy/paste those lines then I'll just continue to do that. Thanks for any advice.
Afficher les réponses par date