diff options
Diffstat (limited to 'nuttx/examples/nxflat/tests/signal')
-rw-r--r-- | nuttx/examples/nxflat/tests/signal/signal.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/nuttx/examples/nxflat/tests/signal/signal.c b/nuttx/examples/nxflat/tests/signal/signal.c index ff845ec10..ff1c58305 100644 --- a/nuttx/examples/nxflat/tests/signal/signal.c +++ b/nuttx/examples/nxflat/tests/signal/signal.c @@ -69,7 +69,12 @@ static int sigusr2_rcvd = 0; * Name: sigusr1_sighandler ****************************************************************************/ -static void sigusr1_sighandler(int signo) +/* NOTE: it is necessary for functions that are referred to by function pointers + * pointer to be declared with global scope (at least for ARM). Otherwise, + * a relocation type that is not supported by NXFLAT is generated by GCC. + */ + +void sigusr1_sighandler(int signo) { printf("sigusr1_sighandler: Received SIGUSR1, signo=%d\n", signo); sigusr1_rcvd = 1; @@ -79,8 +84,13 @@ static void sigusr1_sighandler(int signo) * Name: sigusr2_sigaction ***************************************************************************/ +/* NOTE: it is necessary for functions that are referred to by function pointers + * pointer to be declared with global scope (at least for ARM). Otherwise, + * a relocation type that is not supported by NXFLAT is generated by GCC. + */ + #ifdef __USE_POSIX199309 -static void sigusr2_sigaction(int signo, siginfo_t *siginfo, void *arg) +void sigusr2_sigaction(int signo, siginfo_t *siginfo, void *arg) { printf("sigusr2_sigaction: Received SIGUSR2, signo=%d siginfo=%p arg=%p\n", signo, siginfo, arg); @@ -107,7 +117,7 @@ static void sigusr2_sigaction(int signo, siginfo_t *siginfo, void *arg) sigusr2_rcvd = 1; } #else -static void sigusr2_sigaction(int signo) +void sigusr2_sigaction(int signo) { printf("sigusr2_sigaction: Received SIGUSR2, signo=%d\n", signo); sigusr2_rcvd = 1; |