Commit Graph

72 Commits

Author SHA1 Message Date
Xiang Xiao bea6e0ddd7 sched/signal: Implement SA_NODEFER and SA_RESETHAND
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I9baa72b272c8877022cd94722824f393c7087721
2021-03-31 18:27:01 -03:00
Jiuzhu Dong 48050c9425 signal: set SIGRTMIN to SIGUSR1 because signo 0 don't catch.
Change-Id: I600fed48d25e19c229aac899508b86ddfebb24f6
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-02-25 22:27:24 -08:00
ligd 2dfd7a4e8f signal.h: fix compile failed when open TTY_SIGINT
In file included from string/lib_strsignal.c:40:0:
string/lib_strsignal.c: In function ‘strsignal’:
string/lib_strsignal.c:142:12: error: ‘CONFIG_SIG_STOP’ undeclared (first use in this function); did you mean ‘CONFIG_SIG_PIPE’?
       case SIGSTOP:
            ^
string/lib_strsignal.c:142:12: note: each undeclared identifier is reported only once for each function it appears in
string/lib_strsignal.c:147:12: error: ‘CONFIG_SIG_STP’ undeclared (first use in this function); did you mean ‘CONFIG_SIG_STOP’?
       case SIGSTP:

Esnure all standard signal number is always defined

Change-Id: I3abce86079ebeba7bab038d7c770efc90b9cffd7
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-11-05 08:28:53 +01:00
Yoshinori Sugino c13f869432 Modify SIGSTP to SIGTSTP
Follow the POSIX description.
SIGTSTP should be sent when the Ctrl-Z characters is encountered, not SIGSTP.

Testing:
Built with hifive1-revb:nsh (CONFIG_SERIAL_TERMIOS=y, CONFIG_SIG_DEFAULT=y and CONFIG_TTY_SIGTSTP=y)
2020-10-29 01:12:43 -07:00
Yoshinori Sugino 04c0055355 Fix typos 2020-10-28 19:15:04 -07:00
YAMAMOTO Takashi 6a2bd9a75b Change the default value of SIGPIPE
To avoid the conflicting default with SIGQUIT.
2020-10-25 20:35:41 -07:00
YAMAMOTO Takashi ad5c168b30 signalh.h: Use the right config for SIGPIPE 2020-10-25 20:35:41 -07:00
ligd f428160dcc signal: add SIGQUIT & SIGTERM support
SIGQUIT SIGTERM are equal with SIGINT now

Change-Id: Iefc084d58db28003dc40a17f1ff3fbd7a0b716ed
2020-09-11 10:41:24 +08:00
Xiang Xiao b3e01168db sched/signal: Add sighandler_t typedef
improve the compatibility for glibc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I925e8cbea18848dfc75c97aa72a12b91810aa9e8
2020-08-21 09:59:46 +01:00
Gregory Nutt 72104c182c nxstyle fixes
Run all files modified by PR 766 through nxstyle and fix any resulting complaints.

NOTE:  Numerous "Mixed case identifier" errors in arch/arm/src/cxd56xx/cxd56_gnss.c were not fixed because this problem is of much larger scope than this file.
2020-04-11 21:19:47 +01:00
Gregory Nutt 67ec3d7926 Remove CONFIG_CAN_PASS_STRUCT
This commit resolves issue #620:

Remove CONFIG_CAN_PASS_STRUCTS #620

The configuration option CONFIG_CAN_PASS_STRUCTS was added many years ago to support an old version of the SDCC compiler. That compiler is currently used only with the Z80 and Z180 targets. The limitation of that old compiler was that it could not pass structures or unions as either inputs or outputs. For example:

    #ifdef CONFIG_CAN_PASS_STRUCTS
    struct mallinfo mallinfo(void);
    #else
    int      mallinfo(FAR struct mallinfo *info);
    #endif

And even leads to violation of a few POSIX interfaces like:

    #ifdef CONFIG_CAN_PASS_STRUCTS
    int  sigqueue(int pid, int signo, union sigval value);
    #else
    int  sigqueue(int pid, int signo, FAR void *sival_ptr);
    #endif

This breaks the 1st INVIOLABLES rule:

Strict POSIX compliance
-----------------------

  o Strict conformance to the portable standard OS interface as defined at
    OpenGroup.org.
  o A deeply embedded system requires some special support.  Special
    support must be minimized.
  o The portable interface must never be compromised only for the sake of
    expediency.
  o Expediency or even improved performance are not justifications for
   violation of the strict POSIX interface

Also, it appears that the current SDCC compilers have resolve this issue and so, perhaps, this is no longer a problem: z88dk/z88dk#1132

NOTE:  This commit cannot pass the PR checks because it depends on matching changes to the apps/ directory.
2020-04-11 21:19:47 +01:00
Nathan Hartman a5e643b0cd Fix typos in comments and documentation. 2020-03-16 20:01:11 -06:00
liuhaitao b2f8a79c3b sched/signal: Add support for SIGPIPE. SIGPIPE uses SIG_SIGPIPE_ACTION which terminates process by default. It also could be ignored. 2019-10-17 11:29:39 -06:00
Gregory Nutt fc79fc5ce1 arch/z80/src: Fix ez80 compile problems due to New ZDS-II toolchain and ongoing bit rot due to non-C89 code creeping into the core OS. 2019-06-02 15:36:38 -06:00
oao Matos 24f5cde922 include/signal.h: Add commented out definition of the si_addr field. 2019-04-04 11:22:52 -06:00
Xiang Xiao 43d47a66c5 include/pthread.h and signal.h: Avoid redefinition of types 2019-01-27 11:34:39 -06:00
Gregory Nutt 68d4c1d4ed C library: Add some new functions defined in POSIX.1-2017: stpncpy(), strsignal(), psignal(), psiginfo(). 2018-09-17 13:55:33 -06:00
Gregory Nutt 33e3fb7a70 Correct mispellings of pseudo. Update some comments in signal.h. 2018-09-05 11:56:14 -06:00
Gregory Nutt a7265d71c6 This commit adds support for default signal actions for SIGSTOP, SIGSTP, and SIGCONT.
Squashed commit of the following:

    Add procfs support to show stopped tasks.  Add nxsig_action() to solve a chicken and egg problem:  We needed to use sigaction to set default actions, but sigaction() would refuse to set actions if the default actions could not be caught or ignored.

    sched/signal:  Add configuration option to selectively enabled/disable default signal actions for SIGSTOP/SIGSTP/SIGCONT and SIGKILL/SIGINT.  Fix some compilation issues.

    sched/sched:  Okay.. I figured out a way to handle state changes that may occur while they were stopped. If a task/thread was already blocked when SIGSTOP/SIGSTP was received, it will restart in the running state.  I will appear that to the task/thread that the blocked condition was interrupt by a signal and returns the EINTR error.

    sched/group and sched/sched:  Finish framework for continue/resume logic.

    sched/signal:  Roughing out basic structure to support task suspend/resume
2018-08-30 10:27:18 -06:00
Gregory Nutt 0756cf66ed sched/signal: Add support for SIGINT in addition to SIGKILL. drivers/serial: Use SIGINT instead of SIGKILL when control-C is pressed. 2018-08-28 12:15:31 -06:00
Gregory Nutt 499b89feed sched/signal: Default Signal Actions. Change some types to superficially simplify. Add configuration options to enabled default signal behaviors on a per-signal basis. I don't think users are prepared for SIGALRM to terminate the task (which is the correct default behavior if you don't change it). Extend the implementation of default signals so that it is totally table driven and extensible by simply mondifying the content of const tables. 2018-08-27 15:37:43 -06:00
Gregory Nutt 6d094e4b33 sched/signals: Update the signal default action logic to support sigaction(). signaction() must be able to handle and input action of SIG_DFL to setup the default signal action; it mast also return SIG_DFL it is replacing the default action. 2018-08-27 13:13:23 -06:00
Gregory Nutt c0d234a474 Squashed commit of the following:
drivers/serial/Kconfig:  It is no longer necessary to restrict Ctrl-C handling to the FLAT build

    sched/signal:  Add a new configuration option to select signal default actions, separate handling of signal default actions from both task startup logic and from the serial TTY Ctrl-C logic.  Add a signal set in the group structure to keep track of what signals have been set to the default action.  In dispatching signals in PROTECTED or KERNEL mode, use this signal set to determine if the default signal handler is attached and dispatch the signal in kernel mode for the default actions.
2018-08-27 11:40:09 -06:00
ligd 11f8dc735c Squashed commit of the following:
drivers/serial:  Add Ctrl-C/Ctrl-X support.  This is an initial working implementation that still requires that several details be resolved.

    sched/task/task_start.c: Add default signal action to SIGKILL.
2018-08-26 08:49:08 -06:00
Gregory Nutt 07ef3fe018 Another update to the coding standard; Add some comments detailing the POSIX non-compliance in include/signal.h 2018-08-21 15:27:37 -06:00
Gregory Nutt bf7839d0f0 libc/signal: Add support for sigwait(). 2017-11-11 12:37:47 -06:00
Gregory Nutt 3664b0ab66 SDCC Fixes: Change some prototypes and some assumptions about the size of unsigned int to get to a clean SDCC compile. 2017-10-08 08:50:18 -06:00
Gregory Nutt 440d535360 include/cxx: Update some C++ header files due to recent changes to C hader files 2016-08-25 15:06:46 -06:00
Sebastien Lorquet 7021b143ce Add POSIX type sig_atomic_t 2016-08-24 10:16:41 -06:00
Gregory Nutt 830af912a1 Add sig_raise() 2016-07-04 09:32:36 -06:00
Aleksandr Vyhovanec c939bbe47a include/signal.h: Change type of SIG_IGN and related defines to _sa_handler_t 2016-06-07 06:56:19 -06:00
Gregory Nutt 6653c5cbf3 Signals: Correct implementation of sigset(). It is not just signal() with a different name; it has some additional signal mask handling functionality 2016-04-11 09:04:54 -06:00
Gregory Nutt 947aa792db Signals: Fix the macro that maps segset() to signal(). Parameters were not correct. 2016-04-10 16:41:50 -06:00
Gregory Nutt 28a4ca6713 libc/signal and include/signal.h: Rename sigset() to signal(). sigset() is the System V function; signal() is the obsoleted POSIX name. These seem to be equivalent. Neither are relevant in modern POSIX programming but the name signal() probably has better credentials. sigset() is now relegated to a #define in signal.h that makes it equivalent to signal(). 2016-04-10 14:35:45 -06:00
Gregory Nutt b1938c065d sys/time.h: Fix timersub macro; time_t is unsigned 2015-12-31 09:05:35 -06:00
Gregory Nutt c1fff4706c signals: Adds a very limited, minimal implementation for SIGEV_THREAD 2015-12-30 15:01:14 -06:00
Gregory Nutt 9835eeb181 signals: Basic framework to support SIGEV_THREAD 2015-12-30 13:20:31 -06:00
Gregory Nutt 768d892188 Add si_errno to siginfo_t 2015-08-14 10:10:32 -06:00
Gregory Nutt 9cbac41e78 Clean-up/standardize a few header files 2015-08-03 11:01:41 -06:00
Gregory Nutt b578c98fa9 Clean up and review of header files for conformance to standards 2015-06-12 19:26:01 -06:00
Gregory Nutt fc45d5a2b7 SIG_HOLD is not yet implemented 2015-04-09 11:25:15 -06:00
Gregory Nutt 81703e6fad Add sigset() 2015-04-09 10:16:35 -06:00
Gregory Nutt 4c60fe666c Add sighold(), sigrelse(), sigignore(), and sigpause(). 2015-04-09 08:07:09 -06:00
Gregory Nutt 652d3ed29d Rename CONFIG_LIBC_AIO to CONFIG_FS_AIO since it is now an OS property 2014-10-05 15:44:43 -06:00
Gregory Nutt c274acc48f Move AIO signal logic to a common location in aio_signal.c. Also fix several typos 2014-10-05 06:53:56 -06:00
Gregory Nutt 31cdcde73a Add definitions for SIGPOLL 2014-10-05 06:02:37 -06:00
Gregory Nutt 352c313fa7 Fix typo/compilation error with USB device DMA memory allocation is enabled 2013-07-12 07:09:24 -06:00
patacongo b3890db5ce Add support for calling to and returning from signal handlers in in user-mode threads
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5750 42af7a65-404d-4744-a932-0658087f49c3
2013-03-17 00:40:49 +00:00
patacongo 3736ae6ba9 Add logic to retain child task exit status if so configured
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5553 42af7a65-404d-4744-a932-0658087f49c3
2013-01-23 22:23:46 +00:00
patacongo 3888a00d2d Add internal API task_reparent(), used in posix_spawn(). Move libc/spawn/lib_ps.c to sched/task_posixspawn.c; Move libc/spawn/spawn.h to include/nuttx/spawn.h
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5531 42af7a65-404d-4744-a932-0658087f49c3
2013-01-18 01:52:42 +00:00