BRL-CAD
|
Cross platform API for interacting with the operating system environment. More...
Files | |
file | env.h |
Macros | |
#define | BU_MEM_ALL 0 |
#define | BU_MEM_AVAIL 1 |
#define | BU_MEM_PAGE_SIZE 2 |
Functions | |
int | bu_setenv (const char *name, const char *value, int overwrite) |
ssize_t | bu_mem (int type, size_t *sz) |
int | bu_interrupt_suspend (void) |
int | bu_interrupt_restore (void) |
Cross platform API for interacting with the operating system environment.
Routines for managing signals.
Platform-independent methods for interacting with the parent operating system environment.
These routines provide a common means to temporarily disable and buffer signal processing during critical write operations.
int bu_setenv | ( | const char * | name, |
const char * | value, | ||
int | overwrite | ||
) |
ssize_t bu_mem | ( | int | type, |
size_t * | sz | ||
) |
Report system memory sizes.
Returns -1 on error and the size of the requested memory type on success. Optionally if sz is non-NULL, the size of the reqeusted memory type will be set to it.
int bu_interrupt_suspend | ( | void | ) |
Defer signal processing and interrupts before critical sections.
Signal processing for a variety of signals that would otherwise disrupt the logic of an application are put on hold until bu_interrupt_restore() is called.
If an interrupt signal is received while suspended, it will be raised when/if interrupts are restored.
Returns 0 on success. Returns non-zero on error (with perror set if signal() failure).
int bu_interrupt_restore | ( | void | ) |
Resume signal processing and interrupts after critical sections.
If a signal was raised since bu_interrupt_suspend() was called, the previously installed signal handler will be immediately called albeit only once even if multiple signals were received.
Returns 0 on success. Returns non-zero on error (with perror set if signal() failure).