3 ms·
crap, i definitely meant to write `printf(...)` there ! my typical usage for such scenarios i.e. when i know that callee might alter errno etc. is to
by signa11 3y ago
crap, i definitely meant to write `printf(...)` there !
my typical usage for such scenarios i.e. when i know that callee might alter errno etc. is to
int save_errno = errno;
do_foo(...);
if (errno == ...) {
...
}
wrapping libc into something that (maybe) does better seems like such a sisyphean task to me.
- burntsushi 3y agoThis thread isn't talking about how to fix the errno problem generally. It's talking about the existence of a problem in the first place. Fixing it would be a whole different can of worms, and indeed, sisyphean sounds about right. Notice how this entire thread was started by someone asking why errno was problematic. This is just about understanding.
- signa11 3y ago> Notice how this entire thread was started by someone asking why errno was problematic. This is just about understanding. yes, you are absolutely right. this is just about understanding and how easy it is to miss what is hidden just one-level away.