Replace duplicated code for dropping privileges with a library function that always drops setuid/setgid privileges.
Minor tiding
Turn on the solaris disk mapping code. Fix some minor bugs, and remove some debugging code.
Die nasty incorrect whitespace. Ahem. Excuse me.
Basic implementation of name mapping for solaris. The code is ugly, mostly because its initially taken from a sun example, and modified. It needs tiding somewhat. I'm not sure if tools.c is the right place for this, i guess it could go in disk_stats.c, but its doing a specific job, and we could right another mini-program which does the disk mappings. Comments welcome about the general implementation. Should we call build_mapping if the user calls get_svr_from_bsd and build_mapping hasn't been run before? Or should we force them to use the init function? (Bare in mind, on some systems, to do the mappings correctly the program will require to be root. (Only ones with a /dev/osa , so everything with an A1000 for e.g.)
Provide atoll() on platforms that don't have it.
Add support for cygwin. This is a bit limited, there's a few things that can't be retrieved on cygwin such as load averages, diskio, network io, and process stats. The package compiles and runs, and both saidar and statgrab work. Taken from a patch submitted by Ron Arts <raarts@netland.nl>. Thanks Ron!
Changed the style slightly to be more readable.
Added statgrab_init() This function just calls the get_kvm type functions so all special privilages can be dropped after this function has been called. It currently only does stuff on *bsd (and needs testing on netbsd). All other OS's will just have a function that returns 0 Solaris at somepoint may need to do something here so we can do the drive mappings.
Initial support for NetBSD. This adds NetBSD support for everything except diskio stats (since they're even more disturbingly complex to get at on NetBSD than the three OSs we already support). Tested against NetBSD 1.6 on i386.
Add a helper function for opening the kvm handle. This removes a little bit of duplicated code, and means that we don't open and close kvm (which can potentially be quite expensive) each time we use it. This will also be useful for NetBSD.
Remove headers from tools.h that the prototypes don't need (since they're included elsewhere where needed). Include tools.h in tools.c, so we get warnings if the prototypes are wrong.
Tidy up of lots of little things. :)
Add the standard header. Particularly the bit about including config.h was needed to allow the ifdef around the last function to work.
Make the functions that use atoll have a #ifdef HAVE_ATOLL around them. I did this because freebsd doesn't have this function, and it doesn't need to run any of the functions in tools.h that uses them.
Made network stats work with linux.
Working linux diskio stats. Fixed bug in tools.c
Useful tools, currently only one function. Function takes a file pointer and will read threw it until it hits a passed string. It will return that line.
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.