| Previous | Next |
| KERN_SUCCESS |
kOSReturnSuccess
kOSReturnSuccess is the zero success value in the OSReturn and IOReturn family. It confirms successful completion of the synchronous call, but a later asynchronous transfer, notification, or device-side action may still be pending.
The contract boundary
kOSReturnSuccess, KERN_SUCCESS, and MACH_MSG_SUCCESS can all be numerically zero, but their typedefs and owning APIs are different. Decode zero according to the declared return type instead of treating the three symbols as interchangeable aliases.
Capture before changing state
| Capture | Diagnostic value |
|---|---|
| The declared return type and exact Libkern or IOKit method that returned zero. | Identifies the concrete object and operation associated with successful Libkern or IOKit operation. |
| The IOService, IOUserClient, memory descriptor, or command object generation involved in the call. | Separates argument or lifecycle state from the provider beneath kOSReturnSuccess. |
| Output lengths, ownership changes, and any completion callback scheduled after the synchronous return. | Links the zero return to the outputs, ownership changes, and asynchronous work created by that call. |
| The next service message or hardware completion result associated with the same operation identifier. | Shows whether kOSReturnSuccess is the first result or a translated summary. |
Focused experiments
- Run the same method with a deliberately unsupported argument and confirm that it returns an IOReturn-family error rather than errno.
- Compare synchronous completion with a request whose documented completion is delivered later through a callback or message.
- Verify every returned object and output length before using them even though the status is zero.
A defensible resolution
Targeted correction. Keep the successful return handling in the IOKit contract and wait for any documented asynchronous completion before releasing buffers or service objects.
Acceptance criterion. The API returns it, documented outputs are valid, ownership rules are satisfied, and any asynchronous completion arrives exactly once for the same request.
Technical references
- Apple XNU: IOReturn definitions — defines the status namespace used.
- Apple Developer: IOKit — documents the API or lifecycle boundary behind it.
- Apple XNU source repository — provides ABI, implementation, or protocol context.
- Apple: Mach and kernel programming overview — supports the portability and verification limits.
Looking for a different code? Search another status or error code.