I think that a wrapper for POSIX calls is perhaps something outside the lwip scope. I think the LWIP_IO_SOCKETS define (or else) is necessary to avoid compilation or runtime problems. In my case, I won't write this wrapper, because I can use send, recv and closesocket... But if I do it one day, I will provide the code... ==================================== Frédéric BERNON HYMATOM SA Chef de projet informatique Microsoft Certified Professional Tél. : +33 (0)4-67-87-61-10 Fax. : +33 (0)4-67-70-85-44 Email : [EMAIL PROTECTED] Web Site : http://www.hymatom.fr ====================================
-----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Goldschmidt Simon Envoyé : jeudi 7 septembre 2006 09:19 À : Mailing list for lwIP users Objet : RE : [lwip-users] LWIP_COMPAT_SOCKETS in sockets.h Hi Frédéric, > > In my application, I have comment these three "define", > because I got an OS which already implements these calls. But > I can use "recv", "send" and "closesocket". I have defined > LWIP_COMPAT_SOCKETS because I port my application on several > embedded target (and all implement BSD-like sockets > interface). Using LWIP_IO_SOCKETS would be a way for users to > tell if their OS already implement or nor these calls. If OS > doesn't define these functions, we can define > LWIP_IO_SOCKETS. It have to be undefined is OS implements them. > > In my target, If I wanted to write a pseudo code like yours, > I could undefined LWIP_IO_SOCKETS (to avoid the compilation > error), and I could write a "IO Driver" for my OS to > implement call redirections for read, write and close (this > is a possibility in my OS to extend the IO System) to avoid > the runtime error. > > Perhaps LWIP_IO_SOCKETS is not the good name, and something > like LWIP_POSIX_IO_SOCKETS will be better, or > LWIP_OS_UNIMPLEMENTED_POSIX_CALLS... > This is indeed a problem. Altera, for example has solved it by writing wrapper functions which look at the value of the socket descriptor (int). However, for this to work, you must define a range for sockets and a range for the rest, which is not really a great thing. I think that either a good wrapper should be implemented with lwIP (which could be difficult) or (better) you could simply write this wrapper and include it in the port for your OS (which you have to create anyway...). Simon _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
