我创建了一个进程,并在内部尝试降低其美观的值:
this.form.setvalue(value,{emitEvent:false});
如果使用sudo,为什么输出为-1或0?如何设置一个等于-19的值?
如果我尝试增加美观的值,程序将正常运行。
编辑:对上面的代码感到抱歉;如果我使用sudo运行以下代码,则输出为0:
#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
int main()
{
printf("Modified nice value: \t %d\n",nice(-19)); // Output: -1; if I run with sudo the output is 0
return 0;
}
相反,如果我使用sudo运行以上代码(在编辑之前),则输出为-19。为什么在后一种情况(“编辑情况”)中输出为0?
如果我评论前三个printf,则输出为-19。