powerpc/85xx: Fix declaration made after definition
[linux-2.6-microblaze.git] / kernel / pid.c
index 74ddbff..a96bc4b 100644 (file)
@@ -520,6 +520,25 @@ struct pid *find_ge_pid(int nr, struct pid_namespace *ns)
        return idr_get_next(&ns->idr, &nr);
 }
 
+struct pid *pidfd_get_pid(unsigned int fd, unsigned int *flags)
+{
+       struct fd f;
+       struct pid *pid;
+
+       f = fdget(fd);
+       if (!f.file)
+               return ERR_PTR(-EBADF);
+
+       pid = pidfd_pid(f.file);
+       if (!IS_ERR(pid)) {
+               get_pid(pid);
+               *flags = f.file->f_flags;
+       }
+
+       fdput(f);
+       return pid;
+}
+
 /**
  * pidfd_create() - Create a new pid file descriptor.
  *