procps/proc
Jim Warner 06be33b43e library: improve and/or standardize 'errno' management
With older library logic having been modified to avoid
using those potentially deadly alloc.h routines, while
improving 'errno' handling, we're ready to standardize
and enhance newlib's approach to any potential errors.

In so doing, we'll establish the following objectives:

. . . . . . . . . . . . . functions returning an 'int'
. an error will be indicated by a negative number that
is always the inverse of some well known errno.h value

. . . . . . . . . . . functions returning an 'address'
. any error will be indicated by a NULL return pointer
with the actual reason found in the formal errno value

And, when errno is manipulated directly we will strive
to do so whenever possible within those routines which
have been declared with PROCPS_EXPORT. In other words,
in the user callable functions defined in source last.

[ But, that won't always be possible. In particular, ]
[ all the 'read_failed' functions will sometimes set ]
[ 'errno' so that they can serve callers returning a ]
[ NULL or an int without duplicating a lot of logic. ]

[ Also, that includes one subordinate function which ]
[ was called by 'read_failed' in the <slabinfo> API. ]

------------------------------------------------------
Along the way, several additional miscellaneous issues
were addressed. They're listed here now for posterity.

. the '-1' return value passed outside the library was
eliminated since it would erroneously equate to -EPERM

. the stacks_fetch functions in <diskstats> and <stat>
weren't checked for their possible minus return values

. hash create was not checked in <meminfo> or <vmstat>

. fixed 'new' function faulty parm check in <slabinfo>

Signed-off-by: Jim Warner <james.warner@comcast.net>
2017-12-20 21:18:54 +11:00
..
.gitignore tests: update template and add pids 2016-04-19 21:33:02 +10:00
COPYING miscellaneous: clean up trailing whitespace once again 2013-04-07 18:05:01 +10:00
devname.c library: eliminate all dependencies on alloc.h/alloc.c 2017-12-20 21:18:53 +11:00
devname.h library: cleanup of readproc functions 2016-04-17 14:14:27 +10:00
diskstats.c library: improve and/or standardize 'errno' management 2017-12-20 21:18:54 +11:00
diskstats.h library: strictly cosmetic, absolutely no code changes 2016-10-09 21:31:29 +11:00
escape.c library: revert one ancient 'escape_str_utf8' deletion 2016-08-23 21:11:09 +10:00
escape.h library: re-arrange escape commands 2016-04-17 14:45:19 +10:00
libprocps.pc.in Renaming libprocfs to libprocps 2011-12-23 09:18:43 +11:00
libprocps.sym library: provide for validating result type references 2016-08-07 21:40:48 +10:00
meminfo.c library: improve and/or standardize 'errno' management 2017-12-20 21:18:54 +11:00
meminfo.h library: add delta values with swap too, <meminfo> api 2017-10-01 22:25:18 +11:00
namespace.c library: ensure 'namespace' types treated consistently 2017-01-04 08:29:44 +11:00
namespace.h library: ensure 'namespace' types treated consistently 2017-01-04 08:29:44 +11:00
numa.c library: set stage for NUMA node field display support 2017-05-22 21:38:10 +10:00
numa.h library: set stage for NUMA node field display support 2017-05-22 21:38:10 +10:00
pids.c library: improve and/or standardize 'errno' management 2017-12-20 21:18:54 +11:00
pids.h library: set stage for NUMA node field display support 2017-05-22 21:38:10 +10:00
procps-private.h library: please keep procps-private.h free of #include 2016-06-11 11:50:37 +10:00
procps.h library: provide for validating result type references 2016-08-07 21:40:48 +10:00
pwcache.c library: eliminate all dependencies on alloc.h/alloc.c 2017-12-20 21:18:53 +11:00
pwcache.h library: rename clashing pwcache functions 2016-06-18 08:17:45 +10:00
readproc.c library: eliminate all dependencies on alloc.h/alloc.c 2017-12-20 21:18:53 +11:00
readproc.h library: eliminate all dependencies on alloc.h/alloc.c 2017-12-20 21:18:53 +11:00
slabinfo.c library: improve and/or standardize 'errno' management 2017-12-20 21:18:54 +11:00
slabinfo.h library: strictly cosmetic, absolutely no code changes 2016-10-09 21:31:29 +11:00
stat.c library: improve and/or standardize 'errno' management 2017-12-20 21:18:54 +11:00
stat.h library <stat>: standardized new category calculations 2017-01-04 08:29:44 +11:00
sysinfo.c library: eliminate all dependencies on alloc.h/alloc.c 2017-12-20 21:18:53 +11:00
sysinfo.h library: eliminate all dependencies on alloc.h/alloc.c 2017-12-20 21:18:53 +11:00
test_namespace.c tests: update template and add pids 2016-04-19 21:33:02 +10:00
test_pids.c related: change for lost 'PROCPS_' enumerator prefixes 2016-07-26 20:49:44 +10:00
test_sysinfo.c tests: update template and add pids 2016-04-19 21:33:02 +10:00
test_uptime.c library: procps_uptime() return value is a status 2016-05-01 16:50:25 +10:00
test_version.c library: Fix LINUX_VERSION macro 2016-05-01 17:46:25 +10:00
uptime.c library: eliminate all dependencies on alloc.h/alloc.c 2017-12-20 21:18:53 +11:00
uptime.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
version.c miscellaneous: remove some trailing whitespace buildup 2015-06-20 07:46:23 +10:00
version.h library: Fix LINUX_VERSION macro 2016-05-01 17:46:25 +10:00
vmstat.c library: improve and/or standardize 'errno' management 2017-12-20 21:18:54 +11:00
vmstat.h library: strictly cosmetic, absolutely no code changes 2016-10-09 21:31:29 +11:00
wchan.c library: don't strip off prefixes from the wchan names 2016-12-07 22:07:00 +11:00
wchan.h library: cleanup of library includes 2016-04-16 17:03:57 +10:00
xtra-procps-debug.h library: strengthen the VAL macro validation functions 2016-08-08 22:01:37 +10:00