diff options
| author | Yang Xu <xuyang2018.jy@cn.fujitsu.com> | 2020-09-09 11:57:42 +0800 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2020-09-09 14:19:44 +0200 |
| commit | ab365f43e723c3742c0789c31d0ca4aeb3301aa4 (patch) | |
| tree | f9cbaaa4ce04970b30f1b0594c10de49452c4013 /man2 | |
| parent | c3e8ceb88371e4fa2b017e1b8ca6a2dca47dec2c (diff) | |
| download | man-pages-ab365f43e723c3742c0789c31d0ca4aeb3301aa4.tar.gz | |
msgop.2: Add restriction on ENOSYS error
When calling msgrcv() with the MSG_COPY flag, it will report
EINVAL error even we if have disabled CONFIG_CHECKPOINT_RESTORE.
ENOSYS will be reported only if we also specify the IPC_NOWAIT
flag.
[mtk: edited commit message]
Notes from mtk:
The relevant kernel code is this:
[[
#ifdef CONFIG_CHECKPOINT_RESTORE
...
#else
static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz)
{
return ERR_PTR(-ENOSYS);
}
...
static long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long
msgtyp, int msgflg,
long (*msg_handler)(void __user *, struct msg_msg *, size_t))
{
...
if (msgflg & MSG_COPY) {
if ((msgflg & MSG_EXCEPT) || !(msgflg & IPC_NOWAIT))
return -EINVAL;
copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax));
...
}
]]
We'll only hit the ENOSYS error if:
(1) MSG_COPY was specified;
(2) IPC_NOWAIT was not specified; and
(3) CONFIG_CHECKPOINT_RESTORE was not enabled.
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man2')
| -rw-r--r-- | man2/msgop.2 | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/man2/msgop.2 b/man2/msgop.2 index 373e53aa75..e559097a7f 100644 --- a/man2/msgop.2 +++ b/man2/msgop.2 @@ -467,7 +467,9 @@ and the queue contains less than messages. .TP .BR ENOSYS " (since Linux 3.8)" -.I MSG_COPY +.B IPC_NOWAIT +and +.B MSG_COPY was specified in .IR msgflg , and this kernel was configured without |
