lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] [lwip] Why value of O_NONBLOCK/O_RDONLY/O_WRONLY/O_RDWR


From: address@hidden
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 06:46:47 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0

Am 05.03.2021 um 04:32 schrieb 唐尧:
> *In posix fcntl.h , the definations is:*

Which "posix" fcntl.h do you mean? Do you mean Linux instead? Because as
far as I'm aware, posix is a standard for source code compatibility, not
for binary compatibility. And being like that, it defines the named
constants, not their values.

If you're looking at compiler errors because some file includes both
Linux and lwIP defines, have a look at LWIP_SOCKET_EXTERNAL_HEADERS. But
at least O_RDWR might not work as it is now...

Regards,
Simon

>
> #define O_RDONLY00000000
> #define O_WRONLY00000001
> #define O_RDWR00000002
>
> *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
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]