Hi Kieran, Yes, read, write and close are usually used for files in "unistd.h". So, if in a same code, you have to use files and sockets, there is a problem. You got compilation errors like :
"...\include\unistd.h (89) : error: declaration is incompatible with "int lwip_write(int, void *, int)" (declared at line 256 of "C:\lwip\sockets.h") " I belive that close, read and write functions are defined by POSIX.1 . In my "unistd.h" file, write is declared as : extern ssize_t write(int fildes, const void *buf, size_t nbyte); But decide if a call to write() (by example) use the IP stack or the storage filesystem is done by a layer between ip stack and application, and not directly from ip stack (it is based on a internal "file descriptor" field). ==================================== 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 Kieran Mansley Envoyé : mercredi 6 septembre 2006 16:48 À : Mailing list for lwIP users Objet : Re: [lwip-users] LWIP_COMPAT_SOCKETS in sockets.h On Wed, 2006-09-06 at 16:30 +0200, Frédéric BERNON wrote: > I have got some problems with "read", "write" and "close" defines in > the "#if LWIP_COMPAT_SOCKETS" in sockets.h. These defines cause a > compiler error due to same names than my "real" OS calls (in this OS - > tmOsal/pSOS - there is a layer which wrap calls to the correct "IO > driver"). I simply comment them, but wouldn't it be nicer to add a > #define like "LWIP_IO_SOCKETS" in opt.h to include or not include > these defines? Why are read, write, and close special cases? Because they can apply to things other than sockets perhaps? Seems odd to #define some of the functions to standard names, but leave others as lwip_<blah>() Kieran _______________________________________________ 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
