开发者

Finding out who set errno

开发者 https://www.devze.com 2023-02-17 02:59 出处:网络
Is there a w开发者_运维技巧ay to find out in which function/file/line set the current errno?Not that I know of, it\'s just a global static int (no magic in it) (see comment below).

Is there a w开发者_运维技巧ay to find out in which function/file/line set the current errno?


Not that I know of, it's just a global static int (no magic in it) (see comment below).

You're supposed to check after each function that could set it when it returns an error.


Unfortunately not programmatically.

Just a thought: if this is a debugging issue, it might be possible to set a memory breakpoint on the address where the value of errno is stored and have it break when the memory is written to. The call stack would then tell you who did it.

0

精彩评论

暂无评论...
验证码 换一张
取 消