Is there any way to create a user defined signal in Linux?

孤人 提交于 2019-11-29 01:58:05

You can't add or register your own SIGWHATEVER.

See sigset_t, it is fixed size. See valid_signal() beartraps.

SIGRTMIN through SIGRTMAX (these are not normally constants but macros which expand to functions evaluated at runtime) are available for whatever use you like, as are SIGUSR1 and SIGUSR2. The former have additional realtime queueing support; the latter don't. Simply choose one to use.

You can compile your own kernel with special signals :)

There are the USR1 and USR2 signals designed for user defined purposes.

You can use USR1 and USR2 for this kind of thing.

If that's not enough, you can emulate signal like behaviour by having your application listen on a socket which external apps can send messages to.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!