• Linux中的信号


    以下内容源自Linux 2.6.39内核版本的signal.h(includelinux)文件。记载出便于自己日后查询。

    /*
     * In POSIX a signal is sent either to a specific thread (Linux task)
     * or to the process as a whole (Linux thread group).  How the signal
     * is sent determines whether it's to one thread or the whole group,
     * which determines which signal mask(s) are involved in blocking it
     * from being delivered until later.  When the signal is delivered,
     * either it's caught or ignored by a user handler or it has a default
     * effect that applies to the whole thread group (POSIX process).
     *
     * The possible effects an unblocked signal set to SIG_DFL can have are:
     *   ignore    - Nothing Happens
     *   terminate    - kill the process, i.e. all threads in the group,
     *           similar to exit_group.  The group leader (only) reports
     *          WIFSIGNALED status to its parent.
     *   coredump    - write a core dump file describing all threads using
     *          the same mm and then kill all those threads
     *   stop     - stop all the threads in the group, i.e. TASK_STOPPED state
     *
     * SIGKILL and SIGSTOP cannot be caught, blocked, or ignored.
     * Other signals when not blocked and set to SIG_DFL behaves as follows.
     * The job control signals also have other special effects.
     *
     *    +--------------------+------------------+
     *    |  POSIX signal      |  default action  |
     *    +--------------------+------------------+
     *    |  SIGHUP            |  terminate    |
     *    |  SIGINT            |    terminate    |
     *    |  SIGQUIT           |    coredump     |
     *    |  SIGILL            |    coredump     |
     *    |  SIGTRAP           |    coredump     |
     *    |  SIGABRT/SIGIOT    |    coredump     |
     *    |  SIGBUS            |    coredump     |
     *    |  SIGFPE            |    coredump     |
     *    |  SIGKILL           |    terminate(+)    |
     *    |  SIGUSR1           |    terminate    |
     *    |  SIGSEGV           |    coredump     |
     *    |  SIGUSR2           |    terminate    |
     *    |  SIGPIPE           |    terminate    |
     *    |  SIGALRM           |    terminate    |
     *    |  SIGTERM           |    terminate    |
     *    |  SIGCHLD           |    ignore       |
     *    |  SIGCONT           |    ignore(*)    |
     *    |  SIGSTOP           |    stop(*)(+)      |
     *    |  SIGTSTP           |    stop(*)      |
     *    |  SIGTTIN           |    stop(*)      |
     *    |  SIGTTOU           |    stop(*)      |
     *    |  SIGURG            |    ignore       |
     *    |  SIGXCPU           |    coredump     |
     *    |  SIGXFSZ           |    coredump     |
     *    |  SIGVTALRM         |    terminate    |
     *    |  SIGPROF           |    terminate    |
     *    |  SIGPOLL/SIGIO     |    terminate    |
     *    |  SIGSYS/SIGUNUSED  |    coredump     |
     *    |  SIGSTKFLT         |    terminate    |
     *    |  SIGWINCH          |    ignore       |
     *    |  SIGPWR            |    terminate    |
     *    |  SIGRTMIN-SIGRTMAX |    terminate       |
     *    +--------------------+------------------+
     *    |  non-POSIX signal  |  default action  |
     *    +--------------------+------------------+
     *    |  SIGEMT            |  coredump    |
     *    +--------------------+------------------+
     *
     * (+) For SIGKILL and SIGSTOP the action is "always", not just "default".
     * (*) Special job control effects:
     * When SIGCONT is sent, it resumes the process (all threads in the group)
     * from TASK_STOPPED state and also clears any pending/queued stop signals
     * (any of those marked with "stop(*)").  This happens regardless of blocking,
     * catching, or ignoring SIGCONT.  When any stop signal is sent, it clears
     * any pending/queued SIGCONT signals; this happens regardless of blocking,
     * catching, or ignored the stop signal, though (except for SIGSTOP) the
     * default action of stopping the process may happen later or never.
     */

    如下为Linux/i386中的常规信号:

  • 相关阅读:
    MongoDB:利用官方驱动改装为EF代码风格的MongoDB.Repository框架 二
    Ubuntu系统错误 没有公钥,无法验证下列签名: NO_PUBKEY 5F16B97C1AD28806
    Mysql数据库导出和导入
    Mysql清理binlog日志
    新手应该知道的流量概念
    xdebug对php程序性能分析
    mysql连接错误
    mysql导入导出命令
    mysql导出错误
    linux查看是软件是否安装
  • 原文地址:https://www.cnblogs.com/kunshanpipixia/p/14176554.html
Copyright © 2020-2023  润新知