diff options
-rw-r--r-- | fs/pidfs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/pidfs.c b/fs/pidfs.c index 71af820eafa5..8d62d900d20d 100644 --- a/fs/pidfs.c +++ b/fs/pidfs.c @@ -271,6 +271,14 @@ static long pidfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) struct ns_common *ns_common = NULL; struct pid_namespace *pid_ns; + if (cmd == FS_IOC_GETVERSION) { + if (!arg) + return -EINVAL; + + __u32 __user *argp = (__u32 __user *)arg; + return put_user(file_inode(file)->i_generation, argp); + } + task = get_pid_task(pid, PIDTYPE_PID); if (!task) return -ESRCH; |