summaryrefslogtreecommitdiff
path: root/kernel/exit.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-07-11 10:40:31 -0600
committerJens Axboe <axboe@kernel.dk>2023-09-21 12:03:50 -0600
commit2e521a2064bf8b26cf178c0f7644a70ed1a512fa (patch)
treec380528b697568b6cba061dd7d13292beca54ec3 /kernel/exit.h
parenteda7e9d409ce16960d5ed28bedf8a33b2667a93c (diff)
exit: add internal include file with helpers
Move struct wait_opts and waitid_info into kernel/exit.h, and include function declarations for the recently added helpers. Make them non-static as well. This is in preparation for adding a waitid operation through io_uring. With the abtracted helpers, this is now possible. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'kernel/exit.h')
-rw-r--r--kernel/exit.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/exit.h b/kernel/exit.h
new file mode 100644
index 000000000000..278faa26a653
--- /dev/null
+++ b/kernel/exit.h
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#ifndef LINUX_WAITID_H
+#define LINUX_WAITID_H
+
+struct waitid_info {
+ pid_t pid;
+ uid_t uid;
+ int status;
+ int cause;
+};
+
+struct wait_opts {
+ enum pid_type wo_type;
+ int wo_flags;
+ struct pid *wo_pid;
+
+ struct waitid_info *wo_info;
+ int wo_stat;
+ struct rusage *wo_rusage;
+
+ wait_queue_entry_t child_wait;
+ int notask_error;
+};
+
+bool pid_child_should_wake(struct wait_opts *wo, struct task_struct *p);
+long __do_wait(struct wait_opts *wo);
+int kernel_waitid_prepare(struct wait_opts *wo, int which, pid_t upid,
+ struct waitid_info *infop, int options,
+ struct rusage *ru);
+#endif