Covers the C Standard Library module. This module offers many features of the C Standard Library and POSIX standard, such as string and memory functions, memory allocation, and file-descriptor I/O.
More...

Detailed Description

The C Standard Library Module covers many features of the C Standard Library and the POSIX standard.

Error Handling

The C Standard Library module provides transaction-safe errno as errno_tx. With a few exceptions, the transactional functions will handle errors for you. Only rarely you should have a need to examine the errno status. If accessed, the errno value is saved and restored during aborts.

Memory allocation

You can allocate memory with malloc_tx(), calloc_tx() or posix_memalign_tx(). The allocation is transaction-safe. On aborts, allocated memory blocks will automatically be released. To explicitly release a block of memory call free_tx(). If the transaction aborts afterwards, the released memory block will be available again. For reallocations call realloc_tx(). This call combines memory allocation and releases in a single function.

String and Memory functions.

The C Standard Library module supports a wide range of string and memory helpers, such as strcpy(), strdup(), memmove(), or memcmp().

File-Descriptor I/O

File descriptors can be used transactionally. The module protects file descriptors, open file description, and file buffer; if possible. Call open_tx() and close_tx() to open and close files within a transaction.

The module also supports FIFO and socket buffers; although some operations require irrevocability.

File-System Support

The file system is already a shared resource. Since the module only supports process-local transactions, at least POSIX-like semantics are available. For example, link_tx() is performed immediately and atomically, or temporary files created with mkstemp_tx() are removed automatically on aborts.