]> git.baikalelectronics.ru Git - kernel.git/commit
doc:kmsg: explicitly state the return value in case of SEEK_CUR
authorBruno Meneguele <bmeneg@redhat.com>
Fri, 10 Jul 2020 17:44:23 +0000 (14:44 -0300)
committerPetr Mladek <pmladek@suse.com>
Mon, 13 Jul 2020 13:07:45 +0000 (15:07 +0200)
commitee39d85aa80126d5867221cefaef0fe9386ec104
treee89b8331b7a6f73655173380e49113952eeec584
parentf23478fae35011e6faafd102dc76a105a2acb785
doc:kmsg: explicitly state the return value in case of SEEK_CUR

The commit 6f627246aa66 ("Revert "kernel/printk: add kmsg SEEK_CUR
handling"") reverted a change done to the return value in case a SEEK_CUR
operation was performed for kmsg buffer based on the fact that different
userspace apps were handling the new return value (-ESPIPE) in different
ways, breaking them.

At the same time -ESPIPE was the wrong decision because kmsg /does support/
seek() but doesn't follow the "normal" behavior userspace is used to.
Because of that and also considering the time -EINVAL has been used, it was
decided to keep this way to avoid more userspace breakage.

This patch adds an official statement to the kmsg documentation pointing to
the current return value for SEEK_CUR, -EINVAL, thus userspace libraries
and apps can refer to it for a definitive guide on what to expect.

Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20200710174423.10480-1-bmeneg@redhat.com
Documentation/ABI/testing/dev-kmsg
kernel/printk/printk.c