首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SIGSTOP和SIGTSTP有什么区别?

SIGSTOP和SIGTSTP有什么区别?
EN

Stack Overflow用户
提问于 2012-08-09 23:31:31
回答 3查看 68.5K关注 0票数 126

只是想知道SIGSTOP和SIGTSTP信号之间的区别。

EN

回答 3

Stack Overflow用户

发布于 2013-04-22 10:10:13

/usr/include/x86_64-linux-gnu/bits/signum.h

代码语言:javascript
复制
#define SIGSTOP     19  /* Stop, unblockable (POSIX).  */
#define SIGTSTP     20  /* Keyboard stop (POSIX).  */
票数 47
EN

Stack Overflow用户

发布于 2018-09-30 13:56:46

目标进程不能忽略SIGSTOP。

视频播放器mpv就是一个很好的例子,它可以忽略SIGTSTP,但不能忽略SIGSTOP

您可以使用运行以下代码的视频进行测试:

kill -SIGTSTP $(pidof mpv)kill -SIGSTOP $(pidof mpv)

当然,kill -SIGCONT $(pidof mpv)可以恢复播放。

票数 2
EN

Stack Overflow用户

发布于 2022-01-08 06:48:09

在ubuntu上,/usr/include/x86_64-linux-gnu/bits/signum-generic.h

代码语言:javascript
复制
#ifdef __USE_XOPEN
# define SIG_HOLD ((__sighandler_t) 2)  /* Add signal to hold mask.  */
#endif

/* We define here all the signal names listed in POSIX (1003.1-2008);
   as of 1003.1-2013, no additional signals have been added by POSIX.
   We also define here signal names that historically exist in every
   real-world POSIX variant (e.g. SIGWINCH).

   Signals in the 1-15 range are defined with their historical numbers.
   For other signals, we use the BSD numbers.
   There are two unallocated signal numbers in the 1-31 range: 7 and 29.
   Signal number 0 is reserved for use as kill(pid, 0), to test whether
   a process exists without sending it a signal.  */

/* ISO C99 signals.  */
#define SIGINT      2   /* Interactive attention signal.  */
#define SIGILL      4   /* Illegal instruction.  */
#define SIGABRT     6   /* Abnormal termination.  */
#define SIGFPE      8   /* Erroneous arithmetic operation.  */
#define SIGSEGV     11  /* Invalid access to storage.  */
#define SIGTERM     15  /* Termination request.  */

/* Historical signals specified by POSIX. */
#define SIGHUP      1   /* Hangup.  */
#define SIGQUIT     3   /* Quit.  */
#define SIGTRAP     5   /* Trace/breakpoint trap.  */
#define SIGKILL     9   /* Killed.  */
#define SIGBUS      10  /* Bus error.  */
#define SIGSYS      12  /* Bad system call.  */
#define SIGPIPE     13  /* Broken pipe.  */
#define SIGALRM     14  /* Alarm clock.  */

/* New(er) POSIX signals (1003.1-2008, 1003.1-2013).  */
#define SIGURG      16  /* Urgent data is available at a socket.  */
#define SIGSTOP     17  /* Stop, unblockable.  */
#define SIGTSTP     18  /* Keyboard stop.  */
#define SIGCONT     19  /* Continue.  */
#define SIGCHLD     20  /* Child terminated or stopped.  */
#define SIGTTIN     21  /* Background read from control terminal.  */
#define SIGTTOU     22  /* Background write to control terminal.  */
#define SIGPOLL     23  /* Pollable event occurred (System V).  */
#define SIGXCPU     24  /* CPU time limit exceeded.  */
#define SIGXFSZ     25  /* File size limit exceeded.  */
#define SIGVTALRM   26  /* Virtual timer expired.  */
#define SIGPROF     27  /* Profiling timer expired.  */
#define SIGUSR1     30  /* User-defined signal 1.  */
#define SIGUSR2     31  /* User-defined signal 2.  */
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11886812

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档