* devices.h (FH_PROCESSFD): New device type.

* dtable.cc (build_fh_pc): Add case for FH_PROCESSFD.
	* fhandler.h (class fhandler_virtual): Drop bufalloc member.
	* fhandler_virtual.h: New header.
	* fhandler_proc.cc: Remove types proc_type_t and proc_tab_t in favor
	of types virt_type_t and virt_tab_t from fhandler_virtual.h.
	Change prototypes of format_XXX functions accordingly.
	(proc_tab): Drop size member info.
	(fhandler_proc::fill_filebuf): Don't allocate filebuf here.  Allocate
	it in the format_XXX functions.
	* fhandler_process.cc: Reorganize global process content data into a
	new struct virt_tab_t.  Accommodate throughout.
	(format_process_winexename): New function.
	(format_process_winpid): New function.
	(format_process_exename): New function.
	(format_process_root): New function.
	(format_process_cwd): New function.
	(format_process_cmdline): New function.
	(format_process_ppid): New function.
	(format_process_uid): New function.
	(format_process_pgid): New function.
	(format_process_sid): New function.
	(format_process_gid): New function.
	(format_process_ctty): New function.
	(format_process_fd): New function.
	* fhandler_procnet.cc (fhandler_procnet::fill_filebuf): Don't use
	bufalloc.
	* fhandler_registry.cc (fhandler_registry::fill_filebuf): Define
	bufalloc locally.
	* fhandler_virtual.cc (fhandler_virtual::fhandler_virtual): Drop
	initialization of bufalloc.
	(fhandler_virtual::dup): Drop copying bufalloc.
This commit is contained in:
Corinna Vinschen
2009-01-20 17:22:11 +00:00
parent f8190b5705
commit 38f50ae4d5
10 changed files with 444 additions and 323 deletions

View File

@@ -20,8 +20,7 @@ details. */
#include <dirent.h>
fhandler_virtual::fhandler_virtual ():
fhandler_base (), filebuf (NULL), bufalloc ((size_t) -1),
fileid (-1)
fhandler_base (), filebuf (NULL), fileid (-1)
{
}
@@ -159,7 +158,7 @@ fhandler_virtual::dup (fhandler_base * child)
{
fhandler_virtual *fhproc_child = (fhandler_virtual *) child;
fhproc_child->filebuf = (char *) cmalloc_abort (HEAP_BUF, filesize);
fhproc_child->bufalloc = fhproc_child->filesize = filesize;
fhproc_child->filesize = filesize;
fhproc_child->position = position;
memcpy (fhproc_child->filebuf, filebuf, filesize);
fhproc_child->set_flags (get_flags ());
@@ -177,7 +176,6 @@ fhandler_virtual::close ()
cfree (filebuf);
filebuf = NULL;
}
bufalloc = (size_t) -1;
}
return 0;
}