Signal handling and sigemptyset()

后端 未结 3 1990
轮回少年
轮回少年 2020-12-24 07:28

Could anyone please explain in a really easy way to understand what sigemptyset() does? Why is it useful? I\'ve read a bunch of definitions but i just don\'t understand. Fro

3条回答
  •  被撕碎了的回忆
    2020-12-24 08:06

    sigemptyset simply initializes the signalmask to empty, such that it is guaranteed that no signal would be masked. (that is, all signals will be received) Basically it is similar to a memset(0) but you don't have to know the details of the implementation. So if the sa_mask member is changed you don't need to adjust your code because it will be taken care of by sigemptyset.

提交回复
热议问题