picotm  0.6.0
Files
The C Standard Library Module

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...

Files

file  errno.h
 Transactional wrappers for interfaces of <errno.h>.
 
file  fcntl-tm.h
 Transactional wrappers for interfaces of <fcntl.h>.
 
file  fcntl.h
 Transactional wrappers for interfaces of <fcntl.h>.
 
file  picotm-libc.h
 Public interfaces of picotm's libc module.
 
file  sched.h
 Transactional wrappers for interfaces of <sched.h>.
 
file  stddef.h
 Transactional wrappers for interfaces of <stddef.h>.
 
file  stdio-tm.h
 Transactional wrappers for interfaces of <stdio.h>.
 
file  stdio.h
 Transactional wrappers for interfaces of <stdio.h>.
 
file  stdlib-tm.h
 Transactional wrappers for interfaces of <stdlib.h>.
 
file  stdlib.h
 Transactional wrappers for interfaces of <stdlib.h>.
 
file  string-tm.h
 Transactional wrappers for interfaces of <string.h>.
 
file  string.h
 Transactional wrappers for interfaces of <string.h>.
 
file  socket-tm.h
 Transactional wrappers for interfaces of <sys/socket.h>.
 
file  socket.h
 Transactional wrappers for interfaces of <sys/socket.h>.
 
file  stat-tm.h
 Transactional wrappers for interfaces of <sys/stat.h>.
 
file  stat.h
 Transactional wrappers for interfaces of <sys/stat.h>.
 
file  types.h
 Transactional wrappers for interfaces of <sys/types.h>.
 
file  unistd-tm.h
 Transactional wrappers for interfaces of <unistd.h>.
 
file  unistd.h
 Transactional wrappers for interfaces of <unistd.h>.
 

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.

File content is read with read_tx() or pread_tx(), and written with write_tx() or pwrite_tx(). Depending on the operation, the file position is updated.

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.