Mail Archives: djgpp/1999/07/08/21:10:23
> I've made an FSEXT'ension handler for network socket I/O.
> Now I which to tie a socket to a 'FILE*' in order to use fgets(),
> fprintf() etc. with the sockets. But looking at fdopen() or setmode(),
> FSEXT'ension handlers aren't called. I would think that my handler
> would get an '__FSEXT_open' command, but it never does. Is this
> intentional or an oversight?
That's just the way fdopen() works. It expects you to pass it an
*already* opened file descriptor. In your case, the socket() call
needs to not only set the fsext function, but open the fd as well
(with __FSEXT_alloc_fd) (in fact, the docs for __FSEXT_alloc_fd have
an example of implementing socket()!)
http://www.delorie.com/djgpp/doc/libc-2.02/libc_315.html
- Raw text -