lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] fd_set issue


From: Jens Nielsen
Subject: [lwip-users] fd_set issue
Date: Tue, 31 Jul 2012 23:11:18 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20120713 Thunderbird/14.0

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]