我正在尝试编写调度程序。作为我正在使用该功能的一部分 list_empty()检查它是返回NULL还是非零值。
如果我用它,
if(!list_empty(<I fill in the head pointer here>)) {
<do necessary operations>
return 1;
}
return 0;
我的内核没有崩溃。 但是,如果我实现相同的逻辑,
if(list_empty(<I fill in the head pointer here>)) {
return 0;
}
<do necessary operations>
return 1;
我的内核爆炸了。我可以通过第一种方式而不是第二种方式实现我的代码。我只是想知道这种行为差异背后的原因。知道为什么会这样吗?