Expand description
Abstraction of POSIX constructs with a safe API
Modules§
- The
AccessMode
describes the mode in which resources likecrate::file::File
,crate::shared_memory::SharedMemory
or others should be opened. AdaptiveWait
is a building block which can be integrated into busy loops to make them less CPU consuming.- Inter-process capable
Barrier
which blocks a previously defined number of waiters untilthe all the waiters reachedBarrier::wait()
- Contains POSIX timing related abstractions.
- Contains several variants of POSIX condition variables. A mutex is always included, either as reference or the object itself.
- Defines configuration options for the posix module. They can be adapted when working on a different system.
- The
CreationMode
describes how certain posix resources should be created. - Create and read directory contents based on a POSIX api. It provides also advanced features like
Permission
setting and to be created from aFileDescriptor
- Read, create, write or modify files based on a POSIX api. It provides also advanced features like
Permission
setting and to be created from aFileDescriptor
. - Provides a
FileDescriptor
abstraction which takes the ownership of low-level POSIX file descriptors and theFileDescriptorBased
&FileDescriptorManagement
traits which provide advanced functionalities to allFileDescriptorBased
constructs. - Abstracts a POSIX file descriptor set based of FD_* and select. Can be used to wait on multiple objects which implement the
SynchronousMultiplexing
trait. - A FileLock can be created around any object which implements the
FileDescriptorBased
trait. Either one can exclusively lock the file for writing or many can lock it for reading. FileType
describes the type of files which can be used in a POSIX system.- Used internally to perform error handling based on errnos
- Provides an interface for low-level heap allocations.
- A
MemoryLock
excludes a specific range in the memory from paging, e.g. makes it non-swapable. This may increase the runtime and reduce jitter in a realtime applications since the specific region inside the memory is not moved into the swap space. - Abstraction for the posix message queue. The
MessageQueueReceiver
can receive only, theMessageQueueSender
can send only and theMessageQueueDuplex
can send and receive. Metadata
contains all informations like type, credentials, size, access times about every structure which has a file handle representation. Every struct which implements thecrate::file_descriptor::FileDescriptorManagement
trait can emit aMetadata
. One struct is for instancecrate::file::File
.- Provides an inter-process capable POSIX
Mutex
which can be created by theMutexBuilder
. - Represents the
Ownership
in a unix environment consisting of user and group. Can be used in combination withcrate::file_descriptor::FileDescriptorManagement
to set the credentials ofcrate::file::File
,crate::shared_memory::SharedMemory
and others. - Defines the
Permission
of a file or directory in a POSIX system. Can be used in combination withcrate::file_descriptor::FileDescriptorManagement
to set the credentials ofcrate::file::File
,crate::shared_memory::SharedMemory
and others. - Provides an abstraction of
Process
es in a POSIX system. - Process monitoring via holding a file lock of a specific file. If the process crashes the lock will be released by the operating system and another process can detect the crash. If the process shutdowns correctly the file is removed and another process detects the clean shutdown.
- A POSIX inter-process capable
ReadWriteMutex
where either multiple readers can acquire multiple read-locks or one writer can acquire a write-lock. It is built by theReadWriteMutexBuilder
. - Provides a POSIX
Scheduler
abstraction. - Provides the
NamedSemaphore
and theUnnamedSemaphore
. Both can be used in an inter-process context to signal events between processes. - Provides access to a POSIX
SharedMemory
Object used to share memory between processes. - Provides a POSIX
SignalHandler
. It provides an interface to register custom callbacks for signals, to perform a blocking wait until a certain signal arrived (for instance like CTRL+c) and tracks signals which were received by the process. - The
SocketAncillary
can be sent withcrate::unix_datagram_socket::UnixDatagramSender::try_send_msg()
and received viacrate::unix_datagram_socket::UnixDatagramReceiver::try_receive_msg()
. One can use it to exchange file descriptors between processes or authenticate at another process by sendingSocketCred
containing the process pid, uid and gid. - An abstraction of a POSIX
Thread
with a rich feature set. - Abstraction of an UDP socket.
- Generates a
UniqueSystemId
which is in all processes on the current system. The guarantee is that no other process with the same id exists. But it is possible that a process with a specific id terminates and a new process generates the same id. - Abstraction of datagram based unix domain sockets. The
UnixDatagramReceiver
creates a socket and theUnixDatagramSender
can connect to it and send messages.