summaryrefslogtreecommitdiff
path: root/include/libc
diff options
context:
space:
mode:
Diffstat (limited to 'include/libc')
-rw-r--r--include/libc/libc_errno.h4
-rw-r--r--include/libc/libc_fcntl.h6
-rw-r--r--include/libc/libc_fdset.h6
-rw-r--r--include/libc/libc_ioctl.h169
-rw-r--r--include/libc/libc_limits.h25
-rw-r--r--include/libc/libc_signal.h5
-rw-r--r--include/libc/libc_stat.h2
-rw-r--r--include/libc/libc_stdio.h22
8 files changed, 137 insertions, 102 deletions
diff --git a/include/libc/libc_errno.h b/include/libc/libc_errno.h
index 0f3bc7635a..9143c841f2 100644
--- a/include/libc/libc_errno.h
+++ b/include/libc/libc_errno.h
@@ -13,7 +13,7 @@
#include <rtconfig.h>
-#if defined(RT_USING_NEWLIB) || defined(_WIN32)
+#if defined(RT_USING_NEWLIB) || defined(_WIN32) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
/* use errno.h file in toolchains */
#include <errno.h>
#endif
@@ -45,7 +45,7 @@ defined in armcc/errno.h
#define ERROR_BASE_NO 0
#endif
-#if !defined(RT_USING_NEWLIB) && !defined(_WIN32)
+#if !defined(RT_USING_NEWLIB) && !defined(_WIN32) && !(defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#define EPERM (ERROR_BASE_NO + 1)
#define ENOENT (ERROR_BASE_NO + 2)
diff --git a/include/libc/libc_fcntl.h b/include/libc/libc_fcntl.h
index 1b7c69b1f4..d149d86964 100644
--- a/include/libc/libc_fcntl.h
+++ b/include/libc/libc_fcntl.h
@@ -2,10 +2,6 @@
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
- */
-
-/*
- * File : libc_fcntl.h
*
* Change Logs:
* Date Author Notes
@@ -16,7 +12,7 @@
#ifndef LIBC_FCNTL_H__
#define LIBC_FCNTL_H__
-#if defined(RT_USING_NEWLIB) || defined(_WIN32)
+#if defined(RT_USING_NEWLIB) || defined(_WIN32) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#include <fcntl.h>
#ifndef O_NONBLOCK
diff --git a/include/libc/libc_fdset.h b/include/libc/libc_fdset.h
index ecd965cd22..9700c7e83e 100644
--- a/include/libc/libc_fdset.h
+++ b/include/libc/libc_fdset.h
@@ -2,10 +2,6 @@
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
- */
-
-/*
- * File : libc_errno.h
*
* Change Logs:
* Date Author Notes
@@ -17,7 +13,7 @@
#include <rtconfig.h>
-#if defined(RT_USING_NEWLIB) || defined(_WIN32)
+#if defined(RT_USING_NEWLIB) || defined(_WIN32) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
#include <sys/types.h>
#if defined(HAVE_SYS_SELECT_H)
#include <sys/select.h>
diff --git a/include/libc/libc_ioctl.h b/include/libc/libc_ioctl.h
index ef5a5257a8..516c56b1f4 100644
--- a/include/libc/libc_ioctl.h
+++ b/include/libc/libc_ioctl.h
@@ -2,10 +2,6 @@
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
- */
-
-/*
- * File : libc_ioctl.h
*
* Change Logs:
* Date Author Notes
@@ -20,7 +16,7 @@
#define _IOC_WRITE 1U
#define _IOC_READ 2U
-#ifndef _WIN32
+#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))
@@ -32,99 +28,99 @@
* in send queue. */
#endif
-#define TCGETS 0x5401
-#define TCSETS 0x5402
-#define TCSETSW 0x5403
-#define TCSETSF 0x5404
-#define TCGETA 0x5405
-#define TCSETA 0x5406
-#define TCSETAW 0x5407
-#define TCSETAF 0x5408
-#define TCSBRK 0x5409
-#define TCXONC 0x540A
-#define TCFLSH 0x540B
-#define TIOCEXCL 0x540C
-#define TIOCNXCL 0x540D
-#define TIOCSCTTY 0x540E
-#define TIOCGPGRP 0x540F
-#define TIOCSPGRP 0x5410
-#define TIOCOUTQ 0x5411
-#define TIOCSTI 0x5412
-#define TIOCGWINSZ 0x5413
-#define TIOCSWINSZ 0x5414
-#define TIOCMGET 0x5415
-#define TIOCMBIS 0x5416
-#define TIOCMBIC 0x5417
-#define TIOCMSET 0x5418
-#define TIOCGSOFTCAR 0x5419
-#define TIOCSSOFTCAR 0x541A
-// #define FIONREAD 0x541B
-#define TIOCINQ FIONREAD
-#define TIOCLINUX 0x541C
-#define TIOCCONS 0x541D
-#define TIOCGSERIAL 0x541E
-#define TIOCSSERIAL 0x541F
-#define TIOCPKT 0x5420
-// #define FIONBIO 0x5421
-#define TIOCNOTTY 0x5422
-#define TIOCSETD 0x5423
-#define TIOCGETD 0x5424
-#define TCSBRKP 0x5425
-#define TIOCSBRK 0x5427
-#define TIOCCBRK 0x5428
-#define TIOCGSID 0x5429
-#define TIOCGRS485 0x542E
-#define TIOCSRS485 0x542F
-#define TIOCGPTN 0x80045430
-#define TIOCSPTLCK 0x40045431
-#define TIOCGDEV 0x80045432
-#define TCGETX 0x5432
-#define TCSETX 0x5433
-#define TCSETXF 0x5434
-#define TCSETXW 0x5435
-#define TIOCSIG 0x40045436
-#define TIOCVHANGUP 0x5437
-#define TIOCGPKT 0x80045438
-#define TIOCGPTLCK 0x80045439
-#define TIOCGEXCL 0x80045440
+#define TCGETS 0x5401
+#define TCSETS 0x5402
+#define TCSETSW 0x5403
+#define TCSETSF 0x5404
+#define TCGETA 0x5405
+#define TCSETA 0x5406
+#define TCSETAW 0x5407
+#define TCSETAF 0x5408
+#define TCSBRK 0x5409
+#define TCXONC 0x540A
+#define TCFLSH 0x540B
+#define TIOCEXCL 0x540C
+#define TIOCNXCL 0x540D
+#define TIOCSCTTY 0x540E
+#define TIOCGPGRP 0x540F
+#define TIOCSPGRP 0x5410
+#define TIOCOUTQ 0x5411
+#define TIOCSTI 0x5412
+#define TIOCGWINSZ 0x5413
+#define TIOCSWINSZ 0x5414
+#define TIOCMGET 0x5415
+#define TIOCMBIS 0x5416
+#define TIOCMBIC 0x5417
+#define TIOCMSET 0x5418
+#define TIOCGSOFTCAR 0x5419
+#define TIOCSSOFTCAR 0x541A
+// #define FIONREAD 0x541B
+#define TIOCINQ FIONREAD
+#define TIOCLINUX 0x541C
+#define TIOCCONS 0x541D
+#define TIOCGSERIAL 0x541E
+#define TIOCSSERIAL 0x541F
+#define TIOCPKT 0x5420
+// #define FIONBIO 0x5421
+#define TIOCNOTTY 0x5422
+#define TIOCSETD 0x5423
+#define TIOCGETD 0x5424
+#define TCSBRKP 0x5425
+#define TIOCSBRK 0x5427
+#define TIOCCBRK 0x5428
+#define TIOCGSID 0x5429
+#define TIOCGRS485 0x542E
+#define TIOCSRS485 0x542F
+#define TIOCGPTN 0x80045430
+#define TIOCSPTLCK 0x40045431
+#define TIOCGDEV 0x80045432
+#define TCGETX 0x5432
+#define TCSETX 0x5433
+#define TCSETXF 0x5434
+#define TCSETXW 0x5435
+#define TIOCSIG 0x40045436
+#define TIOCVHANGUP 0x5437
+#define TIOCGPKT 0x80045438
+#define TIOCGPTLCK 0x80045439
+#define TIOCGEXCL 0x80045440
-#define FIONCLEX 0x5450
-#define FIOCLEX 0x5451
+#define FIONCLEX 0x5450
+#define FIOCLEX 0x5451
#ifndef _WIN32
-#define FIOASYNC 0x5452
+#define FIOASYNC 0x5452
#endif
-#define TIOCSERCONFIG 0x5453
-#define TIOCSERGWILD 0x5454
-#define TIOCSERSWILD 0x5455
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x5458
+#define TIOCSERCONFIG 0x5453
+#define TIOCSERGWILD 0x5454
+#define TIOCSERSWILD 0x5455
+#define TIOCGLCKTRMIOS 0x5456
+#define TIOCSLCKTRMIOS 0x5457
+#define TIOCSERGSTRUCT 0x5458
#define TIOCSERGETLSR 0x5459
#define TIOCSERGETMULTI 0x545A
#define TIOCSERSETMULTI 0x545B
-#define TIOCMIWAIT 0x545C
-#define TIOCGICOUNT 0x545D
-#define FIOQSIZE 0x5460
+#define TIOCMIWAIT 0x545C
+#define TIOCGICOUNT 0x545D
+#define FIOQSIZE 0x5460
-#define TIOCPKT_DATA 0
-#define TIOCPKT_FLUSHREAD 1
-#define TIOCPKT_FLUSHWRITE 2
-#define TIOCPKT_STOP 4
-#define TIOCPKT_START 8
-#define TIOCPKT_NOSTOP 16
-#define TIOCPKT_DOSTOP 32
-#define TIOCPKT_IOCTL 64
+#define TIOCPKT_DATA 0
+#define TIOCPKT_FLUSHREAD 1
+#define TIOCPKT_FLUSHWRITE 2
+#define TIOCPKT_STOP 4
+#define TIOCPKT_START 8
+#define TIOCPKT_NOSTOP 16
+#define TIOCPKT_DOSTOP 32
+#define TIOCPKT_IOCTL 64
#define TIOCSER_TEMT 0x01
struct winsize {
- unsigned short ws_row;
- unsigned short ws_col;
- unsigned short ws_xpixel;
- unsigned short ws_ypixel;
+ unsigned short ws_row;
+ unsigned short ws_col;
+ unsigned short ws_xpixel;
+ unsigned short ws_ypixel;
};
#define TIOCM_LE 0x001
@@ -227,8 +223,7 @@ struct winsize {
#define SIOCADDDLCI 0x8980
#define SIOCDELDLCI 0x8981
-#define SIOCDEVPRIVATE 0x89F0
-#define SIOCPROTOPRIVATE 0x89E0
+#define SIOCDEVPRIVATE 0x89F0
+#define SIOCPROTOPRIVATE 0x89E0
#endif
-
diff --git a/include/libc/libc_limits.h b/include/libc/libc_limits.h
new file mode 100644
index 0000000000..b8368160df
--- /dev/null
+++ b/include/libc/libc_limits.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2006-2018, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-09-05 Meco Manthe first version
+ */
+
+#ifndef LIBC_LIMITS_H__
+#define LIBC_LIMITS_H__
+
+#include <limits.h>
+#include <rtconfig.h>
+
+#ifdef RT_USING_POSIX
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX LONG_MAX
+#endif
+
+#endif
+
+#endif
diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h
index 898fe13f43..539685de3e 100644
--- a/include/libc/libc_signal.h
+++ b/include/libc/libc_signal.h
@@ -15,6 +15,7 @@
extern "C" {
#endif
+#include <stdint.h>
#ifdef HAVE_CCONFIG_H
#include <cconfig.h>
#endif
@@ -46,8 +47,8 @@ struct sigevent
#ifndef HAVE_SIGINFO
struct siginfo
{
- rt_uint16_t si_signo;
- rt_uint16_t si_code;
+ uint16_t si_signo;
+ uint16_t si_code;
union sigval si_value;
};
diff --git a/include/libc/libc_stat.h b/include/libc/libc_stat.h
index 9079d1ef15..6497cfe12c 100644
--- a/include/libc/libc_stat.h
+++ b/include/libc/libc_stat.h
@@ -9,7 +9,7 @@
#include <rtconfig.h>
-#if defined(RT_USING_NEWLIB)
+#if defined(RT_USING_NEWLIB) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))
/* use header file of newlib */
#include <sys/stat.h>
diff --git a/include/libc/libc_stdio.h b/include/libc/libc_stdio.h
new file mode 100644
index 0000000000..85ba509852
--- /dev/null
+++ b/include/libc/libc_stdio.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2006-2018, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-09-05 Meco Manthe first version
+ */
+
+#ifndef LIBC_STDIO_H__
+#define LIBC_STDIO_H__
+
+#include <rtconfig.h>
+
+#ifdef RT_USING_POSIX_GETLINE
+
+#include <posix_getline.h>
+
+#endif
+
+#endif