Please sign in to comment.
ipc: introduce message queue copy feature
This patch is required for checkpoint/restore in userspace. c/r requires some way to get all pending IPC messages without deleting them from the queue (checkpoint can fail and in this case tasks will be resumed, so queue have to be valid). To achive this, new operation flag MSG_COPY for sys_msgrcv() system call was introduced. If this flag was specified, then mtype is interpreted as number of the message to copy. If MSG_COPY is set, then kernel will allocate dummy message with passed size, and then use new copy_msg() helper function to copy desired message (instead of unlinking it from the queue). Notes: 1) Return -ENOSYS if MSG_COPY is specified, but CONFIG_CHECKPOINT_RESTORE is not set. Signed-off-by: Stanislav Kinsbursky <email@example.com> Cc: Serge Hallyn <firstname.lastname@example.org> Cc: "Eric W. Biederman" <email@example.com> Cc: Pavel Emelyanov <firstname.lastname@example.org> Cc: Al Viro <email@example.com> Cc: KOSAKI Motohiro <firstname.lastname@example.org> Cc: Michael Kerrisk <email@example.com> Signed-off-by: Andrew Morton <firstname.lastname@example.org> Signed-off-by: Linus Torvalds <email@example.com>
- Loading branch information...
Showing with 102 additions and 2 deletions.