Am 05.03.2021 um 06:18 schrieb Ajay Bhargav via lwip-users: > If you’re using a posix style system of any system which already define > O_RDONLY/WRONLY/RDWR then you can include that file in your arch.h or > cc.h probably > > > > The sockets.h definition is only for the system which does not define > anything. So it does not matter what the values are.
While it probably should be like that, the values cited below do not work: the lwIP code currently relies on "O_RDWR == (O_RDONLY|O_WRONLY)" and on none of them being zero... Regards, Simon > > > > Regards, > > Ajay Bhargav > > > > > > *From: *唐尧 <mailto:tang...@cmiot.chinamobile.com> > *Sent: *Friday, March 5, 2021 9:35 AM > *To: *lwip-users <mailto:lwip-users@nongnu.org> > *Cc: *jlledom <mailto:jlle...@member.fsf.org> > *Subject: *[lwip-users] [lwip] Why value of > O_NONBLOCK/O_RDONLY/O_WRONLY/O_RDWR in src/include/lwip/sockets.h are > not equal to the posix? > > > > *In posix fcntl.h , the definations is:* > > > > #define O_RDONLY 00000000 > > #define O_WRONLY 00000001 > > #define O_RDWR 00000002 > > > > *but in src/include/lwip/sockets.h , the value is:* > > > > #ifndef O_NONBLOCK > > #define O_NONBLOCK 1 /* nonblocking I/O */ > > #endif > > #ifndef O_NDELAY > > #define O_NDELAY O_NONBLOCK /* same as O_NONBLOCK, for compatibility */ > > #endif > > #ifndef O_RDONLY > > #define O_RDONLY 2 > > #endif > > #ifndef O_WRONLY > > #define O_WRONLY 4 > > #endif > > #ifndef O_RDWR > > #define O_RDWR (O_RDONLY|O_WRONLY) > > #endif > > > > *any reason of the difference?* > > > > > > BRs//tangyao > > > > > _______________________________________________ > lwip-users mailing list > lwip-users@nongnu.org > https://lists.nongnu.org/mailman/listinfo/lwip-users > _______________________________________________ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users