The Posix standard has a list[2] of what should be declared in
sys/socket.h. If the system is providing its own sys/socket.h,
everything on that list must not be declared in lwip/sockets.h.
I think macros and structure declarations aren't a problem, but
functions... I don't know, since they have different names there
shouldn't be a problem neither. Of course, if LWIP_COMPAT_SOCKETS is
declared, then sys/sockets.h cannot be used because those function
names will be defined in libc. In my opinion, functions shouldn't be
covered by the patch.