哪些系统调用不会被信号中断?

Which system calls are not interrupted by a signal?

据我所知,linux/unix 上的大多数系统调用在收到信号时都会中断。根据下面的博客post,有一些系统调用没有中断:

In general function that return immediately (don't wait for any I/O operation to complete or sleep) are not interruptible like socket(2) which just allocates a socket and doesn't wait for anything.

http://www.linuxprogrammingblog.com/all-about-linux-signals?page=5

是否有这些函数的列表?任何与此主题相关的链接都会有所帮助。

What is the mechanism that kernel uses to decide which call is interruptible and which one is not? (if the story with "socket()" is true)

任务有位掩码,可以用set_task_state to TASK_INTERRUPTIBLE and TASK_UNINTERRUPTIBLE ( defined here设置)。

Is there a list of those kind of functions?

我不认为有不间断函数列表。您可以搜索 TASK_UNINTERRUPTIBLE 的用法(如 this

编辑:example of checking this flag with signal_pending_state