very cool! To get it working on DragonFlyBSD I had to add a fflush() after the fprintf() on the socket. Also the fdopen() flags had to be changed to w+ (from man page: ``w+'' Open for reading and writing.). Otherwise the fflush() doesn't work. There is the following comment in the fflush code: /* * There is disagreement about the correct behaviour of * fflush() * when passed a file which is not open for reading. * According to * the ISO C standard, the behaviour is undefined. * Under linux, such an fflush returns success and has no * effect; * under Windows, such an fflush is documented as behaving * instead * as fpurge(). * Given that applications may be written with the * expectation of * either of these two behaviours, the only safe * (non-astonishing) * option is to return EBADF and ask that applications be * fixed. */ Took me quite a while to figure this out ... Anyway, with these tiny modifications it works nice for me and I'd like to commit it. Let me know when you think it's ready. Cheers, Johannes