在10.6节的可冲入函数段落中,有一段示例程序,这段程序从信号处理函数中调用非可重入函数getpwnam
每一秒my_alarm都会被调用一次。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
但是当我运行出来之后,显示:getpwnam error: Success
我想知道这个Success在哪里出来的呢。代码里面没有看到。而且,不是说每隔一秒就会调用一次吗,但是程序运行一次就结束了。
巴扎黑2017-04-17 16:34:47
Your machine did not sar
这个用户。所以程序会执行err_sys("getpwnam error");
。然后err_sys最后会执行exit(1)
exit.
Because Shenma has Success, you can trace the implementation of apue error handling.