All of lore.kernel.org
 help / color / mirror / Atom feed
* [to-be-updated] proc-pid-fdinfo-add-cloexec-information.patch removed from -mm tree
@ 2011-07-26 21:20 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2011-07-26 21:20 UTC (permalink / raw)
  To: drepper, adobriyan, kosaki.motohiro, mtk.manpages, rientjes, viro,
	wilsons, mm-commits


The patch titled
     /proc/pid/fdinfo: add cloexec information
has been removed from the -mm tree.  Its filename was
     proc-pid-fdinfo-add-cloexec-information.patch

This patch was dropped because an updated version will be merged

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: /proc/pid/fdinfo: add cloexec information
From: Ulrich Drepper <drepper@gmail.com>

There is one piece of information about a file descriptor which is
currently not visible from the outside: the close-on-exec flag.  The
/proc/PID/fdinfo/* files have the mode information but this is missing. 

This is needed so that Linux can re-implement the Solaris pfiles program.

Signed-off-by: Ulrich Drepper <drepper@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Stephen Wilson <wilsons@start.ca>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/proc/base.c |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff -puN fs/proc/base.c~proc-pid-fdinfo-add-cloexec-information fs/proc/base.c
--- a/fs/proc/base.c~proc-pid-fdinfo-add-cloexec-information
+++ a/fs/proc/base.c
@@ -1923,12 +1923,23 @@ static int proc_fd_info(struct inode *in
 				*path = file->f_path;
 				path_get(&file->f_path);
 			}
-			if (info)
+			if (info) {
+				int cloexec;
+				struct fdtable *fdt;
+
+				rcu_read_lock();
+				fdt = files_fdtable(files);
+				cloexec = FD_ISSET(fd, fdt->close_on_exec);
+				rcu_read_unlock();
+
 				snprintf(info, PROC_FDINFO_MAX,
 					 "pos:\t%lli\n"
-					 "flags:\t0%o\n",
+					 "flags:\t0%o\n"
+					 "cloexec: %d\n",
 					 (long long) file->f_pos,
-					 file->f_flags);
+					 file->f_flags,
+					 cloexec);
+			}
 			spin_unlock(&files->file_lock);
 			put_files_struct(files);
 			return 0;
_

Patches currently in -mm which might be from drepper@gmail.com are

h8300-m68k-xtensa-__fd_isset-should-return-0-1.patch
proc-pid-fdinfo-add-cloexec-information-fix.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-26 21:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-26 21:20 [to-be-updated] proc-pid-fdinfo-add-cloexec-information.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.