| Previous | Next |
| KERN_INVALID_RIGHT | KERN_UREFS_OVERFLOW |
KERN_INVALID_VALUE
KERN_INVALID_VALUE is the Mach range-error result. XNU characterizes it as a blatant range error, so the relevant question is not merely whether an argument was present, but whether its numeric value, size, count, offset, or enumerated range is valid for the called interface.
This is narrower than KERN_INVALID_ARGUMENT. An argument can be of the wrong kind or inapplicable to an operation without being numerically out of range; conversely, a correctly typed input can fail because it exceeds an API's allowed bounds. Keeping those cases distinct makes caller-side validation and telemetry much more useful.
Checks that match this result
- Confirm the units for lengths, offsets, timeouts, and counts; bytes, pages, and elements are not interchangeable.
- Check integer conversions and multiplication for overflow before a value reaches a Mach call.
- Validate that a range stays within the target task's address or object limits.
- For an enum or option field, verify the documented accepted set instead of masking unknown bits silently.
References
Looking for a different code? Search another status or error code.