ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/saidar/saidar.c
Revision 1.42 - (view) (annotate) - [select for diffs]
Sun Oct 3 18:35:58 2010 UTC (13 years, 7 months ago) by tdb
Branch: MAIN
CVS Tags: HEAD
Changes since 1.41: +6 -2 lines
Diff to previous 1.41
Add support for AIX 5.x - 9.x.

Many thanks to Jens Rehsack <rehsack@googlemail.com> for providing the
patch for this work. Thanks!

Revision 1.41 - (view) (annotate) - [select for diffs]
Fri Jan 5 13:30:36 2007 UTC (17 years, 4 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_14, LIBSTATGRAB_0_15, LIBSTATGRAB_0_16, LIBSTATGRAB_0_17
Changes since 1.40: +10 -4 lines
Diff to previous 1.40
Fix problem with saidar crashing when window is rapidly resized. Done by
moving the code out of the signal handler and in to the main loop, and
just having a global flag set by the signal handler.

Revision 1.40 - (view) (annotate) - [select for diffs]
Sun Dec 17 01:06:16 2006 UTC (17 years, 4 months ago) by tdb
Branch: MAIN
Changes since 1.39: +2 -1 lines
Diff to previous 1.39
Hide cursor when possible.

Revision 1.39 - (view) (annotate) - [select for diffs]
Fri Dec 1 14:21:17 2006 UTC (17 years, 5 months ago) by tdb
Branch: MAIN
Changes since 1.38: +2 -4 lines
Diff to previous 1.38
Sort out curses detection. It'll now detect ncurses before curses, and
cope with the header files being in include or include/ncurses. I think
this will work in every case.

Revision 1.38 - (view) (annotate) - [select for diffs]
Fri Dec 1 01:03:59 2006 UTC (17 years, 5 months ago) by tdb
Branch: MAIN
Changes since 1.37: +16 -1 lines
Diff to previous 1.37
Colour is only supported if ncurses is being used.

Revision 1.37 - (view) (annotate) - [select for diffs]
Fri Dec 1 00:38:39 2006 UTC (17 years, 5 months ago) by tdb
Branch: MAIN
Changes since 1.36: +7 -2 lines
Diff to previous 1.36
Standout doesn't work on all displays, so use bold too.

Revision 1.36 - (view) (annotate) - [select for diffs]
Thu Nov 30 23:42:43 2006 UTC (17 years, 5 months ago) by tdb
Branch: MAIN
Changes since 1.35: +153 -9 lines
Diff to previous 1.35
Add support for coloured fields in saidar. Optionally enabled by using the
new -c flag. Manpage updated with details.

Mostly taken from a patch supplied by Angelina Carlton <debian@magma.ca>,
but I made minor changes to layout and function.

Revision 1.35 - (view) (annotate) - [select for diffs]
Thu Nov 30 23:03:19 2006 UTC (17 years, 5 months ago) by tdb
Branch: MAIN
Changes since 1.34: +22 -22 lines
Diff to previous 1.34
Whitespace cleanup.

Revision 1.34 - (view) (annotate) - [select for diffs]
Wed Sep 7 14:15:40 2005 UTC (18 years, 7 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_13
Changes since 1.33: +13 -4 lines
Diff to previous 1.33
Simple hack to truncate disk/interface/mount names to fit in to the
field. Before this they just overwrote stuff and it got messy.

Hardly an elegant fix, btw ;)

Revision 1.33 - (view) (annotate) - [select for diffs]
Mon Jan 17 16:34:26 2005 UTC (19 years, 3 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_11_1, LIBSTATGRAB_0_12
Changes since 1.32: +10 -2 lines
Diff to previous 1.32
Make size_conv deal with negative numbers too (it does happen :-).

Revision 1.32 - (view) (annotate) - [select for diffs]
Sun Nov 7 12:36:04 2004 UTC (19 years, 5 months ago) by ats
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_11
Changes since 1.31: +2 -2 lines
Diff to previous 1.31
Put back the dummy argument -- I know it's not used, but signal handlers
have to have it.

Revision 1.31 - (view) (annotate) - [select for diffs]
Sat Nov 6 19:02:21 2004 UTC (19 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30
Remove another unused parameter.

Revision 1.30 - (view) (annotate) - [select for diffs]
Mon Oct 11 11:53:44 2004 UTC (19 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29
Fix when used percentage hits 100%.

Revision 1.29 - (view) (annotate) - [select for diffs]
Wed Apr 7 15:50:26 2004 UTC (20 years, 1 month ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_10, LIBSTATGRAB_0_10_1, LIBSTATGRAB_0_10_2, LIBSTATGRAB_0_10_3
Changes since 1.28: +28 -28 lines
Diff to previous 1.28
More whitespace tidyup (spaces->tabs).

Revision 1.28 - (view) (annotate) - [select for diffs]
Tue Apr 6 14:53:00 2004 UTC (20 years, 1 month ago) by tdb
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27
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".

Revision 1.27 - (view) (annotate) - [select for diffs]
Mon Apr 5 15:40:17 2004 UTC (20 years, 1 month ago) by ats
Branch: MAIN
Changes since 1.26: +56 -56 lines
Diff to previous 1.26
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.

Revision 1.26 - (view) (annotate) - [select for diffs]
Sun Apr 4 22:48:51 2004 UTC (20 years, 1 month ago) by tdb
Branch: MAIN
Changes since 1.25: +1 -2 lines
Diff to previous 1.25
Fix a bunch of warnings on the BSD's.

Revision 1.25 - (view) (annotate) - [select for diffs]
Wed Jan 21 10:27:46 2004 UTC (20 years, 3 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_8_1, LIBSTATGRAB_0_8_2, LIBSTATGRAB_0_9
Changes since 1.24: +2 -2 lines
Diff to previous 1.24
Very minor fix to saidar. It happily accepted a negative number for
it's delay flag - which wasn't overly useful :-)

Revision 1.24 - (view) (annotate) - [select for diffs]
Mon Jan 19 16:49:23 2004 UTC (20 years, 3 months ago) by tdb
Branch: MAIN
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:56 2004 UTC (20 years, 3 months ago) by tdb
Branch: MAIN
Changes since 1.22: +1 -1 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]
Mon Jan 5 17:20:30 2004 UTC (20 years, 4 months ago) by ats
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_8
Changes since 1.21: +2 -10 lines
Diff to previous 1.21
Replace duplicated code for dropping privileges with a library
function that always drops setuid/setgid privileges.

Revision 1.21 - (view) (annotate) - [select for diffs]
Mon Jan 5 16:47:43 2004 UTC (20 years, 4 months ago) by ats
Branch: MAIN
Changes since 1.20: +1 -3 lines
Diff to previous 1.20
Remove unused variable "gid".

Revision 1.20 - (view) (annotate) - [select for diffs]
Mon Jan 5 14:25:03 2004 UTC (20 years, 4 months ago) by pajs
Branch: MAIN
Changes since 1.19: +6 -0 lines
Diff to previous 1.19
Drop setuid for solaris.

Revision 1.19 - (view) (annotate) - [select for diffs]
Thu Dec 11 14:27:08 2003 UTC (20 years, 4 months ago) by tdb
Branch: MAIN
Changes since 1.18: +0 -2 lines
Diff to previous 1.18
Fix problem with -d flag in saidar. The line removed subtracted 1 from
the delay. I guess at some point this was needed, but not now. So
setting a delay of 1 resulted in a sleep 0 :-)

Revision 1.18 - (view) (annotate) - [select for diffs]
Fri Nov 7 18:39:39 2003 UTC (20 years, 6 months ago) by ats
Branch: MAIN
Changes since 1.17: +1 -2 lines
Diff to previous 1.17
Remove a little bit of duplicated code.

Revision 1.17 - (view) (annotate) - [select for diffs]
Fri Nov 7 18:38:48 2003 UTC (20 years, 6 months ago) by ats
Branch: MAIN
Changes since 1.16: +12 -6 lines
Diff to previous 1.16
Do the "don't update more than once a second" thing slightly
differently; this avoids having it be unresponsive for 20 seconds if
you type 20 spaces.

Revision 1.16 - (view) (annotate) - [select for diffs]
Fri Nov 7 18:28:05 2003 UTC (20 years, 6 months ago) by ats
Branch: MAIN
Changes since 1.15: +1 -1 lines
Diff to previous 1.15
getopt returns -1 on completion, not EOF.

Revision 1.15 - (view) (annotate) - [select for diffs]
Fri Nov 7 18:27:35 2003 UTC (20 years, 6 months ago) by ats
Branch: MAIN
Changes since 1.14: +1 -2 lines
Diff to previous 1.14
Fix type of ch.

Revision 1.14 - (view) (annotate) - [select for diffs]
Fri Nov 7 18:25:55 2003 UTC (20 years, 6 months ago) by ats
Branch: MAIN
Changes since 1.13: +5 -24 lines
Diff to previous 1.13
Use curses' timeout() rather than select().

Revision 1.13 - (view) (annotate) - [select for diffs]
Wed Oct 22 13:07:22 2003 UTC (20 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.12: +4 -3 lines
Diff to previous 1.12
Do the divides a bit more safely :-)

Revision 1.12 - (view) (annotate) - [select for diffs]
Tue Oct 21 18:01:15 2003 UTC (20 years, 6 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_7
Changes since 1.11: +6 -2 lines
Diff to previous 1.11
Make saidar display the VM percentages for swap *or* memory if it can,
rather than not displaying either if it can't get one or the other.

Revision 1.11 - (view) (annotate) - [select for diffs]
Mon Oct 20 22:35:14 2003 UTC (20 years, 6 months ago) by ats
Branch: MAIN
Changes since 1.10: +181 -151 lines
Diff to previous 1.10
Only display the stats that are available (rather than bombing out if they
aren't all available).

Revision 1.10 - (view) (annotate) - [select for diffs]
Mon Oct 20 15:25:48 2003 UTC (20 years, 6 months ago) by pajs
Branch: MAIN
Changes since 1.9: +14 -1 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]
Sat Oct 18 15:05:17 2003 UTC (20 years, 6 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_6_1
Changes since 1.8: +1 -1 lines
Diff to previous 1.8
Now behaves a little bit more like df with regard to percentages. This
needs a better fix somewhere in libstatgrab really; we don't currently know
anything about the reserved space.

Revision 1.8 - (view) (annotate) - [select for diffs]
Sat Oct 18 14:08:36 2003 UTC (20 years, 6 months ago) by pajs
Branch: MAIN
Changes since 1.7: +3 -1 lines
Diff to previous 1.7
Brain failure over a confusion with strncpy (thinking it worked like strlcpy)

Revision 1.7 - (view) (annotate) - [select for diffs]
Sat Oct 18 14:00:21 2003 UTC (20 years, 6 months ago) by pajs
Branch: MAIN
Changes since 1.6: +12 -1 lines
Diff to previous 1.6
Fix an annoying long hostname problem.

Revision 1.6 - (view) (annotate) - [select for diffs]
Thu Oct 16 17:54:44 2003 UTC (20 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5
Disk percentage may be arguably more "right" than it is before. It's
debatable, of course :)

Revision 1.5 - (view) (annotate) - [select for diffs]
Thu Oct 9 16:35:24 2003 UTC (20 years, 6 months ago) by pajs
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_6
Changes since 1.4: +1 -1 lines
Diff to previous 1.4
Another stupid mistake. Now actually prints the program name :)

Revision 1.4 - (view) (annotate) - [select for diffs]
Thu Oct 9 16:24:19 2003 UTC (20 years, 6 months ago) by pajs
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3
Tab problem in a fprintf and actually turn on the new command line options ;)

Revision 1.3 - (view) (annotate) - [select for diffs]
Thu Oct 9 16:08:16 2003 UTC (20 years, 6 months ago) by pajs
Branch: MAIN
Changes since 1.2: +25 -0 lines
Diff to previous 1.2
Added some usage flags, and a -v for version and -h for help.

Revision 1.2 - (view) (annotate) - [select for diffs]
Thu Oct 9 16:00:31 2003 UTC (20 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.1: +29 -0 lines
Diff to previous 1.1
Standard header, plus make it include the right curses.h dependent on
what the configure system finds.

Revision 1.1 - (view) (annotate) - [select for diffs]
Thu Oct 9 15:57:05 2003 UTC (20 years, 6 months ago) by pajs
Branch: MAIN
First release of saidar. This version works on all platforms, using ncurses
fine. Bugs exist when linked against the solaris curses. (E.g. if while
running saidar you hammer a key repeatedly, the screen no longer updates.
This only happens with the solaris curses however)

Saidar takes a single optional flag, "-d" and an argument of the delay in
seconds. e.g.

saidar -d 1

Will update the screen once a second (the fastest allowed update time). The
default update it every 3 seconds. However, if you press any other key, it
will update immidiately (unless its less than 1 second, in which case it will
update at the earlist available time)

Convenience Links

Links to HEAD: (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