FlatImage
A configurable Linux containerization system
Loading...
Searching...
No Matches
linux.hpp File Reference

A library with helpers for linux operations. More...

#include <chrono>
#include <csignal>
#include <cstring>
#include <fcntl.h>
#include <poll.h>
#include <string>
#include <filesystem>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
#include <cassert>
#include <thread>
#include "../macro.hpp"
#include "../std/expected.hpp"
Include dependency graph for linux.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ns_linux
 Linux-specific system operations.
 

Functions

bool ns_linux::poll_with_timeout (int fd, short events, std::chrono::milliseconds const &timeout)
 Waits for a file descriptor to be ready for I/O with a timeout.
 
template<typename Data>
ssize_t ns_linux::read_with_timeout (int fd, std::chrono::milliseconds const &timeout, std::span< Data > buf)
 Reads from the file descriptor with a timeout.
 
template<typename Data>
ssize_t ns_linux::write_with_timeout (int fd, std::chrono::milliseconds const &timeout, std::span< Data > buf)
 Writes to the file descriptor with a timeout.
 
int ns_linux::open_with_timeout (fs::path const &path_file_src, std::chrono::milliseconds timeout, int oflag)
 Opens a given file with a timeout.
 
template<typename Data>
ssize_t ns_linux::open_read_with_timeout (fs::path const &path_file_src, std::chrono::milliseconds const &timeout, std::span< Data > buf)
 Opens and reads from the given input file.
 
template<typename Data>
ssize_t ns_linux::open_write_with_timeout (fs::path const &path_file_src, std::chrono::milliseconds const &timeout, std::span< Data > buf)
 Opens and writes to the given input file.
 
Value< bool > ns_linux::module_check (std::string_view str_name)
 Checks if the linux kernel has a module loaded that matches the input name.
 

Detailed Description

A library with helpers for linux operations.

Author
Ruan Formigoni

Definition in file linux.hpp.