Browse Source

[libc] include sys/ioctl.h for musl

BernardXiong 3 years ago
parent
commit
7ce248c6e8
1 changed files with 11 additions and 0 deletions
  1. 11 0
      include/libc/libc_ioctl.h

+ 11 - 0
include/libc/libc_ioctl.h

@@ -11,6 +11,16 @@
 #ifndef LIBC_IOCTL_H__
 #ifndef LIBC_IOCTL_H__
 #define LIBC_IOCTL_H__
 #define LIBC_IOCTL_H__
 
 
+#if defined(RT_USING_MUSL)
+#include <sys/ioctl.h>
+#ifndef FIONWRITE
+#define FIONWRITE       _IOR('f', 121, int)
+#endif
+#ifdef SIOCATMARK
+#undef SIOCATMARK
+#endif
+
+#else
 #define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
 #define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
 #define _IOC_NONE  0U
 #define _IOC_NONE  0U
 #define _IOC_WRITE 1U
 #define _IOC_WRITE 1U
@@ -228,3 +238,4 @@ struct winsize {
 
 
 #endif
 #endif
 
 
+#endif