[uClibc]fdopen on unix socket, then closing fd

Doornekamp, Ico (Contractor) ico.doornekamp at intersil.com
Fri Feb 1 10:43:27 UTC 2002


> 
> > Is there any way of telling the socket is no longer valid 
> by looking at
> > the FILE * ?
> > I guess using read() and write() on the file descriptor instead of
> > fgets() and fprintf() on
> > the FILE * would solve this problem too, but I hope there's 
> a solution
> > where I can still
> > use these functions....
> > 
> 
> i don't figure out how to do that in this moment, but you can 
> set a signal handler to avoid this.... is not a _final_ 
> solution but will help in the meanwhile
> 

Hmm, that's a possible workardound yes, but I'm curious about the
'offical' way
to handle this, or it is just not right to do an fdopen on socket fd's ?
It 
seems I can avoid the problem by setting the stdio buffer of the FILE *
to 0 bytes
with a setvbuf(), but I feel it's just a workaround, and not a real
solution...

- Ico



More information about the uClibc mailing list