diff options
author | Marcin Niesluchowski <m.niesluchow@samsung.com> | 2015-05-21 16:24:30 +0200 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-12-14 13:49:15 +0900 |
commit | a6b3b517a1b5ce5faab04d2a4ba1dc05a9e8fa7a (patch) | |
tree | 316c0e4e91b4190e996ba90446247fa9457b07c6 /include/uapi | |
parent | a6ef3e8fba638c910faff51b5e9053356f6c2dff (diff) |
kmsg: add ioctl for kmsg* devices operating on buffers
There is no possibility to clear additional kmsg buffers,
get size of them or know what size should be passed to read
file operation (too small size causes it to retrun -EINVAL).
Add following ioctls which solve those issues:
* KMSG_CMD_GET_BUF_SIZE
* KMSG_CMD_GET_READ_SIZE_MAX
* KMSG_CMD_CLEAR
Change-Id: I7ee4c54495f6c4fd1458fd2998ffae0f3a8866c0
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
Diffstat (limited to 'include/uapi')
-rw-r--r-- | include/uapi/linux/kmsg_ioctl.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/uapi/linux/kmsg_ioctl.h b/include/uapi/linux/kmsg_ioctl.h index 89c0c615c4ea..2389d9f09706 100644 --- a/include/uapi/linux/kmsg_ioctl.h +++ b/include/uapi/linux/kmsg_ioctl.h @@ -27,4 +27,19 @@ struct kmsg_cmd_buffer_add { struct kmsg_cmd_buffer_add) #define KMSG_CMD_BUFFER_DEL _IOW(KMSG_IOCTL_MAGIC, 0x01, int) +/* + * A ioctl interface for kmsg* devices. + * + * KMSG_CMD_GET_BUF_SIZE: Retrieve cyclic log buffer size associated with + * device. + * KMSG_CMD_GET_READ_SIZE_MAX: Retrieve max size of data read by kmsg read + * operation. + * KMSG_CMD_CLEAR: Clears cyclic log buffer. After that operation + * there is no data to read from buffer unless + * logs are written. + */ +#define KMSG_CMD_GET_BUF_SIZE _IOR(KMSG_IOCTL_MAGIC, 0x80, __u32) +#define KMSG_CMD_GET_READ_SIZE_MAX _IOR(KMSG_IOCTL_MAGIC, 0x81, __u32) +#define KMSG_CMD_CLEAR _IO(KMSG_IOCTL_MAGIC, 0x82) + #endif |