Checking if errno != EINTR: what does it mean?

前端 未结 3 1210
故里飘歌
故里飘歌 2020-12-09 03:39

I\'ve found this piece of code used several times (also a similar one where it\'s used open() instead of write()).

int c = write(fd         


        
3条回答
  •  Happy的楠姐
    2020-12-09 04:19

    the answers here are really good and i want to add some internal details :

    System calls that are interrupted by signals can either abort and return EINTR or automatically restart themselves if and only if SA_RESTART is specified in sigaction(2)

    and the one responsible for this task is the restart_block which used to track information and arguments for restarting system calls

提交回复
热议问题