]> xenbits.xensource.com Git - unikraft/libs/newlib.git/commitdiff
Adapt and use musl ioctl.h headers
authorCostin Lupu <costin.lupu@cs.pub.ro>
Mon, 5 Aug 2019 15:17:45 +0000 (18:17 +0300)
committerFelipe Huici <felipe.huici@neclab.eu>
Wed, 14 Aug 2019 11:39:27 +0000 (13:39 +0200)
The lwip library has its own definition for SIOCATMARK which we cannot
overwrite, so we avoid using our own in that case. Also, the same
definition for winsize structure is already provided by the musl
headers, so we stick to those.

This patch also adds licenses for the musl ioctl.h headers.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Makefile.uk
include/sys/ioctl.h
musl-imported/arch/generic/bits/ioctl.h
musl-imported/include/sys/ioctl.h

index abd556a6b15de0fdc452f154929275e7bab59342..f11d443f5bb30e54d7cf9a46545f95d61c4a7f94 100644 (file)
@@ -65,10 +65,13 @@ LIBNEWLIB_LIBM = $(LIBNEWLIBC_ORIGIN)/$(LIBNEWLIB_SUBDIR)/newlib/libm
 ################################################################################
 # Library includes
 ################################################################################
-CINCLUDES-$(CONFIG_LIBNEWLIBC)   += -I$(LIBNEWLIBC_BASE)/include
-CINCLUDES-$(CONFIG_LIBNEWLIBC)   += -I$(LIBNEWLIB_LIBC)/include
-CXXINCLUDES-$(CONFIG_LIBNEWLIBC) += -I$(LIBNEWLIBC_BASE)/include
-CXXINCLUDES-$(CONFIG_LIBNEWLIBC) += -I$(LIBNEWLIB_LIBC)/include
+LIBNEWLIBC_COMMON_INCLUDES-y     += -I$(LIBNEWLIBC_BASE)/include
+LIBNEWLIBC_COMMON_INCLUDES-y     += -I$(LIBNEWLIBC_BASE)/musl-imported/include
+LIBNEWLIBC_COMMON_INCLUDES-y     += -I$(LIBNEWLIBC_BASE)/musl-imported/arch/generic
+LIBNEWLIBC_COMMON_INCLUDES-y     += -I$(LIBNEWLIB_LIBC)/include
+
+CINCLUDES-$(CONFIG_LIBNEWLIBC)   += $(LIBNEWLIBC_COMMON_INCLUDES-y)
+CXXINCLUDES-$(CONFIG_LIBNEWLIBC) += $(LIBNEWLIBC_COMMON_INCLUDES-y)
 
 LIBNEWLIBM_CINCLUDES   += -I$(LIBNEWLIB_LIBM)/common
 LIBNEWLIBM_CXXINCLUDES += -I$(LIBNEWLIB_LIBM)/common
index 9d9d9241887a5c40ea223c25256f56373b4bae19..a797dda6ccfb8f3af77888fd4b6e9454cdb1e811 100644 (file)
@@ -34,9 +34,5 @@
  * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
  */
 
-struct winsize {
-       unsigned short ws_row;
-       unsigned short ws_col;
-       unsigned short ws_xpixel;
-       unsigned short ws_ypixel;
-};
+#include_next <sys/ioctl.h>
+
index d1a6c035f8323123dfac53d31211e36af2075250..fff7774606d7f272ce03a0a07bc133f2d06f645f 100644 (file)
@@ -1,3 +1,27 @@
+/* SPDX-License-Identifier: MIT */
+/* ----------------------------------------------------------------------
+ * Copyright © 2005-2014 Rich Felker, et al.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * ----------------------------------------------------------------------
+ */
 #define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
 #define _IOC_NONE  0U
 #define _IOC_WRITE 1U
 #define SIOCSPGRP       0x8902
 #define FIOGETOWN       0x8903
 #define SIOCGPGRP       0x8904
+#ifndef CONFIG_LIBLWIP
 #define SIOCATMARK      0x8905
+#endif
 #define SIOCGSTAMP      0x8906
 #define SIOCGSTAMPNS    0x8907
 
-#include <bits/ioctl_fix.h>
+//TODO #include <bits/ioctl_fix.h>
index 372e3ddc1ca9d37740dd85ca5435bef7e7d01b27..b1cf5c1cb3315bc1aa7565ec00c055f1e6607693 100644 (file)
@@ -1,3 +1,27 @@
+/* SPDX-License-Identifier: MIT */
+/* ----------------------------------------------------------------------
+ * Copyright © 2005-2014 Rich Felker, et al.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * ----------------------------------------------------------------------
+ */
 #ifndef        _SYS_IOCTL_H
 #define        _SYS_IOCTL_H
 #ifdef __cplusplus