浏览代码

!540 [libc] include sys/ioctl.h for musl
Merge pull request !540 from bernard/bernard_rt-smart

bernard 3 年之前
父节点
当前提交
7f40d1ebb6
共有 1 个文件被更改,包括 11 次插入0 次删除
  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