|
From: | Ajay Bhargav |
Subject: | Re: [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? |
Date: | Fri, 5 Mar 2021 10:48:08 +0530 |
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. Regards, Ajay Bhargav From: 唐尧 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 |
[Prev in Thread] | Current Thread | [Next in Thread] |