History

binder: add BINDER_GET_EXTENDED_ERROR ioctl

Provide a userspace mechanism to pull precise error information upon failed operations. Extending the current error codes returned by the interfaces allows userspace to better determine the course of action. This could be for instance, retrying a failed transaction at a later point and thus offloading the error handling from the driver.

Carlos Llamas committed 4 years ago

Commit bd328891 parent 9474be33 files · +79 −0Browse files

Showing the changes to include/uapi/linux/android (1 of 3 files). Show all

Unified · Split

include/uapi/linux/android/binder.h+16−0
@@ -236,6 +236,21 @@ struct binder_frozen_status_info { · 235 unmodified lines
236 __u32 async_recv;236 __u32 async_recv;
237};237};
238 238
239/* struct binder_extened_error - extended error information
240 * @id: identifier for the failed operation
241 * @command: command as defined by binder_driver_return_protocol
242 * @param: parameter holding a negative errno value
243 *
244 * Used with BINDER_GET_EXTENDED_ERROR. This extends the error information
245 * returned by the driver upon a failed operation. Userspace can pull this
246 * data to properly handle specific error scenarios.
247 */
248struct binder_extended_error {
249 __u32 id;
250 __u32 command;
251 __s32 param;
252};
253
239#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)254#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
240#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)255#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
241#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)256#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
@@ -249,6 +264,7 @@ struct binder_frozen_status_info { · 7 unmodified lines
249#define BINDER_FREEZE _IOW('b', 14, struct binder_freeze_info)264#define BINDER_FREEZE _IOW('b', 14, struct binder_freeze_info)
250#define BINDER_GET_FROZEN_INFO _IOWR('b', 15, struct binder_frozen_status_info)265#define BINDER_GET_FROZEN_INFO _IOWR('b', 15, struct binder_frozen_status_info)
251#define BINDER_ENABLE_ONEWAY_SPAM_DETECTION _IOW('b', 16, __u32)266#define BINDER_ENABLE_ONEWAY_SPAM_DETECTION _IOW('b', 16, __u32)
267#define BINDER_GET_EXTENDED_ERROR _IOWR('b', 17, struct binder_extended_error)
252 268
253/*269/*
254 * NOTE: Two special error codes you should check for when calling270 * NOTE: Two special error codes you should check for when calling

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t