linux/drivers/staging/android
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
..
switch staging: android: switch: minor code formatting cleanups 2011-12-16 13:41:37 -08:00
android_pmem.h staging: android: add pmem driver 2011-12-16 14:08:17 -08:00
ashmem.c ashmem: Whitespace cleanups 2011-12-21 13:40:25 -08:00
ashmem.h ashmem: Anonymous shared memory subsystem 2011-12-21 13:38:28 -08:00
binder.c Wrap accesses to the fd_sets in struct fdtable 2012-02-19 10:30:52 -08:00
binder.h Staging: android: fixed a space warning in binder.h 2011-12-22 13:33:57 -08:00
Kconfig ashmem: Anonymous shared memory subsystem 2011-12-21 13:38:28 -08:00
logger.c Staging: android: fixed white spaces coding style issue in logger.c 2011-12-16 10:54:14 -08:00
logger.h android: logger: Add new system log for framework/system log messages 2011-11-30 20:40:06 +09:00
lowmemorykiller.c Staging: android: fixed 80 characters warnings in lowmemorykiller.c 2011-12-22 13:33:57 -08:00
Makefile ashmem: Anonymous shared memory subsystem 2011-12-21 13:38:28 -08:00
pmem.c staging: android: add pmem driver 2011-12-16 14:08:17 -08:00
ram_console.c staging: android: ram_console: pass in a boot info string 2011-11-30 21:23:37 +09:00
ram_console.h staging: android: ram_console: pass in a boot info string 2011-11-30 21:23:37 +09:00
timed_gpio.c Staging: android: timed_gpio: Request gpios. 2011-11-30 20:40:05 +09:00
timed_gpio.h Revert "Staging: android: delete android drivers" 2011-11-30 20:18:14 +09:00
timed_output.c Staging: android: timed_gpio: Properly discard invalid timeout values. 2011-11-30 20:51:36 +09:00
timed_output.h Revert "Staging: android: delete android drivers" 2011-11-30 20:18:14 +09:00
TODO Revert "Staging: android: delete android drivers" 2011-11-30 20:18:14 +09:00