Page MenuHomeFreeBSD

Use extended errors for err(3) and warn(3)
Needs ReviewPublic

Authored by kib on Thu, Jul 3, 3:08 AM.

Details

Summary
uexterr_format(): simplify output when ext error string is available

If the extended error string is provided by kernel, return only the
string, which is supposedly enough to identify exact cause of the error.
If the string is not provided, print the technically looking gibberish
which still allows to identify location with kernel sources.


err(3): print extended error if available

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Thu, Jul 3, 3:08 AM
lib/libc/gen/err.c
96

Should this be false, since the errno is coming from the caller instead of from the kernel?

lib/libc/gen/err.c
96

I am not sure. There are syscalls returning error instead of setting errno, and errc() is naturally used with them. I definitely mean this.

The question is probably should warnc() and errc() be consistent in this regard.