#define | alloc_nr(x) |
| Macro for dynamically increasing vector lengths.
|
|
int | real_online_cpus (void) |
| Get number of online cpus.
|
|
int | online_cpus (void) |
| Wrapper for real_online_cpus(), returning 1 in case we can't detect any active cpus.
|
|
const char * | mkstr (const char *fmt,...) __attribute__((__format__(__printf__ |
| Create a short-lived string in stack-allocated memory The number and size of strings is limited (currently to 256 strings of 32 bytes each), so beware and use this sensibly.
|
|
const char int | tv_delta_msec (const struct timeval *start, const struct timeval *stop) |
| Calculate the millisecond delta between two timeval structs.
|
|
float | tv_delta_f (const struct timeval *start, const struct timeval *stop) |
| Get timeval delta as seconds.
|
|
Non-Standard (or Nagios) utility functions and macros.
This is where we house all helpers and macros that fall outside the "standard-ish" norm. The prefixes "nsu_" and NSU_ are reserved for this purpose, so we avoid clashing with other applications that may have similarly-acting functions with identical names.
The functions already here lack the nsu_ prefix for backwards compatibility reasons. It's possible we'll have to fix that some day, but let's leave that for later.