diff --git a/components/libc/compilers/common/sys/ioctl.h b/components/libc/compilers/common/sys/ioctl.h index c663025c1f4b487c329ac879b77afd63cd83475e..0b1edca699d006cd77069eaf685f5adfdb0f6b6b 100644 --- a/components/libc/compilers/common/sys/ioctl.h +++ b/components/libc/compilers/common/sys/ioctl.h @@ -11,34 +11,79 @@ #ifndef __SYS_IOCTL_H__ #define __SYS_IOCTL_H__ -#include - #ifdef _WIN32 #include #endif -struct winsize { +struct winsize +{ unsigned short ws_row; unsigned short ws_col; unsigned short ws_xpixel; unsigned short ws_ypixel; }; -#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) ) +/* + * Direction bits, which any architecture can choose to override + * before including this file. + */ + +#ifndef _IOC_NONE #define _IOC_NONE 0U +#endif + +#ifndef _IOC_WRITE #define _IOC_WRITE 1U +#endif + +#ifndef _IOC_READ #define _IOC_READ 2U +#endif -#if !defined (_WIN32) && !defined (__TASKING__) -#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0) -#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c)) -#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c)) -#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c)) +#ifndef _IOC +#define _IOC(a,b,c,d) (((a)<<30) | ((b)<<8) | (c) | ((d)<<16)) +#endif + +#ifndef _IO +#define _IO(a,b) _IOC(_IOC_NONE, (a), (b), 0) +#endif + +#ifndef _IOW +#define _IOW(a,b,c) _IOC(_IOC_WRITE, (a), (b), sizeof(c)) +#endif + +#ifndef _IOR +#define _IOR(a,b,c) _IOC(_IOC_READ, (a), (b), sizeof(c)) +#endif + +#ifndef _IOWR +#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE, (a), (b), sizeof(c)) +#endif +#ifndef FIONREAD #define FIONREAD _IOR('f', 127, int) /* get # bytes to read */ +#endif + +#ifndef FIONBIO #define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */ #endif + +#ifndef FIOASYNC +#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */ +#endif + +#ifndef FIONWRITE #define FIONWRITE _IOR('f', 121, int) /* get # bytes outstanding in send queue */ +#endif + +/* Socket I/O Controls */ +#ifndef SIOCSHIWAT +#define SIOCSHIWAT _IOW('s', 0, int) /* set high watermark */ +#define SIOCGHIWAT _IOR('s', 1, int) /* get high watermark */ +#define SIOCSLOWAT _IOW('s', 2, int) /* set low watermark */ +#define SIOCGLOWAT _IOR('s', 3, int) /* get low watermark */ +#define SIOCATMARK _IOR('s', 7, int) /* at oob mark? */ +#endif #define TCGETS 0x5401 #define TCSETS 0x5402 @@ -66,18 +111,12 @@ struct winsize { #define TIOCMSET 0x5418 #define TIOCGSOFTCAR 0x5419 #define TIOCSSOFTCAR 0x541A -#ifndef FIONREAD -#define FIONREAD 0x541B -#endif #define TIOCINQ FIONREAD #define TIOCLINUX 0x541C #define TIOCCONS 0x541D #define TIOCGSERIAL 0x541E #define TIOCSSERIAL 0x541F #define TIOCPKT 0x5420 -#ifndef FIONBIO -#define FIONBIO 0x5421 -#endif #define TIOCNOTTY 0x5422 #define TIOCSETD 0x5423 #define TIOCGETD 0x5424 @@ -103,10 +142,6 @@ struct winsize { #define FIONCLEX 0x5450 #define FIOCLEX 0x5451 -#ifndef _WIN32 -#define FIOASYNC 0x5452 -#endif - #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 #define TIOCSERSWILD 0x5455 @@ -168,9 +203,6 @@ struct winsize { #define SIOCSPGRP 0x8902 #define FIOGETOWN 0x8903 #define SIOCGPGRP 0x8904 -#ifndef SIOCATMARK -#define SIOCATMARK 0x8905 -#endif #define SIOCGSTAMP 0x8906 #define SIOCGSTAMPNS 0x8907 diff --git a/components/net/lwip-1.4.1/src/lwipopts.h b/components/net/lwip-1.4.1/src/lwipopts.h index d7a6807cbd8c6f8bd8a85a34a1b5f3212666d6cf..03930c8741789e7e6d36b286185c2505b4f61a86 100644 --- a/components/net/lwip-1.4.1/src/lwipopts.h +++ b/components/net/lwip-1.4.1/src/lwipopts.h @@ -526,6 +526,7 @@ #define LWIP_SOCKET 1 #endif #include +#include /* * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names. diff --git a/components/net/lwip-2.0.2/src/lwipopts.h b/components/net/lwip-2.0.2/src/lwipopts.h index 5c99013d2ed7b98181a904e39737c908e4fc4e00..2de6aa1052db1fd125fdbcadc437ddaf6d0be51c 100644 --- a/components/net/lwip-2.0.2/src/lwipopts.h +++ b/components/net/lwip-2.0.2/src/lwipopts.h @@ -565,6 +565,7 @@ #define LWIP_SOCKET 1 #endif #include +#include /* * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names. diff --git a/components/net/lwip-2.0.3/src/lwipopts.h b/components/net/lwip-2.0.3/src/lwipopts.h index 5c99013d2ed7b98181a904e39737c908e4fc4e00..2de6aa1052db1fd125fdbcadc437ddaf6d0be51c 100644 --- a/components/net/lwip-2.0.3/src/lwipopts.h +++ b/components/net/lwip-2.0.3/src/lwipopts.h @@ -565,6 +565,7 @@ #define LWIP_SOCKET 1 #endif #include +#include /* * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names. diff --git a/components/net/lwip-2.1.2/src/lwipopts.h b/components/net/lwip-2.1.2/src/lwipopts.h index ca70de012a505b7387cbdd7be8b3018b33c9bb0e..701449c1084a7dc8cb8639d8efc038f75bbbda64 100644 --- a/components/net/lwip-2.1.2/src/lwipopts.h +++ b/components/net/lwip-2.1.2/src/lwipopts.h @@ -568,6 +568,7 @@ #define LWIP_SOCKET 1 #endif #include +#include /* * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.