在这样处理方式下,write系统调用返回被信号中断前已写的字节数,并将errno全局变量设置为成功。
By doing this the write system call returns with the number of bytes it wrote before it got interrupted and the errno set to success.
那是因为只有一些系统调用可以安全地调用内部信号:只有可重入的(re - entrant)或者不被信号中断的调用才可以被安全地调用。
That's because only a few system calls can be safely called inside signals. Only calls that are re-entrant or not interruptible by signals can be called safely.
应用推荐