libc lwip recv MSG_PEEK doesn't behave as specified

Christian Helmuth christian.helmuth at
Wed Jun 20 10:18:20 CEST 2018


On Tue, Jun 19, 2018 at 10:20:56PM +0200, Johannes Kliemann wrote:
> This is what I currently do but with ioctl(int, FIONREAD, int*) which
> gives the number of bytes available to read from a socket.

Another feature available only in libc_lwip with no plans to preserve,

> > There's also a third option in libc/select.h, which provides a
> > mechanism to block in the entrypoint waiting for signals, RPC, and
> > also for libc file descriptors to become readable. The semantics are a
> > bit tricky, but I know of applications out there using this mechanism
> > successfully.
> I also might look into this while I still prefer a non-blocking approach.

Don't get my description wrong. The Libc::Select_handler fills the gap
between Genode components (with signal handlers or RPC interfaces) and
libc select(). So, it provides the feature to get deblocked if one of
the selected file descriptors gets readable in conjunction with the
common component functions.

Please have a look into the test residing in libports/src/test/libc_component.

Christian Helmuth
Genode Labs · · /ˈdʒiː.nəʊd/

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth

More information about the users mailing list