freebsd-nq/lib/libmemstat
Robert Watson 345628080d Introduce more formal error handling for libmemstat(3):
- Define a set of libmemstat(3) error constants, which are used by all
  libmemstat(3) methods except for memstat_mtl_alloc(), which allocates
  a memory type list and may return ENOMEM via errno.

- Define a per-memory_type_list current error value, which is set when a
  call associated with a memory list fails.  This requires wrapping a
  structure around the queue(9) list head data structure, but this change
  is not visible to libmemstat(3) consumers due to using access methods.

- Add a new accessor method, memstat_mtl_geterror() to retrieve the error
  number.

- Consistently set the error number in a number of failure modes where
  previously some combination of setting errno and printf'ing error
  descriptions was used.  libmemstat(3) will now no longer print to stdio
  under any circumstances.  Returns of NULL/-1 for errors remain the
  same.

This avoids use of stdio, misuse of error numbers, and should make it
easier to program a libmemstat(3) consumer able to print useful error
messages.  Currently, no error-to-string function is provided, as I'm
unsure how to address internationalization concerns.

MFC after:	1 day
2005-07-24 01:28:54 +00:00
..
libmemstat.3 UMA supports "secondary" zones, in which a second zone can be layered 2005-07-20 09:17:40 +00:00
Makefile
memstat_all.c
memstat_internal.h Introduce more formal error handling for libmemstat(3): 2005-07-24 01:28:54 +00:00
memstat_malloc.c Introduce more formal error handling for libmemstat(3): 2005-07-24 01:28:54 +00:00
memstat_uma.c Introduce more formal error handling for libmemstat(3): 2005-07-24 01:28:54 +00:00
memstat.c Introduce more formal error handling for libmemstat(3): 2005-07-24 01:28:54 +00:00
memstat.h Introduce more formal error handling for libmemstat(3): 2005-07-24 01:28:54 +00:00