diff options
| author | Bernard Xiong <[email protected]> | 2019-12-19 08:52:10 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-12-19 08:52:10 +0800 |
| commit | c05d9dfee630cb6f2bdbb296de6a34e21e4beb36 (patch) | |
| tree | 453fa191605a9345d029acaf5d1c64b3ab3a9d06 | |
| parent | a87c2ef9703c1aaeb8020a328f0ed981418ec283 (diff) | |
| parent | b5e4aa58e0b943e02335ef253a7fbce4e9dda238 (diff) | |
Merge pull request #3276 from BernardXiong/fix_signal_minilibc
[Kernel] Fix the signal compiling issue when using minilibc
| -rw-r--r-- | components/libc/compilers/minilibc/signal.h | 20 | ||||
| -rw-r--r-- | include/libc/libc_signal.h | 15 |
2 files changed, 25 insertions, 10 deletions
diff --git a/components/libc/compilers/minilibc/signal.h b/components/libc/compilers/minilibc/signal.h new file mode 100644 index 0000000000..f52f1e1009 --- /dev/null +++ b/components/libc/compilers/minilibc/signal.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2017-09-12 Bernard The first version + */ + +#ifndef SIGNAL_H__ +#define SIGNAL_H__ + +#include <libc/libc_signal.h> + +#define SIG_DFL ((_sig_func_ptr)0) /* Default action */ +#define SIG_IGN ((_sig_func_ptr)1) /* Ignore action */ +#define SIG_ERR ((_sig_func_ptr)-1) /* Error return */ + +#endif diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h index c77f36798c..898fe13f43 100644 --- a/include/libc/libc_signal.h +++ b/include/libc/libc_signal.h @@ -63,13 +63,14 @@ typedef struct siginfo siginfo_t; #define SI_MESGQ 0x05 /* Signal generated by arrival of a message on an empty message queue. */ -#ifdef RT_USING_NEWLIB -#include <sys/signal.h> +#if !defined(RT_USING_NEWLIB) +typedef void (*_sig_func_ptr)(int); +typedef unsigned long sigset_t; #endif -#if defined(__CC_ARM) || defined(__CLANG_ARM) #include <signal.h> -typedef unsigned long sigset_t; + +#if defined(__CC_ARM) || defined(__CLANG_ARM) #define SIGHUP 1 /* #define SIGINT 2 */ @@ -105,8 +106,6 @@ typedef unsigned long sigset_t; #define SIG_BLOCK 1 /* set of signals to block */ #define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ -typedef void (*_sig_func_ptr)(int); - struct sigaction { _sig_func_ptr sa_handler; @@ -124,8 +123,6 @@ int sigprocmask (int how, const sigset_t *set, sigset_t *oset); int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); #elif defined(__IAR_SYSTEMS_ICC__) -#include <signal.h> -typedef unsigned long sigset_t; #define SIGHUP 1 #define SIGINT 2 @@ -161,8 +158,6 @@ typedef unsigned long sigset_t; #define SIG_BLOCK 1 /* set of signals to block */ #define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ -typedef void (*_sig_func_ptr)(int); - struct sigaction { _sig_func_ptr sa_handler; |
