procps/proc/sysinfo.h
Jim Warner 18e684d65d library: eliminate all dependencies on alloc.h/alloc.c
While that old master branch library may utilize those
memory allocation functions found in the alloc module,
it was inappropriate for this newlib branch to subject
callers to a stderr message followed by an early exit.

Of course, the old libprocps offered a message handler
override provision (xalloc_err_handler) but that, too,
would seem to be inappropriate for our modern library.

[ remember the battles fought with that damn libnuma ]

So, this commit will tweak those old inherited sources
setting the stage for standardized return values/errno
settings in connection with a memory allocation error.

------------------------------------------------------
Along the way, we'll address the following miscellany:

. Completely eliminate usage of anything from alloc.h.
This, of course, entails our own error checking of the
alternative allocation calls from stdlib.h & string.h.

. Eliminate use of the strdup function where possible,
as with 'procps_uptime' and 'procps_loadavg' routines.

. Whack some obsolete code (getslabinfo) in sysinfo.c.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2017-12-20 21:18:53 +11:00

16 lines
319 B
C

#ifndef PROC_SYSINFO_H
#define PROC_SYSINFO_H
#include <sys/types.h>
#include <dirent.h>
#include <features.h>
__BEGIN_DECLS
long procps_cpu_count(void);
long procps_hertz_get(void);
int procps_loadavg(double *av1, double *av5, double *av15);
unsigned int procps_pid_length(void);
__END_DECLS
#endif /* SYSINFO_H */