| Previous | Next |
| KERN_POLICY_STATIC | KERN_DENIED |
KERN_INSUFFICIENT_BUFFER_SIZE
KERN_INSUFFICIENT_BUFFER_SIZE means the buffer supplied for a Mach result is smaller than the data the interface needs to return. It is a capacity mismatch at the API boundary, not evidence that the target object disappeared or that the operation itself is unsupported.
The correct recovery depends on the individual routine's size contract. Some interfaces let a caller query or receive the required size, while others impose fixed structures or limits. Do not assume that every API updates an in/out length on failure; read that function's contract before reallocating and retrying.
Safe handling pattern
- Record the supplied capacity, the returned or expected size, and the element-size assumptions.
- Use checked arithmetic when converting counts to byte lengths.
- Initialize all size fields exactly as the API requires before the call.
- Retry only after confirming that the operation is idempotent or that the failed call did not consume or transfer state.
References
Looking for a different code? Search another status or error code.