fd_set issue

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

fd_set issue

Jens Nielsen
Hi all

I ran into an issue with select() the other day, I browsed around a bit but I didn't find it anywhere around here so I just want to raise some awareness and hits for future googlers.

The issue is with fd_set and the FD_SET, FD_ISSET, etc macros, which are defined in lwip/sockets.h and also in the standard header sys/types.h.

Everything compiled for me in lwip 1.3.2 but I had problems with the timeout not working in select(), it would always block until there was an event on the socket. Upgrading to 1.4.0 gave me compilation errors instead, such as

error: cannot convert '_types_fd_set*' to 'fd_set*' for argument ...

In 1.3.2 I believe sys/types.h was included from socket.h via opt.h, debug.h and stdio.h, so I assume the definitions in sockets.h were never used due to the surrounding #ifndef (I didn't dig deep into this and I don't know if my problems with the timeout had anything to do with this)

In 1.4.0 stdio.h was no longer included from debug.h, leaving me with sockets.c using the lwip definitions and my application using the sys/types.h definitions, since I had a bunch of other header files included

I got around it by prefixing everything with "lwip" but I suppose you'd want a more generic solution to make everybody happy.

Best regards
Jens

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: fd_set issue

Kieran Mansley
On Tue, 2012-07-31 at 23:11 +0200, Jens Nielsen wrote:
> Everything compiled for me in lwip 1.3.2 but I had problems with the
> timeout not working in select(), it would always block until there was
> an event on the socket. Upgrading to 1.4.0 gave me compilation errors
> instead, such as
>
> error: cannot convert '_types_fd_set*' to 'fd_set*' for argument ...

If you could file a bug on savannah with details of the system this was
seen on, and what you did to work around it, that will make sure it
doesn't get forgotten.

Thanks

Kieran


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users