LLFIO v2.00
Loading...
Searching...
No Matches
llfio_v2_xxx Namespace Referenceexport

The LLFIO namespace. More...

Namespaces

namespace  algorithm
 Collection of file system based algorithms.
 
namespace  ip
 Inspired by ASIO's ip namespace.
 
namespace  path_discovery
 Contains functions used to discover suitable paths for things.
 
namespace  storage_profile
 YAML databaseable empirical testing of a storage's behaviour.
 
namespace  this_thread
 Thread local settings.
 
namespace  utils
 Utility routines often useful when using LLFIO.
 

Classes

class  awaitable_handle
 An awaitable handle which attempts to execute the i/o immediately. If the i/o can complete immediately, no coroutine suspension occurs. Only if the i/o would take a while is coroutine suspension performed. More...
 
class  byte_io_handle
 A handle to something capable of scatter-gather byte i/o. More...
 
class  byte_io_multiplexer
 A multiplexer of byte-orientated i/o. More...
 
class  byte_socket_handle
 A handle to a byte-orientated socket-like entity. More...
 
struct  construct
 Metaprogramming shim for constructing any handle subclass. More...
 
struct  construct< algorithm::cached_parent_handle_adapter< T > >
 Constructor for algorithm::::cached_parent_handle_adapter<T> More...
 
struct  construct< byte_socket_handle >
 Constructor for byte_socket_handle More...
 
struct  construct< directory_handle >
 Constructor for directory_handle More...
 
struct  construct< fast_random_file_handle >
 Constructor for fast_random_file_handle More...
 
struct  construct< file_handle >
 Constructor for file_handle More...
 
struct  construct< listening_byte_socket_handle >
 Constructor for listening_byte_socket_handle More...
 
struct  construct< map_handle >
 Constructor for map_handle More...
 
struct  construct< mapped_file_handle >
 Constructor for mapped_file_handle More...
 
struct  construct< path_handle >
 Constructor for path_handle More...
 
struct  construct< pipe_handle >
 Constructor for pipe_handle More...
 
struct  construct< process_handle >
 Constructor for process_handle More...
 
struct  construct< section_handle >
 Constructor for section_handle More...
 
struct  construct< symlink_handle >
 Constructor for symlink_handle More...
 
struct  deadline
 A time deadline in either relative-to-now or absolute (system clock) terms. More...
 
struct  directory_entry
 
class  directory_handle
 A handle to a directory which can be enumerated. More...
 
class  dynamic_thread_pool_group
 Work group within the global dynamic thread pool. More...
 
class  error
 The exception type synthesised and thrown when an llfio::result or llfio::outcome is no-value observed. More...
 
struct  error_info
 The cause of the failure of an operation in LLFIO. More...
 
class  executor
 Some implementation of a C++ Executor. More...
 
class  fast_random_file_handle
 A handle to synthesised, non-cryptographic, pseudo-random data. More...
 
class  file_handle
 A handle to a regular file or device. More...
 
class  fs_handle
 A handle to something with a device and inode number. More...
 
class  handle
 A native_handle_type which is managed by the lifetime of this object instance. More...
 
class  listening_byte_socket_handle
 
class  listening_socket_handle_buffer_types_injector
 Injects buffer types for a particular kind of listening socket read. More...
 
class  listening_tls_socket_handle
 A handle to a TLS socket-like entity able to receive incoming connections. More...
 
class  lockable_byte_io_handle
 A handle to something capable of scatter-gather i/o and which can exclude other concurrent users. Models SharedMutex, though note that the locks are per-handle, not per-thread. More...
 
class  map_handle
 A handle to a memory mapped region of memory, either backed by the system page file or by a section. More...
 
class  mapped
 Provides an owning, typed view of memory mapped from a section_handle or a file_handle suitable for feeding to STL algorithms or the Ranges TS. More...
 
class  mapped_file_handle
 A memory mapped regular file or device. More...
 
struct  native_handle_type
 A native handle type used for wrapping file descriptors, process ids or HANDLEs. Unmanaged, wrap in a handle object to manage. More...
 
class  path_handle
 A handle to somewhere originally identified by a path on the filing system. Typically used as the lightest weight handle to some location on the filing system which may unpredictably relocate over time. This handle is thus an anchor to a subset island of the filing system, free of any race conditions introduced by third party changes to any part of the path leading to that island. More...
 
struct  path_hasher
 
class  path_view
 A borrowed view of a path. A lightweight trivial-type alternative to std::filesystem::path. More...
 
class  path_view_component
 An iterated part of a path_view. More...
 
class  pipe_handle
 A handle to a named or anonymous pipe. More...
 
class  pollable_handle
 A handle type which can be supplied to poll(). More...
 
class  process_handle
 A handle to this, or another, process. More...
 
class  read_receiver
 A C++ Receiver of an i/o read for an i/o type of IoHandleType. More...
 
class  section_handle
 A handle to a source of mapped memory. More...
 
struct  stat_t
 Metadata about a directory entry. More...
 
struct  statfs_t
 Metadata about a filing system. Unsupported entries are all bits set. More...
 
class  symlink_handle
 A handle to an inode which redirects to a different path. More...
 
class  tls_socket_handle
 A handle to a TLS secure socket-like entity. More...
 
class  tls_socket_source
 A source of tls_socket_handle and listening_tls_socket_handle and possibly a byte_io_multiplexer to multiplex i/o on multiple socket instances at the same time. More...
 
struct  tls_socket_source_implementation_information
 The implementation information returned. More...
 
class  tls_socket_source_registry
 A process-wide registry of tls_socket_source. More...
 
class  unique_file_lock
 RAII locker matching std::unique_lock for lockable_byte_io_handle, but untemplated. More...
 
class  write_receiver
 A C++ Receiver of an i/o write for an i/o type of IoHandleType. More...
 

Typedefs

using byte_io_multiplexer_ptr = std::unique_ptr< byte_io_multiplexer >
 A unique ptr to an i/o multiplexer implementation.
 
template<class T >
using optional = std::optional< T >
 
template<typename charT , typename traits = std::char_traits<charT>>
using basic_string_view = std::basic_string_view< charT, traits >
 
typedef basic_string_view< char, std::char_traits< char > > string_view
 
typedef basic_string_view< wchar_t, std::char_traits< wchar_t > > wstring_view
 
typedef basic_string_view< char16_t, std::char_traits< char16_t > > u16string_view
 
typedef basic_string_view< char32_t, std::char_traits< char32_t > > u32string_view
 
template<class F , size_t callable_storage_bytes = 32 - sizeof(uintptr_t)>
using function_ptr = QUICKCPPLIB_NAMESPACE::function_ptr::function_ptr< F, callable_storage_bytes >
 
using spinlock = QUICKCPPLIB_NAMESPACE::configurable_spinlock::spinlock< uintptr_t >
 
using dynamic_thread_pool_group_ptr = std::unique_ptr< dynamic_thread_pool_group >
 A unique ptr to a work group within the global dynamic thread pool.
 
template<class T >
using result = OUTCOME_V2_NAMESPACE::result< T, error_info, OUTCOME_V2_NAMESPACE::policy::terminate >
 
template<class T >
using outcome = OUTCOME_V2_NAMESPACE::outcome< T, error_info >
 
using tls_socket_handle_ptr = std::unique_ptr< tls_socket_handle, detail::tls_socket_handle_deleter >
 A pointer to a TLS socket handle returned by a TLS socket source.
 
using listening_tls_socket_handle_ptr = std::unique_ptr< listening_tls_socket_handle, detail::listening_tls_socket_handle_deleter >
 A pointer to a listening TLS socket handle returned by a TLS socket source.
 
using tls_socket_source_ptr = std::unique_ptr< tls_socket_source, detail::tls_socket_source_deleter >
 A pointer to a TLS socket source.
 

Enumerations

enum class  io_operation_state_type {
  unknown , read_initialised , read_initiated , read_completed ,
  read_finished , write_initialised , write_initiated , barrier_initialised ,
  barrier_initiated , write_or_barrier_completed , write_or_barrier_finished
}
 The possible states of the i/o operation. More...
 
enum class  win32_path_namespace { any , device , dos , guid_volume }
 The kinds of win32 path namespace possible. More...
 
enum class  lock_kind { unlocked , shared , exclusive }
 The kinds of concurrent user exclusion which can be performed. More...
 
enum  bitfield__tls_algorithm : unsigned { default_ = (0U) , FIPS_140_2 = (1U << 0U) }
 TLS algorithm categories. More...
 

Functions

 QUICKCPPLIB_BITFIELD_BEGIN_T (poll_what, uint8_t)
 What to poll.
 
result< size_t > poll (span< poll_what > out, span< pollable_handle * > handles, span< const poll_what > query, deadline d={}) noexcept
 Polls a list of pollable handles awaiting a change in state.
 
byte_io_handle::io_result< byte_io_handle::buffers_type > read (byte_io_handle &self, byte_io_handle::io_request< byte_io_handle::buffers_type > reqs, deadline d=deadline()) noexcept
 Read data from the open handle.
 
byte_io_handle::io_result< byte_io_handle::const_buffers_type > write (byte_io_handle &self, byte_io_handle::io_request< byte_io_handle::const_buffers_type > reqs, deadline d=deadline()) noexcept
 Write data to the open handle.
 
byte_io_handle::io_result< byte_io_handle::size_type > write (byte_io_handle &self, byte_io_handle::extent_type offset, std::initializer_list< byte_io_handle::const_buffer_type > lst, deadline d=deadline()) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr bool is_initialised (io_operation_state_type s) noexcept
 True if the i/o operation state is initialised.
 
constexpr bool is_initiated (io_operation_state_type s) noexcept
 True if the i/o operation state is initiated.
 
constexpr bool is_completed (io_operation_state_type s) noexcept
 True if the i/o operation state is completed.
 
constexpr bool is_finished (io_operation_state_type s) noexcept
 True if the i/o operation state is finished.
 
std::ostream & operator<< (std::ostream &s, const directory_handle::filter &v)
 
std::ostream & operator<< (std::ostream &s, const directory_handle::buffers_type &)
 
void swap (directory_handle &self, directory_handle &o) noexcept
 Swap with another instance.
 
result< directory_handledirectory (const path_handle &base, directory_handle::path_view_type path, directory_handle::mode _mode=directory_handle::mode::read, directory_handle::creation _creation=directory_handle::creation::open_existing, directory_handle::caching _caching=directory_handle::caching::all, directory_handle::flag flags=directory_handle::flag::none) noexcept
 
result< directory_handleuniquely_named_directory (const path_handle &dirpath, directory_handle::mode _mode=directory_handle::mode::write, directory_handle::caching _caching=directory_handle::caching::temporary, directory_handle::flag flags=directory_handle::flag::none) noexcept
 
result< directory_handletemp_directory (directory_handle::path_view_type name=directory_handle::path_view_type(), directory_handle::mode _mode=directory_handle::mode::write, directory_handle::creation _creation=directory_handle::creation::if_needed, directory_handle::caching _caching=directory_handle::caching::all, directory_handle::flag flags=directory_handle::flag::none) noexcept
 
result< dynamic_thread_pool_group_ptrmake_dynamic_thread_pool_group () noexcept
 Creates a new work group within the global dynamic thread pool.
 
void swap (file_handle &self, file_handle &o) noexcept
 Swap with another instance.
 
result< file_handlefile (const path_handle &base, file_handle::path_view_type path, file_handle::mode _mode=file_handle::mode::read, file_handle::creation _creation=file_handle::creation::open_existing, file_handle::caching _caching=file_handle::caching::all, file_handle::flag flags=file_handle::flag::none) noexcept
 
result< file_handleuniquely_named_file (const path_handle &dirpath, file_handle::mode _mode=file_handle::mode::write, file_handle::caching _caching=file_handle::caching::temporary, file_handle::flag flags=file_handle::flag::none) noexcept
 
result< file_handletemp_file (file_handle::path_view_type name=file_handle::path_view_type(), file_handle::mode _mode=file_handle::mode::write, file_handle::creation _creation=file_handle::creation::if_needed, file_handle::caching _caching=file_handle::caching::temporary, file_handle::flag flags=file_handle::flag::unlink_on_first_close) noexcept
 
result< file_handletemp_inode (const path_handle &dirh=path_discovery::storage_backed_temporary_files_directory(), file_handle::mode _mode=file_handle::mode::write, file_handle::caching _caching=file_handle::caching::temporary, file_handle::flag flags=file_handle::flag::none) noexcept
 
file_handle::io_result< file_handle::size_type > read (file_handle &self, file_handle::extent_type offset, std::initializer_list< file_handle::buffer_type > lst, deadline d=deadline()) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
result< file_handle::extent_type > maximum_extent (const file_handle &self) noexcept
 
result< file_handle::extent_type > truncate (file_handle &self, file_handle::extent_type newsize) noexcept
 
result< std::vector< file_handle::extent_pair > > extents (const file_handle &self) noexcept
 Returns a list of currently valid extents for this open file. WARNING: racy!
 
result< file_handle::extent_type > zero (file_handle &self, file_handle::extent_type offset, file_handle::extent_type bytes, deadline d=deadline()) noexcept
 Efficiently zero, and possibly deallocate, data on storage.
 
result< filesystem::path > to_win32_path (const fs_handle &h, win32_path_namespace mapping=win32_path_namespace::any) noexcept
 Maps the current path of h into a form suitable for Win32 APIs. Passes through unmodified on POSIX, so you can use this in portable code.
 
template<class T , typename std::enable_if<(!std::is_base_of< fs_handle, T >::value &&std::is_base_of< handle, T >::value), bool >::type = true>
result< filesystem::path > to_win32_path (const T &h, win32_path_namespace mapping=win32_path_namespace::any) noexcept
 
result< void > relink (fs_handle &self, const path_handle &base, fs_handle::path_view_type path, bool atomic_replace=true, deadline d=std::chrono::seconds(30)) noexcept
 
result< void > unlink (fs_handle &self, deadline d=std::chrono::seconds(30)) noexcept
 
std::ostream & operator<< (std::ostream &s, const handle &v)
 
std::ostream & operator<< (std::ostream &s, const handle::mode &v)
 
std::ostream & operator<< (std::ostream &s, const handle::creation &v)
 
std::ostream & operator<< (std::ostream &s, const handle::caching &v)
 
std::ostream & operator<< (std::ostream &s, const handle::flag &v)
 
void swap (handle &self, handle &o) noexcept
 Swap with another instance.
 
result< void > close (handle &self) noexcept
 Immediately close the native handle type managed by this handle.
 
std::ostream & operator<< (std::ostream &s, const section_handle::flag &v)
 
byte_io_handle::const_buffer_type nvram_barrier (byte_io_handle::const_buffer_type req, bool evict=false) noexcept
 
template<class T >
constexpr span< T > in_place_attach (map_handle &mh) noexcept
 Declare map_handle as a suitable source for P1631 attached<T>.
 
void swap (section_handle &self, section_handle &o) noexcept
 Swap with another instance.
 
result< section_handlesection (file_handle &backing, section_handle::extent_type maximum_size, section_handle::flag _flag) noexcept
 Create a memory section backed by a file.
 
result< section_handlesection (file_handle &backing, section_handle::extent_type bytes=0) noexcept
 Create a memory section backed by a file.
 
result< section_handlesection (section_handle::extent_type bytes, const path_handle &dirh=path_discovery::storage_backed_temporary_files_directory(), section_handle::flag _flag=section_handle::flag::read|section_handle::flag::write) noexcept
 Create a memory section backed by an anonymous, managed file.
 
result< section_handle::extent_type > length (const section_handle &self) noexcept
 Return the current maximum permitted extent of the memory section.
 
result< section_handle::extent_type > truncate (section_handle &self, section_handle::extent_type newsize=0) noexcept
 
void swap (map_handle &self, map_handle &o) noexcept
 Swap with another instance.
 
result< void > close (map_handle &self) noexcept
 Unmap the mapped view.
 
result< map_handlemap (map_handle::size_type bytes, bool zeroed=false, section_handle::flag _flag=section_handle::flag::readwrite) noexcept
 
result< map_handlemap (section_handle &section, map_handle::size_type bytes=0, map_handle::extent_type offset=0, section_handle::flag _flag=section_handle::flag::readwrite) noexcept
 
map_handle::size_type length (const map_handle &self) noexcept
 The size of the memory map. This is the accessible size, NOT the reservation size.
 
result< map_handle::size_type > truncate (map_handle &self, map_handle::size_type newsize, bool permit_relocation=false) noexcept
 
map_handle::io_result< map_handle::buffers_type > read (map_handle &self, map_handle::io_request< map_handle::buffers_type > reqs, deadline d=deadline()) noexcept
 Read data from the mapped view.
 
map_handle::io_result< map_handle::const_buffers_type > write (map_handle &self, map_handle::io_request< map_handle::const_buffers_type > reqs, deadline d=deadline()) noexcept
 Write data to the mapped view.
 
template<class T >
constexpr span< T > in_place_attach (mapped_file_handle &mfh) noexcept
 Declare mapped_file_handle as a suitable source for P1631 attached<T>.
 
void swap (mapped_file_handle &self, mapped_file_handle &o) noexcept
 Swap with another instance.
 
result< mapped_file_handlemapped_file (mapped_file_handle::size_type reservation, const path_handle &base, mapped_file_handle::path_view_type _path, mapped_file_handle::mode _mode=mapped_file_handle::mode::read, mapped_file_handle::creation _creation=mapped_file_handle::creation::open_existing, mapped_file_handle::caching _caching=mapped_file_handle::caching::all, mapped_file_handle::flag flags=mapped_file_handle::flag::none) noexcept
 
result< mapped_file_handlemapped_file (const path_handle &base, mapped_file_handle::path_view_type _path, mapped_file_handle::mode _mode=mapped_file_handle::mode::read, mapped_file_handle::creation _creation=mapped_file_handle::creation::open_existing, mapped_file_handle::caching _caching=mapped_file_handle::caching::all, mapped_file_handle::flag flags=mapped_file_handle::flag::none) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
result< mapped_file_handlemapped_uniquely_named_file (mapped_file_handle::size_type reservation, const path_handle &dirpath, mapped_file_handle::mode _mode=mapped_file_handle::mode::write, mapped_file_handle::caching _caching=mapped_file_handle::caching::temporary, mapped_file_handle::flag flags=mapped_file_handle::flag::none) noexcept
 
result< mapped_file_handlemapped_temp_file (mapped_file_handle::size_type reservation, mapped_file_handle::path_view_type name=mapped_file_handle::path_view_type(), mapped_file_handle::mode _mode=mapped_file_handle::mode::write, mapped_file_handle::creation _creation=mapped_file_handle::creation::if_needed, mapped_file_handle::caching _caching=mapped_file_handle::caching::temporary, mapped_file_handle::flag flags=mapped_file_handle::flag::unlink_on_first_close) noexcept
 
result< mapped_file_handlemapped_temp_inode (mapped_file_handle::size_type reservation=0, const path_handle &dir=path_discovery::storage_backed_temporary_files_directory(), mapped_file_handle::mode _mode=mapped_file_handle::mode::write, mapped_file_handle::caching _caching=mapped_file_handle::caching::temporary, mapped_file_handle::flag flags=mapped_file_handle::flag::none) noexcept
 
result< path_handlepath (const path_handle &base, path_handle::path_view_type path) noexcept
 
result< path_handlepath (path_handle::path_view_type _path) noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr bool operator== (path_view_component x, path_view_component y) noexcept
 Compares identity equality not equivalence i.e. backing storage type must be identical, and backing bytes must be identical. Use compare() if you want something stronger.
 
constexpr bool operator== (path_view x, path_view y) noexcept
 Compares individual path view components for identity not equivalence. Use compare() if you want something stronger.
 
constexpr bool operator!= (path_view_component x, path_view_component y) noexcept
 Compares identity inequality not disequivalence i.e. backing storage type must be different, or backing bytes must be different. Use compare() if you want something stronger.
 
constexpr bool operator< (path_view_component x, path_view_component y) noexcept
 Compares identity for ordering i.e. backing storage type must be different, or backing bytes must be different. Use compare() if you want something stronger.
 
constexpr bool operator!= (path_view x, path_view y) noexcept
 Compares individual path view components for non-**identity** not disequivalence. Use compare() if you want something stronger.
 
constexpr bool operator< (path_view x, path_view y) noexcept
 Compares individual path view components for ordering. Use compare() if you want something stronger.
 
constexpr size_t hash_value (path_view_component view) noexcept
 Hashes a path_view_component.
 
template<class F >
constexpr auto visit (path_view_component view, F &&f)
 Visit the underlying source for a path_view_component (LLFIO backwards compatible overload)
 
template<class F >
constexpr auto visit (F &&f, path_view_component view)
 Visit the underlying source for a path_view_component (std compatible overload)
 
std::ostream & operator<< (std::ostream &s, const path_view_component &v)
 
constexpr size_t hash_value (path_view x) noexcept
 Return the combined hash of individual path components.
 
template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool operator== (path_view_component, const CharT *) noexcept
 
template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool operator== (const CharT *, path_view_component) noexcept
 
template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool operator!= (path_view_component, const CharT *) noexcept
 
template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool operator!= (const CharT *, path_view_component) noexcept
 
template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool operator< (path_view_component, const CharT *) noexcept
 
template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool operator< (const CharT *, path_view_component) noexcept
 
template<class CharT , typename std::enable_if<(path_view::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool operator== (path_view, const CharT *) noexcept
 
template<class CharT , typename std::enable_if<(path_view::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool operator== (const CharT *, path_view) noexcept
 
template<class CharT , typename std::enable_if<(path_view::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool operator!= (path_view, const CharT *) noexcept
 
template<class CharT , typename std::enable_if<(path_view::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool operator!= (const CharT *, path_view) noexcept
 
filesystem::path & operator+= (filesystem::path &a, path_view_component b)
 Append a path view component to a path.
 
filesystem::path & operator/= (filesystem::path &a, path_view_component b)
 Append a path view component to a path.
 
filesystem::path operator/ (const filesystem::path &a, path_view_component b)
 Append a path view component to a path.
 
filesystem::path operator/ (filesystem::path &&a, path_view_component b)
 Append a path view component to a path.
 
template<class T , typename std::enable_if<(std::is_same< T, path_view_component >::value||std::is_same< T, path_view >::value), bool >::type = true>
filesystem::path operator/ (T a, path_view_component b)
 Append a path view component to a path view component.
 
std::ostream & operator<< (std::ostream &s, const process_handle::flag &v)
 
std::error_code make_error_code (error_info ei)
 
bool operator== (const error_info &a, const error_info &b)
 
bool operator!= (const error_info &a, const error_info &b)
 
 OUTCOME_TEMPLATE (class ErrorCondEnum) OUTCOME_TREQUIRES(OUTCOME_TPRED(std
 
std::ostream & operator<< (std::ostream &s, const error_info &v)
 
void outcome_throw_as_system_error_with_payload (const error_info &ei)
 
error_info error_from_exception (std::exception_ptr &&ep=std::current_exception(), std::error_code not_matched=std::make_error_code(std::errc::resource_unavailable_try_again)) noexcept
 
error_info generic_error (errc c)
 Helper for constructing an error info from an errc.
 
error_info posix_error (int c=errno)
 Helper for constructing an error info from a POSIX errno.
 
 QUICKCPPLIB_BITFIELD_BEGIN_T (tls_socket_source_implementation_features, uint32_t)
 Feature bits for TLS socket sources.
 
std::ostream & operator<< (std::ostream &s, const tls_socket_source_implementation_information &v)
 

Detailed Description

The LLFIO namespace.

Enumeration Type Documentation

◆ bitfield__tls_algorithm

TLS algorithm categories.

Enumerator
default_ 

The default set of TLS algorithms offered during handshake is a short list of strong ciphers (typically 128 - 256 bits for the symmetric cipher) to suit embedded and low end devices, ordered by strength-cpuload e.g. ChaCha20 would be chosen preferentially to AES, if the CPUs do not have hardware accelerated AES, and longer key sizes would come before shorter key sizes.

FIPS_140_2 

The set of TLS algorithms compliant with the FIPS 140-2 standard. Implementations may refuse to work if this is configured.

49{ //
50 /*! The default set of TLS algorithms offered during handshake is a short list
51 of strong ciphers (typically 128 - 256 bits for the symmetric cipher)
52 to suit embedded and low end devices, ordered by strength-cpuload e.g. ChaCha20
53 would be chosen preferentially to AES, **if** the CPUs do not have hardware
54 accelerated AES, and longer key sizes would come before shorter key sizes.
55 */
56 default_ = (0U),
57 /*! The set of TLS algorithms compliant with the FIPS 140-2 standard.
58 Implementations may refuse to work if this is configured.
59 */
60 FIPS_140_2 = (1U << 0U)
61
62} QUICKCPPLIB_BITFIELD_END(tls_algorithm)
@ default_
Definition tls_socket_handle.hpp:56

◆ io_operation_state_type

The possible states of the i/o operation.

52{
53 unknown,
54
55 read_initialised,
56 read_initiated,
57 read_completed,
58 read_finished,
59
60 write_initialised,
61 write_initiated,
62 barrier_initialised,
63 barrier_initiated,
64 write_or_barrier_completed,
65 write_or_barrier_finished
66};

◆ lock_kind

enum class llfio_v2_xxx::lock_kind
strong

The kinds of concurrent user exclusion which can be performed.

Enumerator
unlocked 

Exclude none.

shared 

Exclude only those requesting an exclusive lock on the same inode.

exclusive 

Exclude those requesting any kind of lock on the same inode.

43{
44 unlocked, //!< Exclude none.
45 shared, //!< Exclude only those requesting an exclusive lock on the same inode.
46 exclusive //!< Exclude those requesting any kind of lock on the same inode.
47};
@ shared
Exclude only those requesting an exclusive lock on the same inode.
@ exclusive
Exclude those requesting any kind of lock on the same inode.
@ unlocked
Exclude none.

◆ win32_path_namespace

The kinds of win32 path namespace possible.

Enumerator
any 

Map the input path to a valid win32 path as fast as possible for the input. This is currently guid_volume followed by dos, but may change in the future.

device 

Map \!!\Device\... form input paths to \\.\... for which it is usually the case there is a mapping, which results in a valid Win32 path, but which legacy code bases may not accept. This efficiently covers the vast majority of what can be returned by handle::current_path() on Windows, but if the input path cannot be mapped, a failure is returned.

dos 

Map the input path to a DOS drive letter prefix, possibly with \\?\ prefix to opt out of strict DOS path parsing if the mapped DOS path is incompatible with traditional DOS (e.g. it contains one of the forbidden character sequences such as CON, or it exceeds 260 codepoints, and so on). Well written software will correctly handle \\?\ prefixes, but if the code you are handing the path to is particularly legacy, you ought to ensure that the prefix is not present.

Warning
There is not a one-one mapping between NT kernel paths (which is what LLFIO returns from handle::current_path()) and DOS style paths, so what you get may be surprising. It is also possible that there is no mapping at all, in which case a failure is returned.
guid_volume 

Map the input path replacing the volume as a GUID, such that say an input path of C:\foo\bar might be mapped to \\?\Volume{9f9bd10e-9003-4da5-b146-70584e30854a}\foo\bar. This is a valid Win32 path, but legacy code bases may not accept it. This eliminates problems with drive letters vanishing or being ambiguous, and unlike with dos, there is a guaranteed one-one mapping between NT kernel paths and guid_volume paths. The mapped path is NOT checked for equivalence to the input file.

46{
47 /*! Map the input path to a valid win32 path as fast as possible for the input.
48 This is currently `guid_volume` followed by `dos`, but may change in the future.
49 */
50 any,
51 /*! Map `\!!\Device\...` form input paths to `\\.\...` for which it is _usually_
52 the case there is a mapping, which results in a valid Win32 path, but which
53 legacy code bases may not accept. This efficiently covers the vast majority of
54 what can be returned by `handle::current_path()` on Windows, but if the input
55 path cannot be mapped, a failure is returned.
56 */
57 device,
58 /*! Map the input path to a DOS drive letter prefix, possibly with `\\?\` prefix
59 to opt out of strict DOS path parsing if the mapped DOS path is incompatible with
60 traditional DOS (e.g. it contains one of the forbidden character sequences such
61 as `CON`, or it exceeds 260 codepoints, and so on). Well written software will
62 correctly handle `\\?\` prefixes, but if the code you are handing the path to is
63 particularly legacy, you ought to ensure that the prefix is not present.
64
65 \warning There is not a one-one mapping between NT kernel paths (which is what
66 LLFIO returns from `handle::current_path()`) and DOS style paths, so what you get
67 may be surprising. It is also possible that there is no mapping at all, in which
68 case a failure is returned.
69 */
70 dos,
71 /*! Map the input path replacing the volume as a GUID, such that say an input path
72 of `C:\foo\bar` might be mapped to `\\?\Volume{9f9bd10e-9003-4da5-b146-70584e30854a}\foo\bar`.
73 This is a valid Win32 path, but legacy code bases may not accept it. This eliminates
74 problems with drive letters vanishing or being ambiguous, and unlike with `dos`,
75 there is a guaranteed one-one mapping between NT kernel paths and `guid_volume` paths.
76 The mapped path is NOT checked for equivalence to the input file.
77 */
79#if 0
80 /*! Map the input path replacing the the whole path as a GUID, such that say an input
81 path of `C:\foo\bar` might be mapped to `\\?\Volume{9f9bd10e-9003-4da5-b146-70584e30854a}\{5a13b46c-44b9-40f3-9303-23cf7d918708}`.
82 This is a valid Win32 path, but legacy code bases may not accept it. This eliminates
83 problems with long paths or if the file could be renamed concurrently. Note this may
84 cause the creation of a GUID for the file on some filesystems (NTFS). The mapped path
85 is NOT checked for equivalence to the input file.
86 */
87 guid_all
88
89/*
90- `win32_path_namespace::guid_all` does the same as `guid_volume`, but additionally
91asks Windows for the GUID for the file upon the volume, creating one if one
92doesn't exist if necessary. The path returned consists of two GUIDs, and is a
93perfectly valid Win32 path which most Win32 APIs will accept.
94*/
95#endif
96};

Function Documentation

◆ close() [1/2]

result< void > llfio_v2_xxx::close ( handle self)
inlinenoexcept

Immediately close the native handle type managed by this handle.

680{
681 return self.close();
682}
virtual result< void > close() noexcept
Immediately close the native handle type managed by this handle.

◆ close() [2/2]

result< void > llfio_v2_xxx::close ( map_handle self)
inlinenoexcept

Unmap the mapped view.

1093{
1094 return self.close();
1095}
virtual result< void > close() noexcept override
Unmap the mapped view.

◆ directory()

result< directory_handle > llfio_v2_xxx::directory ( const path_handle base,
directory_handle::path_view_type  path,
directory_handle::mode  _mode = directory_handle::mode::read,
directory_handle::creation  _creation = directory_handle::creation::open_existing,
directory_handle::caching  _caching = directory_handle::caching::all,
directory_handle::flag  flags = directory_handle::flag::none 
)
inlinenoexcept

Create a handle opening access to a directory on path.

Errors returnable\n Any of the values POSIX open() or CreateFile() can return.
469{
470 return directory_handle::directory(std::forward<decltype(base)>(base), std::forward<decltype(path)>(path), std::forward<decltype(_mode)>(_mode),
471 std::forward<decltype(_creation)>(_creation), std::forward<decltype(_caching)>(_caching),
472 std::forward<decltype(flags)>(flags));
473}

◆ error_from_exception()

error_info llfio_v2_xxx::error_from_exception ( std::exception_ptr &&  ep = std::current_exception(),
std::error_code  not_matched = std::make_error_code(std::errc::resource_unavailable_try_again) 
)
inlinenoexcept
635{
636#ifdef __cpp_exceptions
637 return error_info(OUTCOME_V2_NAMESPACE::error_from_exception(std::move(ep), not_matched));
638#else
639 (void) ep;
640 (void) not_matched;
641 abort(); // should never be called
642#endif
643}
The cause of the failure of an operation in LLFIO.
Definition status_code.hpp:430

◆ extents()

result< std::vector< file_handle::extent_pair > > llfio_v2_xxx::extents ( const file_handle self)
inlinenoexcept

Returns a list of currently valid extents for this open file. WARNING: racy!

526{
527 return self.extents();
528}
virtual result< std::vector< extent_pair > > extents() const noexcept
Returns a list of currently valid extents for this open file. WARNING: racy!

◆ file()

result< file_handle > llfio_v2_xxx::file ( const path_handle base,
file_handle::path_view_type  path,
file_handle::mode  _mode = file_handle::mode::read,
file_handle::creation  _creation = file_handle::creation::open_existing,
file_handle::caching  _caching = file_handle::caching::all,
file_handle::flag  flags = file_handle::flag::none 
)
inlinenoexcept

Create a file handle opening access to a file on path

Parameters
baseHandle to a base location on the filing system. Pass {} to indicate that path will be absolute.
pathThe path relative to base to open.
_modeHow to open the file.
_creationHow to create the file.
_cachingHow to ask the kernel to cache the file.
flagsAny additional custom behaviours.
Errors returnable\n Any of the values POSIX open() or CreateFile() can return.
437{
438 return file_handle::file(std::forward<decltype(base)>(base), std::forward<decltype(path)>(path), std::forward<decltype(_mode)>(_mode),
439 std::forward<decltype(_creation)>(_creation), std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
440}

◆ generic_error()

error_info llfio_v2_xxx::generic_error ( errc  c)
inline

Helper for constructing an error info from an errc.

663{
664 return error_info(make_error_code(c));
665}

◆ hash_value() [1/2]

constexpr size_t llfio_v2_xxx::hash_value ( path_view  x)
inlineconstexprnoexcept

Return the combined hash of individual path components.

3000{
3001 size_t ret = 0;
3002 for(auto component : x)
3003 {
3004 ret ^= hash_value(component) + 0x9e3779b9 + (ret << 6) + (ret >> 2);
3005 }
3006 return ret;
3007}
constexpr size_t hash_value(path_view_component x) noexcept
Hashes a path_view_component.
Definition path_view.hpp:1818

◆ hash_value() [2/2]

constexpr size_t llfio_v2_xxx::hash_value ( path_view_component  x)
inlineconstexprnoexcept

Hashes a path_view_component.

1819{
1820 return view._invoke(
1821 [](auto sv) -> size_t
1822 {
1823 // std::hash isn't available for all kinds of string view on older compilers :(
1824 const auto hash = QUICKCPPLIB_NAMESPACE::algorithm::hash::fast_hash::hash((const char *) sv.data(), sv.size() * sizeof(*sv.data()));
1825 return *(size_t *) &hash;
1826 });
1827}

◆ in_place_attach() [1/2]

template<class T >
constexpr span< T > llfio_v2_xxx::in_place_attach ( map_handle mh)
inlineconstexprnoexcept

Declare map_handle as a suitable source for P1631 attached<T>.

947{
948 return span<T>{reinterpret_cast<T *>(mh.address()), mh.length() / sizeof(T)};
949}
size_type length() const noexcept
The size of the memory map. This is the accessible size, NOT the reservation size.
Definition map_handle.hpp:740
byte * address() const noexcept
The address in memory where this mapped view resides.
Definition map_handle.hpp:721

◆ in_place_attach() [2/2]

template<class T >
constexpr span< T > llfio_v2_xxx::in_place_attach ( mapped_file_handle mfh)
inlineconstexprnoexcept

Declare mapped_file_handle as a suitable source for P1631 attached<T>.

793{
794 return span<T>{reinterpret_cast<T *>(mfh.address()), mfh.map().length() / sizeof(T)};
795}
byte * address() const noexcept
The address in memory where this mapped file currently resides.
Definition mapped_file_handle.hpp:561
const map_handle & map() const noexcept
The map this handle is using.
Definition mapped_file_handle.hpp:550

◆ is_completed()

constexpr bool llfio_v2_xxx::is_completed ( io_operation_state_type  s)
inlineconstexprnoexcept

True if the i/o operation state is completed.

111{
112 switch(s)
113 {
114 case io_operation_state_type::unknown:
115 case io_operation_state_type::read_initialised:
116 case io_operation_state_type::read_initiated:
117 case io_operation_state_type::read_finished:
118 case io_operation_state_type::write_initialised:
119 case io_operation_state_type::write_initiated:
120 case io_operation_state_type::barrier_initialised:
121 case io_operation_state_type::barrier_initiated:
122 case io_operation_state_type::write_or_barrier_finished:
123 return false;
124 case io_operation_state_type::read_completed:
125 case io_operation_state_type::write_or_barrier_completed:
126 return true;
127 }
128 return false;
129}

◆ is_finished()

constexpr bool llfio_v2_xxx::is_finished ( io_operation_state_type  s)
inlineconstexprnoexcept

True if the i/o operation state is finished.

132{
133 switch(s)
134 {
135 case io_operation_state_type::unknown:
136 case io_operation_state_type::read_initialised:
137 case io_operation_state_type::read_initiated:
138 case io_operation_state_type::read_completed:
139 case io_operation_state_type::write_initialised:
140 case io_operation_state_type::write_initiated:
141 case io_operation_state_type::barrier_initialised:
142 case io_operation_state_type::barrier_initiated:
143 case io_operation_state_type::write_or_barrier_completed:
144 return false;
145 case io_operation_state_type::read_finished:
146 case io_operation_state_type::write_or_barrier_finished:
147 return true;
148 }
149 return false;
150}

◆ is_initialised()

constexpr bool llfio_v2_xxx::is_initialised ( io_operation_state_type  s)
inlineconstexprnoexcept

True if the i/o operation state is initialised.

69{
70 switch(s)
71 {
72 case io_operation_state_type::unknown:
73 case io_operation_state_type::read_initiated:
74 case io_operation_state_type::read_completed:
75 case io_operation_state_type::read_finished:
76 case io_operation_state_type::write_initiated:
77 case io_operation_state_type::write_or_barrier_completed:
78 case io_operation_state_type::write_or_barrier_finished:
79 case io_operation_state_type::barrier_initiated:
80 return false;
81 case io_operation_state_type::read_initialised:
82 case io_operation_state_type::write_initialised:
83 case io_operation_state_type::barrier_initialised:
84 return true;
85 }
86 return false;
87}

◆ is_initiated()

constexpr bool llfio_v2_xxx::is_initiated ( io_operation_state_type  s)
inlineconstexprnoexcept

True if the i/o operation state is initiated.

90{
91 switch(s)
92 {
93 case io_operation_state_type::unknown:
94 case io_operation_state_type::read_initialised:
95 case io_operation_state_type::read_completed:
96 case io_operation_state_type::read_finished:
97 case io_operation_state_type::write_initialised:
98 case io_operation_state_type::barrier_initialised:
99 case io_operation_state_type::write_or_barrier_completed:
100 case io_operation_state_type::write_or_barrier_finished:
101 return false;
102 case io_operation_state_type::read_initiated:
103 case io_operation_state_type::write_initiated:
104 case io_operation_state_type::barrier_initiated:
105 return true;
106 }
107 return false;
108}

◆ length() [1/2]

map_handle::size_type llfio_v2_xxx::length ( const map_handle self)
inlinenoexcept

The size of the memory map. This is the accessible size, NOT the reservation size.

1131{
1132 return self.length();
1133}

◆ length() [2/2]

result< section_handle::extent_type > llfio_v2_xxx::length ( const section_handle self)
inlinenoexcept

Return the current maximum permitted extent of the memory section.

1072{
1073 return self.length();
1074}
result< extent_type > length() const noexcept
Return the current length of the memory section.

◆ make_error_code()

std::error_code llfio_v2_xxx::make_error_code ( error_info  ei)
inline
587{
588 return ei.ec;
589}

◆ map() [1/2]

result< map_handle > llfio_v2_xxx::map ( map_handle::size_type  bytes,
bool  zeroed = false,
section_handle::flag  _flag = section_handle::flag::readwrite 
)
inlinenoexcept

Create new memory and map it into view.

Parameters
bytesHow many bytes to create and map. Typically will be rounded up to a multiple of the page size (see page_size()) on POSIX, 64Kb on Windows.
zeroedSet to true if only all bits zeroed memory is wanted.
_flagThe permissions with which to map the view. flag::none can be useful for reserving virtual address space without committing system resources, use commit() to later change availability of memory.
Note
On Microsoft Windows this constructor uses the faster VirtualAlloc() which creates less versatile page backed memory. If you want anonymous memory allocated from a paging file backed section instead, create a page file backed section and then a mapped view from that using the other constructor. This makes available all those very useful VM tricks Windows can do with section mapped memory which VirtualAlloc() memory cannot do.
Errors returnable\n Any of the values POSIX mmap() or VirtualAlloc() can return.
1110{
1111 return map_handle::map(std::forward<decltype(bytes)>(bytes), zeroed, std::forward<decltype(_flag)>(_flag));
1112}

◆ map() [2/2]

result< map_handle > llfio_v2_xxx::map ( section_handle section,
map_handle::size_type  bytes = 0,
map_handle::extent_type  offset = 0,
section_handle::flag  _flag = section_handle::flag::readwrite 
)
inlinenoexcept

Create a memory mapped view of a backing storage, optionally reserving additional address space for later growth.

Parameters
sectionA memory section handle specifying the backing storage to use.
bytesHow many bytes to reserve (0 = the size of the section). Rounded up to nearest 64Kb on Windows.
offsetThe offset into the backing storage to map from
_flagThe permissions with which to map the view which are constrained by the permissions of the memory section. flag::none can be useful for reserving virtual address space without committing system resources, use commit() to later change availability of memory.
Errors returnable\n Any of the values POSIX mmap() or NtMapViewOfSection() can return.
1125{
1126 return map_handle::map(std::forward<decltype(section)>(section), std::forward<decltype(bytes)>(bytes), std::forward<decltype(offset)>(offset),
1127 std::forward<decltype(_flag)>(_flag));
1128}

◆ mapped_file() [1/2]

result< mapped_file_handle > llfio_v2_xxx::mapped_file ( const path_handle base,
mapped_file_handle::path_view_type  _path,
mapped_file_handle::mode  _mode = mapped_file_handle::mode::read,
mapped_file_handle::creation  _creation = mapped_file_handle::creation::open_existing,
mapped_file_handle::caching  _caching = mapped_file_handle::caching::all,
mapped_file_handle::flag  flags = mapped_file_handle::flag::none 
)
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

834{
835 return mapped_file_handle::mapped_file(std::forward<decltype(base)>(base), std::forward<decltype(_path)>(_path), std::forward<decltype(_mode)>(_mode),
836 std::forward<decltype(_creation)>(_creation), std::forward<decltype(_caching)>(_caching),
837 std::forward<decltype(flags)>(flags));
838}

◆ mapped_file() [2/2]

result< mapped_file_handle > llfio_v2_xxx::mapped_file ( mapped_file_handle::size_type  reservation,
const path_handle base,
mapped_file_handle::path_view_type  _path,
mapped_file_handle::mode  _mode = mapped_file_handle::mode::read,
mapped_file_handle::creation  _creation = mapped_file_handle::creation::open_existing,
mapped_file_handle::caching  _caching = mapped_file_handle::caching::all,
mapped_file_handle::flag  flags = mapped_file_handle::flag::none 
)
inlinenoexcept

Create a memory mapped file handle opening access to a file on path.

Parameters
reservationThe number of bytes to reserve for later expansion when mapping. Zero means reserve only the current file length.
baseHandle to a base location on the filing system. Pass {} to indicate that path will be absolute.
_pathThe path relative to base to open.
_modeHow to open the file.
_creationHow to create the file.
_cachingHow to ask the kernel to cache the file.
flagsAny additional custom behaviours.

Note that if the file is currently zero sized, no mapping occurs now, but later when truncate() or update_map() is called.

Errors returnable\n Any of the values which the constructors for file_handle, section_handle and map_handle can return.
822{
823 return mapped_file_handle::mapped_file(std::forward<decltype(reservation)>(reservation), std::forward<decltype(base)>(base),
824 std::forward<decltype(_path)>(_path), std::forward<decltype(_mode)>(_mode),
825 std::forward<decltype(_creation)>(_creation), std::forward<decltype(_caching)>(_caching),
826 std::forward<decltype(flags)>(flags));
827}

◆ mapped_temp_file()

result< mapped_file_handle > llfio_v2_xxx::mapped_temp_file ( mapped_file_handle::size_type  reservation,
mapped_file_handle::path_view_type  name = mapped_file_handle::path_view_type(),
mapped_file_handle::mode  _mode = mapped_file_handle::mode::write,
mapped_file_handle::creation  _creation = mapped_file_handle::creation::if_needed,
mapped_file_handle::caching  _caching = mapped_file_handle::caching::temporary,
mapped_file_handle::flag  flags = mapped_file_handle::flag::unlink_on_first_close 
)
inlinenoexcept

Create a mapped file handle creating the named file on some path which the OS declares to be suitable for temporary files. Most OSs are very lazy about flushing changes made to these temporary files. Note the default flags are to have the newly created file deleted on first handle close. Note also that an empty name is equivalent to calling mapped_uniquely_named_file(path_discovery::storage_backed_temporary_files_directory()) and the creation parameter is ignored.

Note
If the temporary file you are creating is not going to have its path sent to another process for usage, this is the WRONG function to use. Use temp_inode() instead, it is far more secure.
Errors returnable\n Any of the values POSIX open() or CreateFile() can return.
877{
878 return mapped_file_handle::mapped_temp_file(std::forward<decltype(reservation)>(reservation), std::forward<decltype(name)>(name),
879 std::forward<decltype(_mode)>(_mode), std::forward<decltype(_creation)>(_creation),
880 std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
881}

◆ mapped_temp_inode()

result< mapped_file_handle > llfio_v2_xxx::mapped_temp_inode ( mapped_file_handle::size_type  reservation = 0,
const path_handle dir = path_discovery::storage_backed_temporary_files_directory(),
mapped_file_handle::mode  _mode = mapped_file_handle::mode::write,
mapped_file_handle::caching  _caching = mapped_file_handle::caching::temporary,
mapped_file_handle::flag  flags = mapped_file_handle::flag::none 
)
inlinenoexcept

Securely create a mapped file handle creating a temporary anonymous inode in the filesystem referred to by dirpath. The inode created has no name nor accessible path on the filing system and ceases to exist as soon as the last handle is closed, making it ideal for use as a temporary file where other processes do not need to have access to its contents via some path on the filing system (a classic use case is for backing shared memory maps).

Errors returnable\n Any of the values POSIX open() or CreateFile() can return.
897{
898 return mapped_file_handle::mapped_temp_inode(std::forward<decltype(reservation)>(reservation), std::forward<decltype(dir)>(dir),
899 std::forward<decltype(_mode)>(_mode), std::forward<decltype(_caching)>(_caching),
900 std::forward<decltype(flags)>(flags));
901}

◆ mapped_uniquely_named_file()

result< mapped_file_handle > llfio_v2_xxx::mapped_uniquely_named_file ( mapped_file_handle::size_type  reservation,
const path_handle dirpath,
mapped_file_handle::mode  _mode = mapped_file_handle::mode::write,
mapped_file_handle::caching  _caching = mapped_file_handle::caching::temporary,
mapped_file_handle::flag  flags = mapped_file_handle::flag::none 
)
inlinenoexcept

Create an mapped file handle creating a randomly named file on a path. The file is opened exclusively with creation::only_if_not_exist so it will never collide with nor overwrite any existing file. Note also that caching defaults to temporary which hints to the OS to only flush changes to physical storage as lately as possible.

Errors returnable\n Any of the values POSIX open() or CreateFile() can return.
851{
852 return mapped_file_handle::mapped_uniquely_named_file(std::forward<decltype(reservation)>(reservation), std::forward<decltype(dirpath)>(dirpath),
853 std::forward<decltype(_mode)>(_mode), std::forward<decltype(_caching)>(_caching),
854 std::forward<decltype(flags)>(flags));
855}

◆ maximum_extent()

result< file_handle::extent_type > llfio_v2_xxx::maximum_extent ( const file_handle self)
inlinenoexcept

Return the current maximum permitted extent of the file.

Errors returnable\n Any of the values POSIX fstat() or GetFileInformationByHandleEx() can return.
507{
508 return self.maximum_extent();
509}
virtual result< extent_type > maximum_extent() const noexcept

◆ nvram_barrier()

byte_io_handle::const_buffer_type llfio_v2_xxx::nvram_barrier ( byte_io_handle::const_buffer_type  req,
bool  evict = false 
)
inlinenoexcept

Lightweight inlined barrier which causes the CPU to write out all buffered writes and dirty cache lines in the request to main memory.

Returns
The cache lines actually barriered. This may be empty. This function does not return an error.
Parameters
reqThe range of cache lines to write barrier.
evictWhether to also evict the cache lines from CPU caches, useful if they will not be used again.

Upon return, one knows that memory in the returned buffer has been barriered (it may be empty if there is no support for this operation in LLFIO, or if the current CPU does not support this operation). You may find the is_nvram() observer of particular use here.

296{
297 auto *tp = (byte_io_handle::const_buffer_type::pointer) (((uintptr_t) req.data()) & ~63);
298 byte_io_handle::const_buffer_type ret{tp, (size_t) (req.data() + 63 + req.size() - tp) & ~63};
299 if(memory_flush_none == mem_flush_stores(ret.data(), ret.size(), evict ? memory_flush_evict : memory_flush_retain))
300 {
301 ret = {tp, 0};
302 }
303 return ret;
304}
Definition byte_io_multiplexer.hpp:287
constexpr size_type size() const noexcept
Returns the number of bytes in this buffer.
Definition byte_io_multiplexer.hpp:342
constexpr pointer data() noexcept
Returns the address of the bytes for this buffer.
Definition byte_io_multiplexer.hpp:338
const byte * pointer
Type of the pointer to memory.
Definition byte_io_multiplexer.hpp:289

◆ operator!=() [1/7]

template<class CharT , typename std::enable_if<(path_view::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool llfio_v2_xxx::operator!= ( const CharT *  ,
path_view   
)
inlineconstexprnoexcept
2993{
2994 static_assert(!path_view::is_source_acceptable<CharT>, "Do not use operator!= with path_view and a string literal, use .compare<>()");
2995 return false;
2996}

◆ operator!=() [2/7]

template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool llfio_v2_xxx::operator!= ( const CharT *  ,
path_view_component   
)
inlineconstexprnoexcept
1797{
1798 static_assert(!path_view_component::is_source_acceptable<CharT>, "Do not use operator!= with path_view_component and a string literal, use .compare<>()");
1799 return false;
1800}

◆ operator!=() [3/7]

bool llfio_v2_xxx::operator!= ( const error_info a,
const error_info b 
)
inline
518{
519 return make_error_code(a) != make_error_code(b);
520}

◆ operator!=() [4/7]

constexpr bool llfio_v2_xxx::operator!= ( path_view  x,
path_view  y 
)
inlineconstexprnoexcept

Compares individual path view components for non-**identity** not disequivalence. Use compare() if you want something stronger.

2943{
2944 auto it1 = x.begin(), it2 = y.begin();
2945 for(; it1 != x.end() && it2 != y.end(); ++it1, ++it2)
2946 {
2947 if(*it1 != *it2)
2948 {
2949 return true;
2950 }
2951 }
2952 if(it1 == x.end() && it2 != y.end())
2953 {
2954 return true;
2955 }
2956 if(it1 != x.end() && it2 == y.end())
2957 {
2958 return true;
2959 }
2960 return false;
2961}
constexpr const_iterator end() const noexcept
Returns an iterator to after the last path component.
Definition path_view.hpp:2857
constexpr const_iterator begin() const noexcept
Returns an iterator to the first path component.
Definition path_view.hpp:2849

◆ operator!=() [5/7]

template<class CharT , typename std::enable_if<(path_view::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool llfio_v2_xxx::operator!= ( path_view  ,
const CharT *   
)
inlineconstexprnoexcept
2986{
2987 static_assert(!path_view::is_source_acceptable<CharT>, "Do not use operator!= with path_view and a string literal, use .compare<>()");
2988 return false;
2989}

◆ operator!=() [6/7]

constexpr bool llfio_v2_xxx::operator!= ( path_view_component  x,
path_view_component  y 
)
inlineconstexprnoexcept

Compares identity inequality not disequivalence i.e. backing storage type must be different, or backing bytes must be different. Use compare() if you want something stronger.

1691{
1692 if(x._passthrough != y._passthrough)
1693 {
1694 return true;
1695 }
1696 if(x._char != y._char)
1697 {
1698 return true;
1699 }
1700 if(x._wchar != y._wchar)
1701 {
1702 return true;
1703 }
1704 if(x._utf8 != y._utf8)
1705 {
1706 return true;
1707 }
1708 if(x._utf16 != y._utf16)
1709 {
1710 return true;
1711 }
1712 if(x.native_size() != y.native_size())
1713 {
1714 return true;
1715 }
1716 if(x.native_size() == 0)
1717 {
1718 return false;
1719 }
1720 assert(x._bytestr != nullptr);
1721 assert(y._bytestr != nullptr);
1722 const auto bytes = (x._wchar || x._utf16) ? (x._length * 2) : x._length;
1723 return 0 != memcmp(x._bytestr, y._bytestr, bytes);
1724}
constexpr size_t native_size() const noexcept
Returns the size of the view in characters.
Definition path_view.hpp:654

◆ operator!=() [7/7]

template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool llfio_v2_xxx::operator!= ( path_view_component  ,
const CharT *   
)
inlineconstexprnoexcept
1790{
1791 static_assert(!path_view_component::is_source_acceptable<CharT>, "Do not use operator!= with path_view_component and a string literal, use .compare<>()");
1792 return false;
1793}

◆ operator+=()

filesystem::path & llfio_v2_xxx::operator+= ( filesystem::path &  a,
path_view_component  b 
)
inline

Append a path view component to a path.

3069{
3071 basic_string_view<filesystem::path::value_type> _ = zpath.as_string_view();
3072 a.concat(_.begin(), _.end());
3073 return a;
3074}
rendered_path< termination::not_zero_terminated, T, AllocatorOrDeleter, _internal_buffer_size > not_zero_terminated_rendered_path
Convenience type alias.
Definition path_view.hpp:1505

◆ operator/() [1/3]

filesystem::path llfio_v2_xxx::operator/ ( const filesystem::path &  a,
path_view_component  b 
)
inline

Append a path view component to a path.

3085{
3086 filesystem::path ret(a);
3087 return ret /= b;
3088}

◆ operator/() [2/3]

filesystem::path llfio_v2_xxx::operator/ ( filesystem::path &&  a,
path_view_component  b 
)
inline

Append a path view component to a path.

3091{
3092 filesystem::path ret(std::move(a));
3093 return ret /= b;
3094}

◆ operator/() [3/3]

template<class T , typename std::enable_if<(std::is_same< T, path_view_component >::value||std::is_same< T, path_view >::value), bool >::type = true>
filesystem::path llfio_v2_xxx::operator/ ( a,
path_view_component  b 
)
inline

Append a path view component to a path view component.

3118{
3119 detail::path_view_component_operator_slash_visitor x;
3120 visit(x, a);
3121 return x.ret /= b;
3122}
constexpr auto visit(path_view_component view, F &&f)
Visit the underlying source for a path_view_component (LLFIO backwards compatible overload)
Definition path_view.hpp:1829

◆ operator/=()

filesystem::path & llfio_v2_xxx::operator/= ( filesystem::path &  a,
path_view_component  b 
)
inline

Append a path view component to a path.

3077{
3079 basic_string_view<filesystem::path::value_type> _ = zpath.as_string_view();
3080 a.append(_.begin(), _.end());
3081 return a;
3082}

◆ operator<() [1/4]

template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool llfio_v2_xxx::operator< ( const CharT *  ,
path_view_component   
)
inlineconstexprnoexcept
1811{
1812 static_assert(!path_view_component::is_source_acceptable<CharT>, "Do not use operator< with path_view_component and a string literal, use .compare<>()");
1813 return false;
1814}

◆ operator<() [2/4]

constexpr bool llfio_v2_xxx::operator< ( path_view  x,
path_view  y 
)
inlineconstexprnoexcept

Compares individual path view components for ordering. Use compare() if you want something stronger.

2964{
2965 auto it1 = x.begin(), it2 = y.begin();
2966 for(; it1 != x.end() && it2 != y.end(); ++it1, ++it2)
2967 {
2968 if(*it1 < *it2)
2969 {
2970 return true;
2971 }
2972 if(*it2 < *it1)
2973 {
2974 return false;
2975 }
2976 }
2977 if(it1 == x.end() && it2 != y.end())
2978 {
2979 return true;
2980 }
2981 return false;
2982}

◆ operator<() [3/4]

constexpr bool llfio_v2_xxx::operator< ( path_view_component  x,
path_view_component  y 
)
inlineconstexprnoexcept

Compares identity for ordering i.e. backing storage type must be different, or backing bytes must be different. Use compare() if you want something stronger.

1728{
1729 if(x._passthrough < y._passthrough)
1730 {
1731 return true;
1732 }
1733 if(x._passthrough > y._passthrough)
1734 {
1735 return false;
1736 }
1737 if(x._char < y._char)
1738 {
1739 return true;
1740 }
1741 if(x._char > y._char)
1742 {
1743 return false;
1744 }
1745 if(x._wchar < y._wchar)
1746 {
1747 return true;
1748 }
1749 if(x._wchar > y._wchar)
1750 {
1751 return false;
1752 }
1753 if(x._utf8 < y._utf8)
1754 {
1755 return true;
1756 }
1757 if(x._utf8 > y._utf8)
1758 {
1759 return false;
1760 }
1761 if(x._utf16 < y._utf16)
1762 {
1763 return true;
1764 }
1765 if(x._utf16 > y._utf16)
1766 {
1767 return false;
1768 }
1769 if(x.native_size() < y.native_size())
1770 {
1771 return true;
1772 }
1773 if(x.native_size() > y.native_size())
1774 {
1775 return false;
1776 }
1777 if(x.native_size() == 0)
1778 {
1779 return false;
1780 }
1781 assert(x._bytestr != nullptr);
1782 assert(y._bytestr != nullptr);
1783 const auto bytes = (x._wchar || x._utf16) ? (x._length * 2) : x._length;
1784 return memcmp(x._bytestr, y._bytestr, bytes) < 0;
1785}

◆ operator<() [4/4]

template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool llfio_v2_xxx::operator< ( path_view_component  ,
const CharT *   
)
inlineconstexprnoexcept
1804{
1805 static_assert(!path_view_component::is_source_acceptable<CharT>, "Do not use operator< with path_view_component and a string literal, use .compare<>()");
1806 return false;
1807}

◆ operator<<() [1/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const directory_handle::buffers_type  
)
inline
438{
439 return s << "llfio::directory_handle::buffers_type";
440}

◆ operator<<() [2/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const directory_handle::filter v 
)
inline
429{
430 static constexpr const char *values[] = {"none", "fastdeleted"};
431 if(static_cast<size_t>(v) >= sizeof(values) / sizeof(values[0]) || (values[static_cast<size_t>(v)] == nullptr))
432 {
433 return s << "llfio::directory_handle::filter::<unknown>";
434 }
435 return s << "llfio::directory_handle::filter::" << values[static_cast<size_t>(v)];
436}

◆ operator<<() [3/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const error_info v 
)
inline
578{
579 if(make_error_code(v))
580 {
581 return s << "llfio::error_info(" << v.message() << ")";
582 }
583 return s << "llfio::error_info(null)";
584}
std::string message() const
Definition status_code.hpp:499

◆ operator<<() [4/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const handle v 
)
inline
426{
427 if(v.is_valid())
428 {
429 auto _currentpath = v.current_path();
430 std::string currentpath = !_currentpath ? std::string(_currentpath.error().message().c_str()) : _currentpath.value().string();
431 return s << "llfio::handle(" << v._v._init << ", " << currentpath << ")";
432 }
433 return s << "llfio::handle(closed)";
434}
virtual result< path_type > current_path() const noexcept
bool is_valid() const noexcept
True if the handle is valid (and usually open)
Definition handle.hpp:323

◆ operator<<() [5/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const handle::caching v 
)
inline
454{
455 static constexpr const char *values[] = {"unchanged", "none", "only_metadata", "reads", "all", "reads_and_metadata", "temporary", "safety_fsyncs"};
456 if(static_cast<size_t>(v) >= sizeof(values) / sizeof(values[0]) || (values[static_cast<size_t>(v)] == nullptr)) // NOLINT
457 {
458 return s << "llfio::handle::caching::<unknown>";
459 }
460 return s << "llfio::handle::caching::" << values[static_cast<size_t>(v)]; // NOLINT
461}

◆ operator<<() [6/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const handle::creation v 
)
inline
445{
446 static constexpr const char *values[] = {"open_existing", "only_if_not_exist", "if_needed", "truncate_existing", "always_new"};
447 if(static_cast<size_t>(v) >= sizeof(values) / sizeof(values[0]) || (values[static_cast<size_t>(v)] == nullptr)) // NOLINT
448 {
449 return s << "llfio::handle::creation::<unknown>";
450 }
451 return s << "llfio::handle::creation::" << values[static_cast<size_t>(v)]; // NOLINT
452}

◆ operator<<() [7/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const handle::flag &  v 
)
inline
463{
464 std::string temp;
465 if(!!(v & handle::flag::unlink_on_first_close))
466 {
467 temp.append("unlink_on_first_close|");
468 }
469 if(!!(v & handle::flag::disable_safety_barriers))
470 {
471 temp.append("disable_safety_barriers|");
472 }
473 if(!!(v & handle::flag::disable_prefetching))
474 {
475 temp.append("disable_prefetching|");
476 }
477 if(!!(v & handle::flag::maximum_prefetching))
478 {
479 temp.append("maximum_prefetching|");
480 }
481 if(!!(v & handle::flag::win_disable_unlink_emulation))
482 {
483 temp.append("win_disable_unlink_emulation|");
484 }
485 if(!!(v & handle::flag::win_disable_sparse_file_creation))
486 {
487 temp.append("win_disable_sparse_file_creation|");
488 }
489 if(!!(v & handle::flag::disable_parallelism))
490 {
491 temp.append("disable_parallelism|");
492 }
493 if(!!(v & handle::flag::win_create_case_sensitive_directory))
494 {
495 temp.append("win_create_case_sensitive_directory|");
496 }
497 if(!!(v & handle::flag::multiplexable))
498 {
499 temp.append("multiplexable|");
500 }
501 if(!!(v & handle::flag::byte_lock_insanity))
502 {
503 temp.append("byte_lock_insanity|");
504 }
505 if(!!(v & handle::flag::anonymous_inode))
506 {
507 temp.append("anonymous_inode|");
508 }
509 if(!temp.empty())
510 {
511 temp.resize(temp.size() - 1);
512 if(std::count(temp.cbegin(), temp.cend(), '|') > 0)
513 {
514 temp = "(" + temp + ")";
515 }
516 }
517 else
518 {
519 temp = "none";
520 }
521 return s << "llfio::handle::flag::" << temp;
522}

◆ operator<<() [8/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const handle::mode v 
)
inline
436{
437 static constexpr const char *values[] = {"unchanged", nullptr, "none", nullptr, "attr_read", "attr_write", "read", "write", nullptr, "append"};
438 if(static_cast<size_t>(v) >= sizeof(values) / sizeof(values[0]) || (values[static_cast<size_t>(v)] == nullptr)) // NOLINT
439 {
440 return s << "llfio::handle::mode::<unknown>";
441 }
442 return s << "llfio::handle::mode::" << values[static_cast<size_t>(v)]; // NOLINT
443}

◆ operator<<() [9/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const path_view_component v 
)
inline
1871{
1872 if(v._passthrough)
1873 {
1874 return s << '"' << QUICKCPPLIB_NAMESPACE::algorithm::string::to_hex_string(v._charstr, v._length) << '"';
1875 }
1876 v._invoke(detail::string_view_printer{s});
1877 return s;
1878}

◆ operator<<() [10/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const process_handle::flag &  v 
)
inline
236{
237 std::string temp;
238 if(!!(v & process_handle::flag::no_redirect_in_pipe))
239 {
240 temp.append("no_redirect_in_pipe|");
241 }
242 if(!!(v & process_handle::flag::no_redirect_out_pipe))
243 {
244 temp.append("no_redirect_out_pipe|");
245 }
246 if(!!(v & process_handle::flag::no_redirect_error_pipe))
247 {
248 temp.append("no_redirect_error_pipe|");
249 }
250 if(!!(v & process_handle::flag::wait_on_close))
251 {
252 temp.append("wait_on_close|");
253 }
254 if(!!(v & process_handle::flag::release_pipes_on_close))
255 {
256 temp.append("release_pipes_on_close|");
257 }
258 if(!!(v & process_handle::flag::no_multiplexable_pipes))
259 {
260 temp.append("no_multiplexable_pipes|");
261 }
262 if(!temp.empty())
263 {
264 temp.resize(temp.size() - 1);
265 if(std::count(temp.cbegin(), temp.cend(), '|') > 0)
266 {
267 temp = "(" + temp + ")";
268 }
269 }
270 else
271 {
272 temp = "none";
273 }
274 return s << "llfio::process_handle::flag::" << temp;
275}

◆ operator<<() [11/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const section_handle::flag &  v 
)
inline
201{
202 std::string temp;
203 if(!!(v & section_handle::flag::read))
204 {
205 temp.append("read|");
206 }
207 if(!!(v & section_handle::flag::write))
208 {
209 temp.append("write|");
210 }
211 if(!!(v & section_handle::flag::cow))
212 {
213 temp.append("cow|");
214 }
215 if(!!(v & section_handle::flag::execute))
216 {
217 temp.append("execute|");
218 }
219 if(!!(v & section_handle::flag::nocommit))
220 {
221 temp.append("nocommit|");
222 }
223 if(!!(v & section_handle::flag::prefault))
224 {
225 temp.append("prefault|");
226 }
227 if(!!(v & section_handle::flag::executable))
228 {
229 temp.append("executable|");
230 }
231 if(!!(v & section_handle::flag::singleton))
232 {
233 temp.append("singleton|");
234 }
235 if(!!(v & section_handle::flag::barrier_on_close))
236 {
237 temp.append("barrier_on_close|");
238 }
239 if(!!(v & section_handle::flag::nvram))
240 {
241 temp.append("nvram|");
242 }
243 if(!!(v & section_handle::flag::write_via_syscall))
244 {
245 temp.append("write_via_syscall|");
246 }
247 if((v & section_handle::flag::page_sizes_3) == section_handle::flag::page_sizes_3)
248 {
249 temp.append("page_sizes_3|");
250 }
251 else if((v & section_handle::flag::page_sizes_2) == section_handle::flag::page_sizes_2)
252 {
253 temp.append("page_sizes_2|");
254 }
255 else if((v & section_handle::flag::page_sizes_1) == section_handle::flag::page_sizes_1)
256 {
257 temp.append("page_sizes_1|");
258 }
259 if(!temp.empty())
260 {
261 temp.resize(temp.size() - 1);
262 if(std::count(temp.cbegin(), temp.cend(), '|') > 0)
263 {
264 temp = "(" + temp + ")";
265 }
266 }
267 else
268 {
269 temp = "none";
270 }
271 return s << "llfio::section_handle::flag::" << temp;
272}

◆ operator<<() [12/12]

std::ostream & llfio_v2_xxx::operator<< ( std::ostream &  s,
const tls_socket_source_implementation_information v 
)
inline
470{
471 return s << v.name << "_v" << v.version.major << "." << v.version.minor << "." << v.version.patch << "_" << v.postfix;
472}
struct llfio_v2_xxx::tls_socket_source_implementation_information::@26 version
Version of the underlying implementation. Could be a kernel version if appropriate.
string_view postfix
The build config or other disambiguator from others with the same name and version.
Definition tls_socket_handle.hpp:431
string_view name
The name of the underlying implementation e.g. "openssl", "schannel" etc.
Definition tls_socket_handle.hpp:426

◆ operator==() [1/7]

template<class CharT , typename std::enable_if<(path_view::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool llfio_v2_xxx::operator== ( const CharT *  ,
path_view   
)
inlineconstexprnoexcept
2897{
2898 static_assert(!path_view::is_source_acceptable<CharT>, "Do not use operator== with path_view and a string literal, use .compare<>()");
2899 return false;
2900}

◆ operator==() [2/7]

template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool llfio_v2_xxx::operator== ( const CharT *  ,
path_view_component   
)
inlineconstexprnoexcept
1598{
1599 static_assert(!path_view_component::is_source_acceptable<CharT>, "Do not use operator== with path_view_component and a string literal, use .compare<>()");
1600 return false;
1601}

◆ operator==() [3/7]

bool llfio_v2_xxx::operator== ( const error_info a,
const error_info b 
)
inline
514{
515 return make_error_code(a) == make_error_code(b);
516}

◆ operator==() [4/7]

constexpr bool llfio_v2_xxx::operator== ( path_view  x,
path_view  y 
)
inlineconstexprnoexcept

Compares individual path view components for identity not equivalence. Use compare() if you want something stronger.

2868{
2869 auto it1 = x.begin(), it2 = y.begin();
2870 for(; it1 != x.end() && it2 != y.end(); ++it1, ++it2)
2871 {
2872 if(*it1 != *it2)
2873 {
2874 return false;
2875 }
2876 }
2877 if(it1 == x.end() && it2 != y.end())
2878 {
2879 return false;
2880 }
2881 if(it1 != x.end() && it2 == y.end())
2882 {
2883 return false;
2884 }
2885 return true;
2886}

◆ operator==() [5/7]

template<class CharT , typename std::enable_if<(path_view::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool llfio_v2_xxx::operator== ( path_view  ,
const CharT *   
)
inlineconstexprnoexcept
2890{
2891 static_assert(!path_view::is_source_acceptable<CharT>, "Do not use operator== with path_view and a string literal, use .compare<>()");
2892 return false;
2893}

◆ operator==() [6/7]

constexpr bool llfio_v2_xxx::operator== ( path_view_component  x,
path_view_component  y 
)
inlineconstexprnoexcept

Compares identity equality not equivalence i.e. backing storage type must be identical, and backing bytes must be identical. Use compare() if you want something stronger.

1554{
1555 if(x._passthrough != y._passthrough)
1556 {
1557 return false;
1558 }
1559 if(x._char != y._char)
1560 {
1561 return false;
1562 }
1563 if(x._wchar != y._wchar)
1564 {
1565 return false;
1566 }
1567 if(x._utf8 != y._utf8)
1568 {
1569 return false;
1570 }
1571 if(x._utf16 != y._utf16)
1572 {
1573 return false;
1574 }
1575 if(x.native_size() != y.native_size())
1576 {
1577 return false;
1578 }
1579 if(x.native_size() == 0)
1580 {
1581 return true;
1582 }
1583 assert(x._bytestr != nullptr);
1584 assert(y._bytestr != nullptr);
1585 const auto bytes = (x._wchar || x._utf16) ? (x._length * 2) : x._length;
1586 return 0 == memcmp(x._bytestr, y._bytestr, bytes);
1587}

◆ operator==() [7/7]

template<class CharT , typename std::enable_if<(path_view_component::is_source_acceptable< CharT >), bool >::type = true>
constexpr bool llfio_v2_xxx::operator== ( path_view_component  ,
const CharT *   
)
inlineconstexprnoexcept
1591{
1592 static_assert(!path_view_component::is_source_acceptable<CharT>, "Do not use operator== with path_view_component and a string literal, use .compare<>()");
1593 return false;
1594}

◆ OUTCOME_TEMPLATE()

llfio_v2_xxx::OUTCOME_TEMPLATE ( class ErrorCondEnum  )
524{
525 auto _a = make_error_code(a);
526 auto _b = std::error_condition(b);
527#ifndef _WIN32
528 // Looks like libstdc++ doesn't map system category to generic category, which is a bug
529 if(_a.category() == std::system_category() && _b.category() == std::generic_category() && _a.value() == static_cast<int>(b))
530 return true;
531#endif
532 return _a == _b;
533}

◆ outcome_throw_as_system_error_with_payload()

void llfio_v2_xxx::outcome_throw_as_system_error_with_payload ( const error_info ei)
inline
592{
593 ei.throw_exception();
594}
void throw_exception() const
Definition status_code.hpp:612

◆ path() [1/2]

result< path_handle > llfio_v2_xxx::path ( const path_handle base,
path_handle::path_view_type  path 
)
inlinenoexcept

Create a path handle opening access to some location on the filing system. Some operating systems provide a particularly lightweight method of doing this (Linux: O_PATH, Windows: no access perms) which is much faster than opening a directory. For other systems, we open a directory with read only permissions.

Errors returnable\n Any of the values POSIX open() or CreateFile() can return.
172{
173 return path_handle::path(std::forward<decltype(base)>(base), std::forward<decltype(path)>(path));
174}

◆ path() [2/2]

result< path_handle > llfio_v2_xxx::path ( path_handle::path_view_type  _path)
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

177{
178 return path_handle::path(std::forward<decltype(_path)>(_path));
179}

◆ poll()

result< size_t > llfio_v2_xxx::poll ( span< poll_what >  out,
span< pollable_handle * >  handles,
span< const poll_what >  query,
deadline  d = {} 
)
externnoexcept

Polls a list of pollable handles awaiting a change in state.

Returns
The number of handles with changed state. Handles not is_kernel_handle() receive poll_what::not_pollable.
Parameters
outAn array of poll_what set with the results of the poll. The bits in this array are NOT cleared by this operation, so you need to clear this manualy before the call if that's what you need.
handlesAn array of pointers to handle. Individual pointers can be null if you want to skip them.
queryAn array of poll_what to check.
dAn optional timeout.
Errors returnable\n Whatever POSIX poll() or Windows WSAPoll() can return.

Note that the maximum number of handles which can be passed to this function is 1024 (the platform syscall may refuse even that many). Note that this function is O(N) to handle count, so more than a few hundred is a bad idea in any case. If you need to wait on more handles than this, you need to implement a byte_io_multiplexer for your platform.

The sizes of out, handles and query must be the same, or an error is returned.

Note
On POSIX pipe_handle is a pollable_handle, but on Windows it is not. Also, on Windows, you cannot mix socket handles from different networking stacks in the same poll.

◆ posix_error()

error_info llfio_v2_xxx::posix_error ( int  c = errno)
inline

Helper for constructing an error info from a POSIX errno.

669{
670 return error_info(std::error_code(c, std::system_category()));
671}

◆ QUICKCPPLIB_BITFIELD_BEGIN_T() [1/2]

llfio_v2_xxx::QUICKCPPLIB_BITFIELD_BEGIN_T ( poll_what  ,
uint8_t   
)

What to poll.

< Query nothing for this handle.

< If this handle is readable.

< If this handle is writable.

< If this handle is errored. This is always set in the output even if not requested.

< If this handle is closed/hung up. This is always set in the output even if not requested.

< This handle is not pollable.

583{
584none = 0U, //!< Query nothing for this handle.
585
586is_readable = (1U << 0U), //!< If this handle is readable.
587is_writable = (1U << 1U), //!< If this handle is writable.
588is_errored = (1U << 2U), //!< If this handle is errored. This is always set in the output even if not requested.
589is_closed = (1U << 3U), //!< If this handle is closed/hung up. This is always set in the output even if not requested.
590
591not_pollable = (1U << 7U) //!< This handle is not pollable.
592} //

◆ QUICKCPPLIB_BITFIELD_BEGIN_T() [2/2]

llfio_v2_xxx::QUICKCPPLIB_BITFIELD_BEGIN_T ( tls_socket_source_implementation_features  ,
uint32_t   
)

Feature bits for TLS socket sources.

< No bits set

< This socket source provides kernel sockets i.e. their native handles will be valid kernel sockets which can be used in poll() etc

< This socket source is the "system" rather than "third party" implementation for TLS sockets

< This socket source provides an i/o multiplexer

< This socket source may be able to wrap third party plain sockets

< This socket source provides FIPS_140_2 compliant algorithms

< All bits set

310 {
311none = 0U, //!< No bits set
312
313kernel_sockets =
314(1U << 0U), //!< This socket source provides kernel sockets i.e. their native handles will be valid kernel sockets which can be used in `poll()` etc
315system_implementation = (1U << 1U), //!< This socket source is the "system" rather than "third party" implementation for TLS sockets
316io_multiplexer = (1U << 2U), //!< This socket source provides an i/o multiplexer
317supports_wrap = (1U << 3U), //!< This socket source may be able to wrap third party plain sockets
318
319FIPS_140_2 = (1U << 16U), //!< This socket source provides FIPS_140_2 compliant algorithms
320
321all = 0xffffffff //!< All bits set
322} //
@ FIPS_140_2
Definition tls_socket_handle.hpp:60

◆ read() [1/3]

byte_io_handle::io_result< byte_io_handle::buffers_type > llfio_v2_xxx::read ( byte_io_handle self,
byte_io_handle::io_request< byte_io_handle::buffers_type >  reqs,
deadline  d = deadline() 
)
inlinenoexcept

Read data from the open handle.

Warning
Depending on the implementation backend, very different buffers may be returned than you supplied. You should always use the buffers returned and assume that they point to different memory and that each buffer's size will have changed.
Returns
The buffers read, which may not be the buffers input. The size of each scatter-gather buffer is updated with the number of bytes of that buffer transferred, and the pointer to the data may be completely different to what was submitted (e.g. it may point into a memory map).
Parameters
selfThe object whose member function to call.
reqsA scatter-gather and offset request.
dAn optional deadline by which the i/o must complete, else it is cancelled. Note function may return significantly after this deadline if the i/o takes long to cancel.
Errors returnable\n Any of the values POSIX read() can return, errc::timed_out, errc::operation_canceled. errc::not_supported may be
returned if deadline i/o is not possible with this particular handle configuration (e.g. reading from regular files on POSIX or reading from a non-overlapped HANDLE on Windows).
Memory Allocations\n The default synchronous implementation in file_handle performs no memory allocation.
656{
657 return self.read(std::forward<decltype(reqs)>(reqs), std::forward<decltype(d)>(d));
658}
io_result< buffers_type > read(io_request< buffers_type > reqs, deadline d=deadline()) noexcept
Read data from the open handle, preferentially using any i/o multiplexer set over the virtually overr...
Definition byte_io_handle.hpp:297

◆ read() [2/3]

file_handle::io_result< file_handle::size_type > llfio_v2_xxx::read ( file_handle self,
file_handle::extent_type  offset,
std::initializer_list< file_handle::buffer_type lst,
deadline  d = deadline() 
)
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

499{
500 return self.read(std::forward<decltype(offset)>(offset), std::forward<decltype(lst)>(lst), std::forward<decltype(d)>(d));
501}

◆ read() [3/3]

map_handle::io_result< map_handle::buffers_type > llfio_v2_xxx::read ( map_handle self,
map_handle::io_request< map_handle::buffers_type >  reqs,
deadline  d = deadline() 
)
inlinenoexcept

Read data from the mapped view.

Note
Because this implementation never copies memory, you can pass in buffers with a null address.
Returns
The buffers read, which will never be the buffers input because they will point into the mapped view. The size of each scatter-gather buffer is updated with the number of bytes of that buffer transferred.
Parameters
selfThe object whose member function to call.
reqsA scatter-gather and offset request.
dIgnored.
Errors returnable\n None, though the various signals and structured exception throws common to using memory maps may occur.
Memory Allocations\n None.
1178{
1179 return self.read(std::forward<decltype(reqs)>(reqs), std::forward<decltype(d)>(d));
1180}
io_result< buffers_type > read(io_request< buffers_type > reqs, deadline d=deadline()) noexcept
Read data from the open handle, preferentially using any i/o multiplexer set over the virtually overr...
Definition byte_io_handle.hpp:297

◆ relink()

result< void > llfio_v2_xxx::relink ( fs_handle self,
const path_handle base,
fs_handle::path_view_type  path,
bool  atomic_replace = true,
deadline  d = std::chrono::seconds(30) 
)
inlinenoexcept

Relinks the current path of this open handle to the new path specified. If atomic_replace is true, the relink atomically and silently replaces any item at the new path specified. This operation is both atomic and silent matching POSIX behaviour even on Microsoft Windows where no Win32 API can match POSIX semantics.

Warning
Some operating systems provide a race free syscall for renaming an open handle (Windows). On all other operating systems this call is racy and can result in the wrong file entry being relinked. Note that unless flag::disable_safety_unlinks is set, this implementation opens a path_handle to the source containing directory first, then checks before relinking that the item about to be relinked has the same inode as the open file handle. It will retry this matching until success until the deadline given. This should prevent most unmalicious accidental loss of data.
Parameters
selfThe object whose member function to call.
baseBase for any relative path.
pathThe relative or absolute new path to relink to.
atomic_replaceAtomically replace the destination if a file entry already is present there. Choosing false for this will fail if a file entry is already present at the destination, and may not be an atomic operation on some platforms (i.e. both the old and new names may be linked to the same inode for a very short period of time). Windows and recent Linuxes are always atomic.
dThe deadline by which the matching of the containing directory to the open handle's inode must succeed, else errc::timed_out will be returned.
Memory Allocations\n Except on platforms with race free syscalls for renaming open handles (Windows), calls
current_path() via parent_path_handle() and thus is both expensive and calls malloc many times.
543{
544 return self.relink(std::forward<decltype(base)>(base), std::forward<decltype(path)>(path), std::forward<decltype(atomic_replace)>(atomic_replace),
545 std::forward<decltype(d)>(d));
546}
virtual result< void > relink(const path_handle &base, path_view_type path, bool atomic_replace=true, deadline d=std::chrono::seconds(30)) noexcept
Relinks the current path of this open handle to the new path specified. If atomic_replace is true,...

◆ section() [1/3]

result< section_handle > llfio_v2_xxx::section ( file_handle backing,
section_handle::extent_type  bytes = 0 
)
inlinenoexcept

Create a memory section backed by a file.

Parameters
backingThe handle to use as backing storage.
bytesThe initial size of this section, which cannot be larger than any backing file. Zero means to use backing.maximum_extent().

This convenience overload create a writable section if the backing file is writable, otherwise a read-only section.

Errors returnable\n Any of the values POSIX dup(), open() or NtCreateSection() can return.
1055{
1056 return section_handle::section(std::forward<decltype(backing)>(backing), std::forward<decltype(bytes)>(bytes));
1057}

◆ section() [2/3]

result< section_handle > llfio_v2_xxx::section ( file_handle backing,
section_handle::extent_type  maximum_size,
section_handle::flag  _flag 
)
inlinenoexcept

Create a memory section backed by a file.

Parameters
backingThe handle to use as backing storage.
maximum_sizeThe initial size of this section, which cannot be larger than any backing file. Zero means to use backing.maximum_extent().
_flagHow to create the section.
Errors returnable\n Any of the values POSIX dup(), open() or NtCreateSection() can return.
1042{
1043 return section_handle::section(std::forward<decltype(backing)>(backing), std::forward<decltype(maximum_size)>(maximum_size),
1044 std::forward<decltype(_flag)>(_flag));
1045}

◆ section() [3/3]

result< section_handle > llfio_v2_xxx::section ( section_handle::extent_type  bytes,
const path_handle dirh = path_discovery::storage_backed_temporary_files_directory(),
section_handle::flag  _flag = section_handle::flag::read | section_handle::flag::write 
)
inlinenoexcept

Create a memory section backed by an anonymous, managed file.

Parameters
bytesThe initial size of this section. Cannot be zero.
dirhWhere to create the anonymous, managed file.
_flagHow to create the section.
Errors returnable\n Any of the values POSIX dup(), open() or NtCreateSection() can return.
1067{
1068 return section_handle::section(std::forward<decltype(bytes)>(bytes), std::forward<decltype(dirh)>(dirh), std::forward<decltype(_flag)>(_flag));
1069}

◆ swap() [1/6]

void llfio_v2_xxx::swap ( directory_handle self,
directory_handle o 
)
inlinenoexcept

Swap with another instance.

457{
458 return self.swap(std::forward<decltype(o)>(o));
459}
void swap(directory_handle &o) noexcept
Swap with another instance.
Definition directory_handle.hpp:293

◆ swap() [2/6]

void llfio_v2_xxx::swap ( file_handle self,
file_handle o 
)
inlinenoexcept

Swap with another instance.

421{
422 return self.swap(std::forward<decltype(o)>(o));
423}
void swap(file_handle &o) noexcept
Swap with another instance.
Definition file_handle.hpp:145

◆ swap() [3/6]

void llfio_v2_xxx::swap ( handle self,
handle o 
)
inlinenoexcept

Swap with another instance.

675{
676 return self.swap(std::forward<decltype(o)>(o));
677}
void swap(handle &o) noexcept
Swap with another instance.
Definition handle.hpp:256

◆ swap() [4/6]

void llfio_v2_xxx::swap ( map_handle self,
map_handle o 
)
inlinenoexcept

Swap with another instance.

1088{
1089 return self.swap(std::forward<decltype(o)>(o));
1090}
void swap(map_handle &o) noexcept
Swap with another instance.
Definition map_handle.hpp:562

◆ swap() [5/6]

void llfio_v2_xxx::swap ( mapped_file_handle self,
mapped_file_handle o 
)
inlinenoexcept

Swap with another instance.

800{
801 return self.swap(std::forward<decltype(o)>(o));
802}
void swap(mapped_file_handle &o) noexcept
Swap with another instance.
Definition mapped_file_handle.hpp:386

◆ swap() [6/6]

void llfio_v2_xxx::swap ( section_handle self,
section_handle o 
)
inlinenoexcept

Swap with another instance.

1031{
1032 return self.swap(std::forward<decltype(o)>(o));
1033}
void swap(section_handle &o) noexcept
Swap with another instance.
Definition map_handle.hpp:136

◆ temp_directory()

result< directory_handle > llfio_v2_xxx::temp_directory ( directory_handle::path_view_type  name = directory_handle::path_view_type(),
directory_handle::mode  _mode = directory_handle::mode::write,
directory_handle::creation  _creation = directory_handle::creation::if_needed,
directory_handle::caching  _caching = directory_handle::caching::all,
directory_handle::flag  flags = directory_handle::flag::none 
)
inlinenoexcept

Create a directory handle creating the named directory on some path which the OS declares to be suitable for temporary files. Note also that an empty name is equivalent to calling uniquely_named_file(path_discovery::storage_backed_temporary_files_directory()) and the creation parameter is ignored.

Errors returnable\n Any of the values POSIX open() or CreateFile() can return.
500{
501 return directory_handle::temp_directory(std::forward<decltype(name)>(name), std::forward<decltype(_mode)>(_mode),
502 std::forward<decltype(_creation)>(_creation), std::forward<decltype(_caching)>(_caching),
503 std::forward<decltype(flags)>(flags));
504}

◆ temp_file()

result< file_handle > llfio_v2_xxx::temp_file ( file_handle::path_view_type  name = file_handle::path_view_type(),
file_handle::mode  _mode = file_handle::mode::write,
file_handle::creation  _creation = file_handle::creation::if_needed,
file_handle::caching  _caching = file_handle::caching::temporary,
file_handle::flag  flags = file_handle::flag::unlink_on_first_close 
)
inlinenoexcept

Create a file handle creating the named file on some path which the OS declares to be suitable for temporary files. Most OSs are very lazy about flushing changes made to these temporary files. Note the default flags are to have the newly created file deleted on first handle close. Note also that an empty name is equivalent to calling uniquely_named_file(path_discovery::storage_backed_temporary_files_directory()) and the creation parameter is ignored.

Note
If the temporary file you are creating is not going to have its path sent to another process for usage, this is the WRONG function to use. Use temp_inode() instead, it is far more secure.
Errors returnable\n Any of the values POSIX open() or CreateFile() can return.
475{
476 return file_handle::temp_file(std::forward<decltype(name)>(name), std::forward<decltype(_mode)>(_mode), std::forward<decltype(_creation)>(_creation),
477 std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
478}

◆ temp_inode()

result< file_handle > llfio_v2_xxx::temp_inode ( const path_handle dirh = path_discovery::storage_backed_temporary_files_directory(),
file_handle::mode  _mode = file_handle::mode::write,
file_handle::caching  _caching = file_handle::caching::temporary,
file_handle::flag  flags = file_handle::flag::none 
)
inlinenoexcept

Securely create a file handle creating a temporary anonymous inode in the filesystem referred to by dirpath. The inode created has no name nor accessible path on the filing system and ceases to exist as soon as the last handle is closed, making it ideal for use as a temporary file where other processes do not need to have access to its contents via some path on the filing system (a classic use case is for backing shared memory maps).

Errors returnable\n Any of the values POSIX open() or CreateFile() can return.
492{
493 return file_handle::temp_inode(std::forward<decltype(dirh)>(dirh), std::forward<decltype(_mode)>(_mode), std::forward<decltype(_caching)>(_caching),
494 std::forward<decltype(flags)>(flags));
495}

◆ to_win32_path() [1/2]

result< filesystem::path > llfio_v2_xxx::to_win32_path ( const fs_handle h,
win32_path_namespace  mapping = win32_path_namespace::any 
)
inlinenoexcept

Maps the current path of h into a form suitable for Win32 APIs. Passes through unmodified on POSIX, so you can use this in portable code.

Returns
The mapped current path of h, which may have been validated to refer to the exact same inode via .unique_id() (see below).
Parameters
hThe handle whose .current_path() is to be mapped into a form suitable for Win32 APIs.
mappingWhich Win32 path namespace to map onto.

This implementation may need to validate that the mapping of the current path of h onto the desired Win32 path namespace does indeed refer to the same file:

  • win32_path_namespace::device transforms \!!\Device\... => \\.\... and ensures that the mapped file's unique id matches the original, otherwise returning failure.
  • win32_path_namespace::dos enumerates all the DOS devices on the system and what those map onto within the NT kernel namespace. This mapping is for obvious reasons quite slow.
  • win32_path_namespace::guid_volume simply fetches the GUID of the volume of the handle, and constructs a valid Win32 path from that.
  • win32_path_namespace::any means attempt guid_volume first, and if it fails (e.g. your file is on a network share) then it attempts dos. This semantic may change in the future, however any path emitted will always be a valid Win32 path.
145 {
146 (void) mapping;
147 return h._get_handle().current_path();
148 }

◆ to_win32_path() [2/2]

template<class T , typename std::enable_if<(!std::is_base_of< fs_handle, T >::value &&std::is_base_of< handle, T >::value), bool >::type = true>
result< filesystem::path > llfio_v2_xxx::to_win32_path ( const T &  h,
win32_path_namespace  mapping = win32_path_namespace::any 
)
inlinenoexcept
128{
129 (void) mapping;
130 return h.current_path();
131}

◆ truncate() [1/3]

result< file_handle::extent_type > llfio_v2_xxx::truncate ( file_handle self,
file_handle::extent_type  newsize 
)
inlinenoexcept

Resize the current maximum permitted extent of the file to the given extent, avoiding any new allocation of physical storage where supported. Note that on extents based filing systems this will succeed even if there is insufficient free space on the storage medium.

Returns
The bytes actually truncated to.
Parameters
selfThe object whose member function to call.
newsizeThe bytes to truncate the file to.
Errors returnable\n Any of the values POSIX ftruncate() or SetFileInformationByHandle() can return.
520{
521 return self.truncate(std::forward<decltype(newsize)>(newsize));
522}
virtual result< extent_type > truncate(extent_type newsize) noexcept

◆ truncate() [2/3]

result< map_handle::size_type > llfio_v2_xxx::truncate ( map_handle self,
map_handle::size_type  newsize,
bool  permit_relocation = false 
)
inlinenoexcept

Resize the reservation of the memory map without changing the address (unless the map was zero sized, in which case a new address will be chosen).

If shrinking, address space is released on POSIX, and on Windows if the new size is zero. If the new size is zero, the address is set to null to prevent surprises. Windows does not support modifying existing mapped regions, so if the new size is not zero, the call will probably fail. Windows should let you truncate a previous extension however, if it is exact.

If expanding, an attempt is made to map in new reservation immediately after the current address reservation, thus extending the reservation. If anything else is mapped in after the current reservation, the function fails.

Note
On all supported platforms apart from OS X, proprietary flags exist to avoid performing a map if a map extension cannot be immediately placed after the current map. On OS X, we hint where we'd like the new map to go, but if something is already there OS X will place the map elsewhere. In this situation, we delete the new map and return failure, which is inefficient, but there is nothing else we can do.
Returns
The bytes actually reserved.
Parameters
selfThe object whose member function to call.
newsizeThe bytes to truncate the map reservation to. Rounded up to the nearest page size (POSIX) or 64Kb on Windows.
permit_relocationPermit the address to change (some OSs provide a syscall for resizing a memory map).
Errors returnable\n Any of the values POSIX mremap(), mmap(addr) or VirtualAlloc(addr) can return.
1161{
1162 return self.truncate(std::forward<decltype(newsize)>(newsize), std::forward<decltype(permit_relocation)>(permit_relocation));
1163}
result< size_type > truncate(size_type newsize, bool permit_relocation) noexcept

◆ truncate() [3/3]

result< section_handle::extent_type > llfio_v2_xxx::truncate ( section_handle self,
section_handle::extent_type  newsize = 0 
)
inlinenoexcept

Resize the current maximum permitted extent of the memory section to the given extent.

Parameters
selfThe object whose member function to call.
newsizeThe new size of the memory section, which cannot be zero. Specify zero to use backing.maximum_extent(). This cannot exceed the size of any backing file used if that file is not writable.
Errors returnable\n Any of the values NtExtendSection() or ftruncate() can return.
1083{
1084 return self.truncate(std::forward<decltype(newsize)>(newsize));
1085}
result< extent_type > truncate(extent_type newsize=0) noexcept

◆ uniquely_named_directory()

result< directory_handle > llfio_v2_xxx::uniquely_named_directory ( const path_handle dirpath,
directory_handle::mode  _mode = directory_handle::mode::write,
directory_handle::caching  _caching = directory_handle::caching::temporary,
directory_handle::flag  flags = directory_handle::flag::none 
)
inlinenoexcept

Create a directory handle creating a randomly named file on a path. The file is opened exclusively with creation::only_if_not_exist so it will never collide with nor overwrite any existing entry.

Errors returnable\n Any of the values POSIX open() or CreateFile() can return.
483{
484 return directory_handle::uniquely_named_directory(std::forward<decltype(dirpath)>(dirpath), std::forward<decltype(_mode)>(_mode),
485 std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
486}

◆ uniquely_named_file()

result< file_handle > llfio_v2_xxx::uniquely_named_file ( const path_handle dirpath,
file_handle::mode  _mode = file_handle::mode::write,
file_handle::caching  _caching = file_handle::caching::temporary,
file_handle::flag  flags = file_handle::flag::none 
)
inlinenoexcept

Create a file handle creating a randomly named file on a path. The file is opened exclusively with creation::only_if_not_exist so it will never collide with nor overwrite any existing file. Note also that caching defaults to temporary which hints to the OS to only flush changes to physical storage as lately as possible.

Errors returnable\n Any of the values POSIX open() or CreateFile() can return.
452{
453 return file_handle::uniquely_named_file(std::forward<decltype(dirpath)>(dirpath), std::forward<decltype(_mode)>(_mode),
454 std::forward<decltype(_caching)>(_caching), std::forward<decltype(flags)>(flags));
455}

◆ unlink()

result< void > llfio_v2_xxx::unlink ( fs_handle self,
deadline  d = std::chrono::seconds(30) 
)
inlinenoexcept

Unlinks the current path of this open handle, causing its entry to immediately disappear from the filing system. On Windows unless flag::win_disable_unlink_emulation is set, this behaviour is simulated by renaming the file to something random and setting its delete-on-last-close flag. Note that Windows may prevent the renaming of a file in use by another process, if so it will NOT be renamed. After the next handle to that file closes, it will become permanently unopenable by anyone else until the last handle is closed, whereupon the entry will be eventually removed by the operating system.

Warning
Some operating systems provide a race free syscall for unlinking an open handle (Windows). On all other operating systems this call is racy and can result in the wrong file entry being unlinked. Note that unless flag::disable_safety_unlinks is set, this implementation opens a path_handle to the containing directory first, then checks that the item about to be unlinked has the same inode as the open file handle. It will retry this matching until success until the deadline given. This should prevent most unmalicious accidental loss of data.
Parameters
selfThe object whose member function to call.
dThe deadline by which the matching of the containing directory to the open handle's inode must succeed, else errc::timed_out will be returned.
Memory Allocations\n Except on platforms with race free syscalls for unlinking open handles (Windows), calls
current_path() and thus is both expensive and calls malloc many times. On Windows, also calls current_path() if flag::disable_safety_unlinks is not set.
571{
572 return self.unlink(std::forward<decltype(d)>(d));
573}
virtual result< void > unlink(deadline d=std::chrono::seconds(30)) noexcept
Unlinks the current path of this open handle, causing its entry to immediately disappear from the fil...

◆ visit() [1/2]

template<class F >
constexpr auto llfio_v2_xxx::visit ( F &&  f,
path_view_component  view 
)
inlineconstexpr

Visit the underlying source for a path_view_component (std compatible overload)

1835{
1836 return view._invoke(static_cast<F &&>(f));
1837}

◆ visit() [2/2]

template<class F >
constexpr auto llfio_v2_xxx::visit ( path_view_component  view,
F &&  f 
)
inlineconstexpr

Visit the underlying source for a path_view_component (LLFIO backwards compatible overload)

1830{
1831 return view._invoke(static_cast<F &&>(f));
1832}

◆ write() [1/3]

byte_io_handle::io_result< byte_io_handle::size_type > llfio_v2_xxx::write ( byte_io_handle self,
byte_io_handle::extent_type  offset,
std::initializer_list< byte_io_handle::const_buffer_type lst,
deadline  d = deadline() 
)
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

688{
689 return self.write(std::forward<decltype(offset)>(offset), std::forward<decltype(lst)>(lst), std::forward<decltype(d)>(d));
690}
io_result< const_buffers_type > write(io_request< const_buffers_type > reqs, deadline d=deadline()) noexcept
Write data to the open handle, preferentially using any i/o multiplexer set over the virtually overri...
Definition byte_io_handle.hpp:345

◆ write() [2/3]

byte_io_handle::io_result< byte_io_handle::const_buffers_type > llfio_v2_xxx::write ( byte_io_handle self,
byte_io_handle::io_request< byte_io_handle::const_buffers_type >  reqs,
deadline  d = deadline() 
)
inlinenoexcept

Write data to the open handle.

Warning
Depending on the implementation backend, not all of the buffers input may be written and the some buffers at the end of the returned buffers may return with zero bytes written. For example, with a zeroed deadline, some backends may only consume as many buffers as the system has available write slots for, thus for those backends this call is "non-blocking" in the sense that it will return immediately even if it could not schedule a single buffer write. Another example is that some implementations will not auto-extend the length of a file when a write exceeds the maximum extent, you will need to issue a truncate(newsize) first.
Returns
The buffers written, which may not be the buffers input. The size of each scatter-gather buffer is updated with the number of bytes of that buffer transferred.
Parameters
selfThe object whose member function to call.
reqsA scatter-gather and offset request.
dAn optional deadline by which the i/o must complete, else it is cancelled. Note function may return significantly after this deadline if the i/o takes long to cancel.
Errors returnable\n Any of the values POSIX write() can return, errc::timed_out, errc::operation_canceled. errc::not_supported may be
returned if deadline i/o is not possible with this particular handle configuration (e.g. writing to regular files on POSIX or writing to a non-overlapped HANDLE on Windows).
Memory Allocations\n The default synchronous implementation in file_handle performs no memory allocation.
682{
683 return self.write(std::forward<decltype(reqs)>(reqs), std::forward<decltype(d)>(d));
684}

◆ write() [3/3]

map_handle::io_result< map_handle::const_buffers_type > llfio_v2_xxx::write ( map_handle self,
map_handle::io_request< map_handle::const_buffers_type >  reqs,
deadline  d = deadline() 
)
inlinenoexcept

Write data to the mapped view.

Returns
The buffers written, which will never be the buffers input because they will point at where the data was copied into the mapped view. The size of each scatter-gather buffer is updated with the number of bytes of that buffer transferred.
Parameters
selfThe object whose member function to call.
reqsA scatter-gather and offset request.
dIgnored.
Errors returnable\n None, though the various signals and structured exception throws common to using memory maps may occur.
Memory Allocations\n None.
1193{
1194 return self.write(std::forward<decltype(reqs)>(reqs), std::forward<decltype(d)>(d));
1195}
io_result< const_buffers_type > write(io_request< const_buffers_type > reqs, deadline d=deadline()) noexcept
Write data to the open handle, preferentially using any i/o multiplexer set over the virtually overri...
Definition byte_io_handle.hpp:345

◆ zero()

result< file_handle::extent_type > llfio_v2_xxx::zero ( file_handle self,
file_handle::extent_type  offset,
file_handle::extent_type  bytes,
deadline  d = deadline() 
)
inlinenoexcept

Efficiently zero, and possibly deallocate, data on storage.

On most major operating systems and with recent filing systems which are "extents based", one can deallocate the physical storage of a file, causing the space deallocated to appear all bits zero. This call attempts to deallocate whole pages (usually 4Kb) entirely, and memset's any excess to all bits zero. This call works on most Linux filing systems with a recent kernel, Microsoft Windows with NTFS, and FreeBSD with ZFS. On other systems it simply writes zeros.

Returns
The bytes zeroed.
Parameters
selfThe object whose member function to call.
offsetThe offset to start zeroing from.
bytesThe number of bytes to zero.
dAn optional deadline by which the i/o must complete, else it is cancelled. Note function may return significantly after this deadline if the i/o takes long to cancel.
Errors returnable\n Any of the values POSIX write() can return, errc::timed_out, errc::operation_canceled. errc::not_supported may be
returned if deadline i/o is not possible with this particular handle configuration (e.g. writing to regular files on POSIX or writing to a non-overlapped HANDLE on Windows).
Memory Allocations\n The default synchronous implementation in file_handle performs no memory allocation.
550{
551 return self.zero(std::forward<decltype(offset)>(offset), std::forward<decltype(bytes)>(bytes), std::forward<decltype(d)>(d));
552}
virtual result< extent_type > zero(extent_pair extent, deadline d=deadline()) noexcept
Efficiently zero, and possibly deallocate, data on storage.