Commit Graph

30 Commits

Author SHA1 Message Date
Craig Small
a410e236ab library: sysstat and vmstat api changes
Use the standard libc declarations.
For protecting the headers for C++ procps used to have its
own defines, this change makes them use the standard libc ones.

getstat() -> procps_stat_*
vminfo() -> procps_vmstat_*
These two components of the library now use the newer version of
the API with less exposed global variables. The old methods are
there for now.

Signed-off-by: Craig Small <csmall@enc.com.au>
2015-06-26 22:37:28 +10:00
Craig Small
56d9d5e7e7 library: Change linux version
Added function procps_linux_version() which used to be an
exported integer instead.  Also changed the method of obtaining
the linux version (more correctly the os release) to use a specific
procfs entry. This works for both Linux and FreeBSD.
2015-06-19 21:00:46 +10:00
Dimitrios Apostolou
faec340719 Two new options for pmap, -X and -XX
Both options provide more information about a process using -X and -XX
flags. The data comes from /proc/PID/smaps so it may vary.

Signed-off-by: Craig Small <csmall@enc.com.au>
2012-09-27 22:08:04 +10:00
Craig Small
a909f6e917 Change restrict to __restrict in public includes
procps automake defines restrict which means the binaries for procps
binaries compile. However external programs may not of defined
restrict which means they will not complie if they include files found
in /usr/include/proc.

Includes from libc6 use __restrict and if is good enough for
them, its good enough for us.
2012-01-09 21:44:51 +11:00
Craig Small
fb11e1fe0a Changed the err and warns to macros
err and warn are BSD format but they are not recommended by library
developers.  However their consiseness is useful!

The solution is to use some macros that create xerr etc which then
just map to the error() function.  The next problem is error() uses
program_invocation_name so we set this to program_invovation_short_name

This is a global set but seems to be the convention (or at least errors
are on the short name only) used everywhere else.
2012-01-03 18:48:43 +11:00
Sami Kerola
9057b18a32 libproc-ng & ps: fix warning reported by smatch
proc/ksym.c +279 read_file(54) info: redundant null check on buf calling free()
proc/ksym.c +330 parse_ksyms(41) info: redundant null check on ksyms_data calling free()
proc/ksym.c +332 parse_ksyms(43) info: redundant null check on ksyms_index calling free()
proc/ksym.c +451 sysmap_mmap(110) info: redundant null check on sysmap_index calling free()
proc/procps.h:74:5: warning: undefined preprocessor identifier 'SHARED'
proc/slab.c +145 parse_slabinfo20(24) error: potential null derefence 'prev'.
proc/slab.c +222 parse_slabinfo11(21) error: potential null derefence 'prev'.
ps/stacktrace.c +131 debug(6) error: snprintf() is printing too much 99 vs 16

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:50 +01:00
Jim Warner
7126cc4491 library: expanded/generalized memory allocation provisions
A callback provision in the form of xalloc_err_handler
(of type message_fn) was added to the alloc module.

This change allowed a program like top, who alters the
termios structure, to override the default fprint(stderr...)
behavior in the event of an error.

The new function xstrdup was also added for symmetry.
2011-12-11 22:26:49 +11:00
Sami Kerola
71d10d3a49 name change: procps -> procps-ng
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-04 20:50:12 +02:00
albert
cd80f609e6 more MIPS crud 2005-02-28 03:29:57 +00:00
albert
af2077f22d new /proc/vmstat fields 2004-08-27 14:23:36 +00:00
albert
1754df6025 MIPS n32 on 64-bit kernel; be nice to 32-bit SPARC 2004-08-19 01:06:28 +00:00
albert
3f603adbae remove some table inconsistencies and rename it_real_value 2004-04-17 03:13:56 +00:00
albert
efd8648fc7 add slabtop, fix top ^Z terminal handling 2004-01-24 22:33:56 +00:00
albert
4a54e25aca 2.5.61 2003-02-17 00:57:15 +00:00
albert
27ed270851 memory leak fixed 2003-02-11 08:19:12 +00:00
albert
e092b7a18d better --info 2003-01-22 08:31:50 +00:00
albert
73a4c007a5 misc. stuff, and 3.1.5 -> 3.1.6 version number 2003-01-21 09:58:15 +00:00
albert
ebc5354699 KLONG 2003-01-16 08:03:40 +00:00
albert
256e1f767c new gcc+ld+gas features 2003-01-15 10:52:39 +00:00
albert
c334155f56 egcs-2.91.66 seems to lack __restrict 2003-01-03 16:55:40 +00:00
albert
b657e7e08a NORETURN 2002-12-09 07:53:09 +00:00
albert
5087f3dbf6 big header clean-up 2002-12-09 07:00:07 +00:00
albert
d42a6ee787 likely mistake 2002-12-04 04:04:19 +00:00
albert
538f249009 topz-DocReSync.patch 2002-12-02 21:05:22 +00:00
albert
bd1a19b577 c99 2002-11-25 10:16:33 +00:00
albert
fe1be01b3a restrict 2002-11-25 05:05:52 +00:00
albert
81a4a3d281 gcc 3.0 warnings 2002-10-12 04:25:57 +00:00
albert
6587b498d6 unused code 2002-05-30 07:48:16 +00:00
albert
195fdc4365 use extern keyword 2002-05-30 07:08:15 +00:00
csmall
03a9b5a30f procps 010114 2002-02-01 22:47:29 +00:00