ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/tools.c
Revision 1.31 - (view) (annotate) - [select for diffs]
Mon Feb 16 14:55:32 2004 UTC (20 years, 3 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_9
Changes since 1.30: +4 -4 lines
Diff to previous 1.30
Add support for DragonFly BSD 1.0.
Also a minor tweak to the network interface code to make it more portable.

Revision 1.30 - (view) (annotate) - [select for diffs]
Sat Feb 14 13:43:37 2004 UTC (20 years, 3 months ago) by ats
Branch: MAIN
Changes since 1.29: +1 -7 lines
Diff to previous 1.29
There's no need to get_uvmexp on startup on NetBSD any more.

Revision 1.29 - (view) (annotate) - [select for diffs]
Sat Feb 14 12:38:18 2004 UTC (20 years, 3 months ago) by tdb
Branch: MAIN
Changes since 1.28: +5 -3 lines
Diff to previous 1.28
kvm is now only needed for FreeBSD, so change defines accordingly.

Revision 1.28 - (view) (annotate) - [select for diffs]
Fri Feb 13 15:22:49 2004 UTC (20 years, 3 months ago) by ats
Branch: MAIN
Changes since 1.27: +18 -19 lines
Diff to previous 1.27
Use sysctl to read struct uvmexp, since this works on both NetBSD and OpenBSD.

Revision 1.27 - (view) (annotate) - [select for diffs]
Tue Feb 10 16:23:07 2004 UTC (20 years, 3 months ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_8_2
Changes since 1.26: +3 -1 lines
Diff to previous 1.26
Added extra ifdef due to compile error

Revision 1.26 - (view) (annotate) - [select for diffs]
Tue Feb 10 16:16:22 2004 UTC (20 years, 3 months ago) by pajs
Branch: MAIN
Changes since 1.25: +9 -4 lines
Diff to previous 1.25
Ooops, wrong logic and didn't think hard enough about it.

Revision 1.25 - (view) (annotate) - [select for diffs]
Tue Feb 10 16:07:43 2004 UTC (20 years, 3 months ago) by pajs
Branch: MAIN
Changes since 1.24: +4 -2 lines
Diff to previous 1.24
Solaris 6 doesn't have libdevinfo. So, as a way to get it to compile, we will
not do the drive mappings sol 6 and lower.

Revision 1.24 - (view) (annotate) - [select for diffs]
Mon Jan 19 16:49:21 2004 UTC (20 years, 3 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_8_1
Changes since 1.23: +2 -0 lines
Diff to previous 1.23
A whole bunch of minor cosmetic changes.

Revision 1.23 - (view) (annotate) - [select for diffs]
Fri Jan 16 15:54:54 2004 UTC (20 years, 4 months ago) by tdb
Branch: MAIN
Changes since 1.22: +13 -12 lines
Diff to previous 1.22
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.

Revision 1.22 - (view) (annotate) - [select for diffs]
Thu Jan 15 22:21:37 2004 UTC (20 years, 4 months ago) by pajs
Branch: MAIN
Changes since 1.21: +28 -3 lines
Diff to previous 1.21
Not the exactly "nice" code. Infact, not entirely happy with it...
But, it makes a *massive* speed increase to the statgrab_init() function on
solaris. It goes from take 15-20 seconds on pelican to < 1.

Revision 1.21 - (view) (annotate) - [select for diffs]
Sat Jan 10 15:28:03 2004 UTC (20 years, 4 months ago) by ats
Branch: MAIN
Changes since 1.20: +1 -1 lines
Diff to previous 1.20
Fix broken comment.

Revision 1.20 - (view) (annotate) - [select for diffs]
Fri Jan 9 16:37:08 2004 UTC (20 years, 4 months ago) by pajs
Branch: MAIN
Changes since 1.19: +5 -1 lines
Diff to previous 1.19
Solaris 7 "fix" :)

Revision 1.19 - (view) (annotate) - [select for diffs]
Fri Jan 9 16:19:58 2004 UTC (20 years, 4 months ago) by pajs
Branch: MAIN
Changes since 1.18: +103 -0 lines
Diff to previous 1.18
Added strlcat/strlcpy (taken from openssh). Added a #define for both, and
also atoll which we appear to of forgotten about when it was written.

Removed that #ifdef around get_ll_match as atoll will now always be defined.

Revision 1.18 - (view) (annotate) - [select for diffs]
Mon Jan 5 17:20:29 2004 UTC (20 years, 4 months ago) by ats
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_8
Changes since 1.17: +8 -0 lines
Diff to previous 1.17
Replace duplicated code for dropping privileges with a library
function that always drops setuid/setgid privileges.

Revision 1.17 - (view) (annotate) - [select for diffs]
Mon Jan 5 14:21:07 2004 UTC (20 years, 4 months ago) by pajs
Branch: MAIN
Changes since 1.16: +12 -11 lines
Diff to previous 1.16
Minor tiding

Revision 1.16 - (view) (annotate) - [select for diffs]
Thu Nov 20 12:13:12 2003 UTC (20 years, 5 months ago) by tdb
Branch: MAIN
Changes since 1.15: +2 -6 lines
Diff to previous 1.15
Turn on the solaris disk mapping code. Fix some minor bugs, and remove
some debugging code.

Revision 1.15 - (view) (annotate) - [select for diffs]
Wed Nov 19 21:56:21 2003 UTC (20 years, 5 months ago) by tdb
Branch: MAIN
Changes since 1.14: +24 -25 lines
Diff to previous 1.14
Die nasty incorrect whitespace. Ahem. Excuse me.

Revision 1.14 - (view) (annotate) - [select for diffs]
Thu Nov 13 17:02:46 2003 UTC (20 years, 6 months ago) by pajs
Branch: MAIN
Changes since 1.13: +194 -0 lines
Diff to previous 1.13
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.)

Revision 1.13 - (view) (annotate) - [select for diffs]
Mon Nov 10 22:46:32 2003 UTC (20 years, 6 months ago) by ats
Branch: MAIN
Changes since 1.12: +20 -9 lines
Diff to previous 1.12
Provide atoll() on platforms that don't have it.

Revision 1.12 - (view) (annotate) - [select for diffs]
Mon Nov 10 21:07:04 2003 UTC (20 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.11: +9 -2 lines
Diff to previous 1.11
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!

Revision 1.11 - (view) (annotate) - [select for diffs]
Mon Oct 20 16:20:06 2003 UTC (20 years, 6 months ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_7
Changes since 1.10: +9 -13 lines
Diff to previous 1.10
Changed the style slightly to be more readable.

Revision 1.10 - (view) (annotate) - [select for diffs]
Mon Oct 20 15:25:47 2003 UTC (20 years, 6 months ago) by pajs
Branch: MAIN
Changes since 1.9: +19 -0 lines
Diff to previous 1.9
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.

Revision 1.9 - (view) (annotate) - [select for diffs]
Sun Oct 19 02:03:02 2003 UTC (20 years, 7 months ago) by ats
Branch: MAIN
Changes since 1.8: +35 -2 lines
Diff to previous 1.8
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.

Revision 1.8 - (view) (annotate) - [select for diffs]
Sun Oct 19 00:25:30 2003 UTC (20 years, 7 months ago) by ats
Branch: MAIN
Changes since 1.7: +17 -0 lines
Diff to previous 1.7
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.

Revision 1.7 - (view) (annotate) - [select for diffs]
Sun Oct 19 00:09:22 2003 UTC (20 years, 7 months ago) by ats
Branch: MAIN
Changes since 1.6: +3 -0 lines
Diff to previous 1.6
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.

Revision 1.6 - (view) (annotate) - [select for diffs]
Sun Aug 24 20:24:09 2003 UTC (20 years, 8 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_5, LIBSTATGRAB_0_5_1, LIBSTATGRAB_0_6, LIBSTATGRAB_0_6_1
Changes since 1.5: +2 -2 lines
Diff to previous 1.5
Tidy up of lots of little things. :)

Revision 1.5 - (view) (annotate) - [select for diffs]
Wed Apr 9 21:01:53 2003 UTC (21 years, 1 month ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_4
Changes since 1.4: +24 -0 lines
Diff to previous 1.4
Add the standard header. Particularly the bit about including config.h was
needed to allow the ifdef around the last function to work.

Revision 1.4 - (view) (annotate) - [select for diffs]
Sun Apr 6 11:57:54 2003 UTC (21 years, 1 month ago) by pajs
Branch: MAIN
Changes since 1.3: +2 -1 lines
Diff to previous 1.3
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.

Revision 1.3 - (view) (annotate) - [select for diffs]
Fri Mar 7 11:56:44 2003 UTC (21 years, 2 months ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_3, LIBSTATGRAB_0_3_1, LIBSTATGRAB_0_3_2, LIBSTATGRAB_0_3_3, LIBSTATGRAB_0_3_4
Changes since 1.2: +23 -0 lines
Diff to previous 1.2
Made network stats work with linux.

Revision 1.2 - (view) (annotate) - [select for diffs]
Wed Mar 5 12:41:19 2003 UTC (21 years, 2 months ago) by pajs
Branch: MAIN
Changes since 1.1: +1 -2 lines
Diff to previous 1.1
Working linux diskio stats. Fixed bug in tools.c

Revision 1.1 - (view) (annotate) - [select for diffs]
Tue Mar 4 18:07:42 2003 UTC (21 years, 2 months ago) by pajs
Branch: MAIN
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.

Convenience Links

Links to HEAD: (view) (annotate) Links to LIBSTATGRAB_0_9: (view) (annotate)

Compare Revisions

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.

  Diffs between and
  Type of Diff should be a