Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 3eb39f47934f9d5a3027fe00d906a45fe3a15fad
- Author: 3eb39f47934f9d5a3027fe00d906a45fe3a15fadcommit 25afba4499ac93a41721fcb25eed1905f85d06fc (HEAD -> work, origin/work)
- Author: Christian Brauner <christian@brauner.io>
- Date: Wed Mar 20 08:05:54 2019 +0100
- pidfd: introduce "pidfd" proc file
- Signed-off-by: Christian Brauner <christian@brauner.io>
- diff --git a/fs/proc/base.c b/fs/proc/base.c
- index ddef482f1334..081c57988fd6 100644
- --- a/fs/proc/base.c
- +++ b/fs/proc/base.c
- @@ -357,6 +357,9 @@ static const struct file_operations proc_pid_cmdline_ops = {
- .llseek = generic_file_llseek,
- };
- +static const struct file_operations proc_pid_pidfd_ops = {
- /* Grow a .poll and .read_iter method at some point. */
- +};
- +
- #ifdef CONFIG_KALLSYMS
- /*
- * Provides a wchan file via kallsyms in a proper one-value-per-file format.
- @@ -2987,6 +2990,7 @@ static const struct pid_entry tgid_base_stuff[] = {
- ONE("syscall", S_IRUSR, proc_pid_syscall),
- #endif
- REG("cmdline", S_IRUGO, proc_pid_cmdline_ops),
- + REG("pidfd", S_IRUGO, proc_pid_pidfd_ops),
- ONE("stat", S_IRUGO, proc_tgid_stat),
- ONE("statm", S_IRUGO, proc_pid_statm),
- REG("maps", S_IRUGO, proc_pid_maps_operations),
- @@ -3076,8 +3080,7 @@ static const struct file_operations proc_tgid_base_operations = {
- struct pid *tgid_pidfd_to_pid(const struct file *file)
- {
- - if (!d_is_dir(file->f_path.dentry) ||
- - (file->f_op != &proc_tgid_base_operations))
- + if (file->f_op != &proc_pid_pidfd_ops)
- return ERR_PTR(-EBADF);
- return proc_pid(file_inode(file));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement