Sponsored by: Netflix
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 72338 Build 69221: arc lint + arc unit
Event Timeline
| sys/kern/kern_time.c | ||
|---|---|---|
| 530 | In fact all cases could benefit from providing the wrong value that triggered the EINVAL, but this is optional. | |
| sys/kern/kern_time.c | ||
|---|---|---|
| 801 | The format string and the arguments are copied intact from kernel to usermode. Usermode, libc specifically, does the formatting. Arguments are marshaled through uint64_t objects, and are cast to uintmax_t for the formatting. This is done so no memory allocation happens in kernel on error, so that EXTERROR() works in almost any context that has a valid struct thread. | |
| sys/kern/kern_time.c | ||
|---|---|---|
| 801 | It is documented in exterror(9) | |
I did not intended to shame, sorry if it can be read this way. I tried to note that this is specified and is not a tribal knowledge to posses.
What you said was fine. exterror(9) is explicit which is great! I jsut was confused.
Always glad to see more use of EXTERROR.
| sys/kern/kern_time.c | ||
|---|---|---|
| 430 | Suggest being more specific: if (!timespecvalid_interval(ats)) {
if (ats->tv_sec < 0)
return (EXTERROR(EINVAL, "Backward clock jump"));
return (EXTERROR(EINVAL, "Out of range tv_nsec %jd",
ats->tv_nsec));
} | |
Your title on this phabricator review needs to be more specific. There are about 11,000 instances of EINVAL returns and you are not adding EXTERROR for all of them. So being a bit more specific about which subsystem you are doing is needed.