linux/fs/proc
David Howells 1dce27c5aa Wrap accesses to the fd_sets in struct fdtable
Wrap accesses to the fd_sets in struct fdtable (for recording open files and
close-on-exec flags) so that we can move away from using fd_sets since we
abuse the fd_set structs by not allocating the full-sized structure under
normal circumstances and by non-core code looking at the internals of the
fd_sets.

The first abuse means that use of FD_ZERO() on these fd_sets is not permitted,
since that cannot be told about their abnormal lengths.

This introduces six wrapper functions for setting, clearing and testing
close-on-exec flags and fd-is-open flags:

	void __set_close_on_exec(int fd, struct fdtable *fdt);
	void __clear_close_on_exec(int fd, struct fdtable *fdt);
	bool close_on_exec(int fd, const struct fdtable *fdt);
	void __set_open_fd(int fd, struct fdtable *fdt);
	void __clear_open_fd(int fd, struct fdtable *fdt);
	bool fd_is_open(int fd, const struct fdtable *fdt);

Note that I've prepended '__' to the names of the set/clear functions because
they require the caller to hold a lock to use them.

Note also that I haven't added wrappers for looking behind the scenes at the
the array.  Possibly that should exist too.

Signed-off-by: David Howells <dhowells@redhat.com>
Link: http://lkml.kernel.org/r/20120216174942.23314.1364.stgit@warthog.procyon.org.uk
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
2012-02-19 10:30:52 -08:00
..
Kconfig
Makefile ns: proc files for namespace naming policy. 2011-05-10 14:31:44 -07:00
array.c Merge branch 'for-linus' of git://selinuxproject.org/~jmorris/linux-security 2012-01-14 18:36:33 -08:00
base.c Wrap accesses to the fd_sets in struct fdtable 2012-02-19 10:30:52 -08:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
generic.c switch procfs to umode_t use 2012-01-03 22:54:56 -05:00
inode.c procfs: add hidepid= and gid= mount options 2012-01-10 16:30:54 -08:00
internal.h procfs: parse mount options 2012-01-10 16:30:54 -08:00
interrupts.c
kcore.c
kmsg.c
loadavg.c
meminfo.c fs/proc/meminfo.c: fix compilation error 2011-12-09 07:50:28 -08:00
mmu.c
namespaces.c vfs: trim includes a bit 2012-01-03 22:57:13 -05:00
nommu.c
page.c
proc_devtree.c
proc_net.c switch procfs to umode_t use 2012-01-03 22:54:56 -05:00
proc_sysctl.c Merge branch 'akpm' (Andrew's incoming - part two) 2011-11-02 16:07:27 -07:00
proc_tty.c
root.c procfs: add hidepid= and gid= mount options 2012-01-10 16:30:54 -08:00
softirqs.c
stat.c sched/accounting, proc: Fix /proc/stat interrupts sum 2012-01-16 08:13:27 +01:00
task_mmu.c proc: clear_refs: do not clear reserved pages 2012-01-23 08:38:48 -08:00
task_nommu.c
uptime.c Merge branch 'sched/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into cputime-tip 2011-12-19 19:23:15 +01:00
version.c
vmcore.c fs: add export.h to files using EXPORT_SYMBOL/THIS_MODULE macros 2011-10-31 19:30:31 -04:00