Use sg_set_error_with_errno whenever errno's valid. Change the one user of SG_ERROR_ENOENT to SG_ERROR_SYSCTL instead (since that's what it should have been).
The rest of the error handling stuff (except the vector code). I've been extremely unimaginative with the string names in error.c, but they're all in one place so much easier to tidy up. I'm also beginning to wonder if we actually needed an SG_ERROR_SYSTEM_CALL to indicate some call into the system failed - because the majority of our errors are those :-) Still to do, then: - vector code - better string names in error.c - deal with arg string in some way - make use of the error status in statgrab/saidar/examples
Whitespace tidyup - change spaces to tabs.
Update name of project at the top of all soure files. These files now exist in their own right, rather than as part of the "CMS".
Rename all the functions, types and enums in the API to be consistent. Types are now of the form "sg_mem_stats"; functions of the form "sg_get_mem_stats"; enums of the form "SG_PROCESS_STATE_RUNNING". (The old get_proc_snapshot follows the usual calling convention now.) Make internal functions static where possible. Rename non-static internal functions to have an sg_ prefix so they don't collide with those from other libraries. In particular, strlcpy and strlcat are now called sg_strlcpy and sg_strlcat and are always included. Fix saidar and statgrab to use the new API.
Add support for DragonFly BSD 1.0. Also a minor tweak to the network interface code to make it more portable.
Finish support for OpenBSD. Get disknames out of sysctl as well for Disk IO. Fix memory/page/swap stats to use get_uvmexp in tools.c (same as NetBSD).
Add preliminary support for OpenBSD (tested on 3.3). All works apart from Disk IO stats - currently the disks are not named correctly. The fix for this is probably to use KVM. Mostly similar to the NetBSD code, the notable exception being the uvm stuff. In NetBSD there's a function to get it, in OpenBSD sysctl is needed to get hold of it.
A whole bunch of minor cosmetic changes.
Alter the licensing of libstatgrab. The library part is now under the LGPL, whilst the tools/examples are under the GPL. Both licenses are included in the distribution (and are both now in CVS). Also made a minor alteration to the webpage where it said everything was licensed under the GPL.
Fixed leaking fd in diskio_stats code. Fixed a potential leak in page_stats.
Make Cygwin its own platform, rather than defining LINUX. This stops libstatgrab from trying to fetch stats that Cygwin doesn't have.
Support memory, swap and paging stats on Linux 2.6. For memory and swap, this just means reading the new-style data in /proc/meminfo (since it's present in 2.2 and 2.4 too); for paging, this means trying to read /proc/vmstat if it's available, else reading /proc/stat (for 2.2).
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.
... and the size parameter should be initialised to the size of the buffer first (although FreeBSD doesn't actually seem to care, NetBSD does, and the manual page says so).
You only need to call sysctl{,byname}() twice if you're actually going to do something with the size the first call returns. The last argument to sysctl{,byname}() is a size_t, not a pointer, so it should be 0, not NULL.
Tidy up of lots of little things. :)
Now works on freebsd.
Removed getting of some data we didn't really need or use. Updated page_stats to work with linux. Fixed tools.h to compile nicely :)
Added get_page_stats_diff() which returns the number of pages in/out etc since last time it was called, and the time difference since last time it was called. This makes it very easy for a host to know how many pages averaged over a period of time.
Finished page stats. It returns 2 things. One, number of pages swapped in and out, 2, the number of pageins and pageouts. As to if this is actually correct or not, im not 100% sure, but tests seem to imply it is. from: http://www.sun.com/sun-on-net/itworld/UIR960901perf.html ulong pgin; /* pageins */ ulong pgpgin; /* pages paged in */ ulong pgout; /* pageouts */ ulong pgpgout; /* pages paged out */ ulong swapin; /* swapins */ ulong pgswapin; /* pages swapped in */ ulong swapout; /* swapouts I am *not* using swapins and swapouts. I did this in the orginal libstatgrab, and it didn't work. Looking at it more closely, it always seems to have 0 in it, so my guess is its broke. :)
The new revesion of libstatgrab, which is a complete rewrite essentially. Firstly the data is now returned in structures rather than xml strings. The structures returned are all static, so what ever calls the library doesn't have to deal with the memory management of it. Secondly the general efficency of the code is now significantly faster. It no longer needs to fork a process, connect file descriptors and run ps, and then parse the output like it used to. Now it walks /proc and reads it into the correct data structures. This works without needing any special privilages, so it can still run as a normal mortal without needing any special group. (Freebsd will be an exception to this, but this commit only works with solaris, and that requires nothing special) Thridly it has more functionality than it used to. It not for instance is capable of showing network traffic stats, (although its not completely finished yet). It also in the near future be able to disk io stats as well. Several bug fixes have been aplied over the original version. For example the cpu_stats used to only reply the stats for the first processor. This now will report the total stats of all of them. Paging stats will also be fixed, but haven't been done yet.
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.