Expand description
Native FFI bindings to libsplinter,
persistent variant (splinter_p, built with SPLINTER_PERSISTENT).
This is a -sys crate: it exposes the raw, auto-generated C ABI and nothing
more. The vendored C sources are compiled from source by the build script,
so no system installation of libsplinter is required. Bindings are generated
with bindgen at build time and written to OUT_DIR.
Structs§
- __
fsid_ t - atomic_
flag - max_
align_ t - splinter_
event_ bus - @brief Event bus for kernel-assisted epoch-change notifications via eventfd.
- splinter_
header - @struct splinter_header @brief Defines the header structure for the shared memory region.
- splinter_
header_ snapshot - @struct splinter_header_snapshot @brief structure to hold splinter bus snapshots
- splinter_
shard_ bid - @brief One cooperative-memory-scheduling bid. 32 of these live in the header. Packed to ~32 bytes so all 32 fit in ~1 KB (intentionally NOT individually cache-line aligned: claims/releases are rare and elections are read-only, so false sharing on this table is a non-issue, and the thesis budgets ~1 KB, not 2 KB).
- splinter_
shard_ bid_ snapshot - @struct splinter_shard_bid_snapshot @brief Non-atomic mirror of a single bid slot for inspection/audit.
- splinter_
signal_ node - @brief Individual signal lane, aligned to prevent false sharing.
- splinter_
slot - @struct splinter_slot @brief Defines a single key-value slot in the hash table.
- splinter_
slot_ snapshot - @structure splinter_slot_snapshot @brief A structure to hold a snapshot of a single slot
Constants§
- INT8_
MAX - INT8_
MIN - INT16_
MAX - INT16_
MIN - INT32_
MAX - INT32_
MIN - INTPTR_
MAX - INTPTR_
MIN - INT_
FAST8_ MAX - INT_
FAST8_ MIN - INT_
FAST16_ MAX - INT_
FAST16_ MIN - INT_
FAST32_ MAX - INT_
FAST32_ MIN - INT_
LEAS T8_ MAX - INT_
LEAS T8_ MIN - INT_
LEAS T16_ MAX - INT_
LEAS T16_ MIN - INT_
LEAS T32_ MAX - INT_
LEAS T32_ MIN - NS_
PER_ MS - PTRDIFF_
MAX - PTRDIFF_
MIN - SIG_
ATOMIC_ MAX - SIG_
ATOMIC_ MIN - SIZE_
MAX - SPLINTER_
EVENT_ BUS_ MASK_ WORDS - SPLINTER_
KEY_ MAX - SPLINTER_
MAGIC - SPLINTER_
MAX_ GROUPS - SPLINTER_
MAX_ SHARDS - SPLINTER_
MAX_ SLOTS - SPLINTER_
VER - SPL_
FUSR1 - SPL_
FUSR2 - SPL_
FUSR3 - SPL_
FUSR4 - SPL_
FUSR5 - SPL_
FUSR6 - SPL_
FUSR7 - SPL_
FUSR8 - SPL_
ORDER_ ACCESSOR - SPL_
SLOT_ DEFAULT_ TYPE - SPL_
SLOT_ TYPE_ AUDIO - SPL_
SLOT_ TYPE_ BIGINT - SPL_
SLOT_ TYPE_ BIGUINT - SPL_
SLOT_ TYPE_ BINARY - SPL_
SLOT_ TYPE_ IMGDATA - SPL_
SLOT_ TYPE_ JSON - SPL_
SLOT_ TYPE_ VARTEXT - SPL_
SLOT_ TYPE_ VOID - SPL_
SUSR1 - SPL_
SUSR2 - SPL_
SUSR3 - SPL_
SUSR4 - SPL_
SYS_ AUTO_ SCRUB - SPL_
SYS_ HYBRID_ SCRUB - SPL_
SYS_ RESERVED_ 2 - SPL_
SYS_ RESERVED_ 3 - SPL_
TIME_ ATIME - SPL_
TIME_ CTIME - UINT8_
MAX - UINT16_
MAX - UINT32_
MAX - UINTPTR_
MAX - UINT_
FAST8_ MAX - UINT_
FAST16_ MAX - UINT_
FAST32_ MAX - UINT_
LEAS T8_ MAX - UINT_
LEAS T16_ MAX - UINT_
LEAS T32_ MAX - WINT_
MAX - WINT_
MIN - _ATFILE_
SOURCE - _BITS_
STDINT_ INTN_ H - _BITS_
STDINT_ LEAST_ H - _BITS_
STDINT_ UINTN_ H - _BITS_
TIME64_ H - _BITS_
TYPESIZES_ H - _BITS_
TYPES_ H - _BITS_
WCHAR_ H - _DEFAULT_
SOURCE - _FEATURES_
H - _POSIX_
C_ SOURCE - _POSIX_
SOURCE - _STDC_
PREDEF_ H - _STDINT_
H - _SYS_
CDEFS_ H - __
FD_ SETSIZE - __
GLIBC_ MINOR__ - __
GLIBC_ USE_ C2X_ STRTOL - __
GLIBC_ USE_ DEPRECATED_ GETS - __
GLIBC_ USE_ DEPRECATED_ SCANF - __
GLIBC_ USE_ IEC_ 60559_ BFP_ EXT - __
GLIBC_ USE_ IEC_ 60559_ BFP_ EXT_ C2X - __
GLIBC_ USE_ IEC_ 60559_ EXT - __
GLIBC_ USE_ IEC_ 60559_ FUNCS_ EXT - __
GLIBC_ USE_ IEC_ 60559_ FUNCS_ EXT_ C2X - __
GLIBC_ USE_ IEC_ 60559_ TYPES_ EXT - __
GLIBC_ USE_ ISOC2X - __
GLIBC_ USE_ LIB_ EXT2 - __
GLIBC__ - __
GNU_ LIBRARY__ - __
HAVE_ GENERIC_ SELECTION - __
INO_ T_ MATCHES_ INO64_ T - __
KERNEL_ OLD_ TIMEVAL_ MATCHES_ TIMEVA L64 - __
LDOUBLE_ REDIRECTS_ TO_ FLOA T128_ ABI - __
OFF_ T_ MATCHES_ OFF64_ T - __
RLIM_ T_ MATCHES_ RLIM64_ T - __
STATFS_ MATCHES_ STATF S64 - __
STDC_ IEC_ 559_ COMPLEX__ - __
STDC_ IEC_ 559__ - __
STDC_ IEC_ 60559_ BFP__ - __
STDC_ IEC_ 60559_ COMPLEX__ - __
STDC_ ISO_ 10646__ - __
SYSCALL_ WORDSIZE - __
TIMESIZE - __
USE_ ATFILE - __
USE_ FORTIFY_ LEVEL - __
USE_ ISOC11 - __
USE_ ISOC95 - __
USE_ ISOC99 - __
USE_ MISC - __
USE_ POSIX - __
USE_ POSI X2 - __
USE_ POSI X199309 - __
USE_ POSI X199506 - __
USE_ POSIX_ IMPLICITLY - __
USE_ XOPE N2K - __
USE_ XOPE N2K8 - __
WORDSIZE - __
WORDSIZE_ TIME64_ COMPA T32 - __
alignas_ is_ defined - __
alignof_ is_ defined - __
glibc_ c99_ flexarr_ available - memory_
order_ memory_ order_ acq_ rel - memory_
order_ memory_ order_ acquire - memory_
order_ memory_ order_ consume - memory_
order_ memory_ order_ relaxed - memory_
order_ memory_ order_ release - memory_
order_ memory_ order_ seq_ cst - splinter_
integer_ op_ t_ SPL_ OP_ AND - splinter_
integer_ op_ t_ SPL_ OP_ DEC - splinter_
integer_ op_ t_ SPL_ OP_ INC - splinter_
integer_ op_ t_ SPL_ OP_ NOT - splinter_
integer_ op_ t_ SPL_ OP_ OR - splinter_
integer_ op_ t_ SPL_ OP_ XOR - splinter_
intent_ t_ SPL_ INTENT_ DONTNEED - splinter_
intent_ t_ SPL_ INTENT_ NONE - splinter_
intent_ t_ SPL_ INTENT_ RANDOM - splinter_
intent_ t_ SPL_ INTENT_ SEQUENTIAL - splinter_
intent_ t_ SPL_ INTENT_ WILLNEED
Functions§
- atomic_
flag_ ⚠clear - atomic_
flag_ ⚠clear_ explicit - atomic_
flag_ ⚠test_ and_ set - atomic_
flag_ ⚠test_ and_ set_ explicit - atomic_
signal_ ⚠fence - atomic_
thread_ ⚠fence - splinter_
append ⚠ - @brief Appends data to an existing key’s value in-place. @param key The null-terminated key string. @param data Pointer to the data to append. @param data_len Number of bytes to append. @param new_len Output: set to the new total value length on success. May be NULL. @return 0 on success, -1 if key not found or overflow, -2 if args invalid.
- splinter_
bump_ ⚠slot - @brief Advance the epoch of a slot without otherwise doing work Useful in conjunction with labeling for automation to fire. @param key Current key name associated with the slot.
- splinter_
client_ ⚠set_ tandem - @brief Client-side helper to write multiple orders of a key. This helper manages the naming convention for the caller. It uses a temporary array to copy the “victim” keys. @param base_key The main key (e.g. car) @param vals An array of values from keys that will be merged in @param lens An array of lengths corresponding with vals @param orders How many tandems to create @return 0 on success, -1 on failure, -2 if underlying basic I/O calls fail
- splinter_
client_ ⚠unset_ tandem - @brief Client-side helper to delete a key and its known orders.
- splinter_
close ⚠ - @brief Closes the splinter store and unmaps the shared memory region.
- splinter_
config_ ⚠clear - @brief Clear a bus configuration value @param hdr: a splinter bus header structure @param mask: bitmask to clear
- splinter_
config_ ⚠set - @brief Set a bus configuration value @param hdr: a splinter bus header structure @param mask: bitmask to apply
- splinter_
config_ ⚠snapshot - @brief Snapshot a bus configuration @param hdr: a splinter bus header structure
- splinter_
config_ ⚠test - @brief Test a bus configuration value @param hdr: a splinter bus header structure @param mask: bitmask to test
- splinter_
create ⚠ - @brief Creates and initializes a new splinter store. @param name_or_path The name of the shared memory object or path to the file. @param slots The total number of key-value slots to allocate. @param max_value_sz The maximum size in bytes for any single value. @return 0 on success, -1 on failure (e.g., store already exists). @note Creation is exclusive (O_EXCL): if a store of the same name/path already exists this fails (errno EEXIST) rather than adopting or reinitializing it. In persistent mode the path is also opened O_NOFOLLOW, so a symlink planted at that path is refused. Use splinter_open() to attach to an existing store, or splinter_create_or_open() to do either. @note The store is created with mode 0666 masked by the process umask, so by default it inherits the shell’s umask (often world-readable on GNU systems). Set SPLINTER_DEFAULT_UMASK in the environment to an octal mask (e.g. “077” for a private 0600 store) to override this at creation time; adjust further with chmod afterward. Applies to persistent mode too.
- splinter_
create_ ⚠or_ open - @brief Creates a new splinter store, or opens it if it already exists. @param name_or_path The name of the shared memory object or path to the file. @param slots The total number of key-value slots if creating. @param max_value_sz The maximum value size in bytes if creating. @return 0 on success, -1 on failure.
- splinter_
enumerate_ ⚠matches - @brief Iterates through all slots matching a bloom mask. @param mask The bloom mask to match against. @param callback Function to call for each match. @param user_data Opaque pointer for the callback.
- splinter_
event_ ⚠bus_ close - @brief Close a fd obtained from splinter_event_bus_open(). @param fd The fd to close.
- splinter_
event_ ⚠bus_ get_ dirty - @brief Copy a snapshot of the dirty-slot bitmask into caller-supplied storage.
- splinter_
event_ ⚠bus_ init - @brief Initialize the event bus (owner process only).
- splinter_
event_ ⚠bus_ open - @brief Open a process-local read fd to the owner’s eventfd.
- splinter_
event_ ⚠bus_ wait - @brief Block until the global epoch changes or the timeout expires.
- splinter_
get ⚠ - @brief Retrieves the value associated with a key. @param key The null-terminated key string. @param buf The buffer to copy the value data into. Can be NULL to query size. @param buf_sz The size of the provided buffer. @param out_sz Pointer to a size_t to store the value’s actual length. Can be NULL. @return 0 on success, -1 on failure. If buf_sz is too small, sets errno to EMSGSIZE.
- splinter_
get_ ⚠epoch - @brief Get the current epoch of a specific slot. @return The 64-bit epoch, or 0 if key not found.
- splinter_
get_ ⚠header_ snapshot - @brief Copy the current atomic Splinter header structure into a corresponding non-atomic client version. @param snapshot A splinter_header_snaphshot_t structure to receive the values. @return -1 on failure, 0 on success.
- splinter_
get_ ⚠mop - @brief Get the current “mop mode” @return 0 = off, 1 = hybrid, 2 = full boil. -2 = no store.
- splinter_
get_ ⚠raw_ ptr - @brief Get a direct pointer to a value in shared memory. @warning Unsafe: The data at this pointer can change or be zeroed if a writer modifies the slot. Use splinter_get_epoch to verify consistency. @param key The key to look up. @param out_sz Pointer to receive the actual length of the value. @param out_epoch Pointer to receive the epoch at the time of lookup. @return A const pointer to the data in SHM, or NULL if not found.
- splinter_
get_ ⚠signal_ count - @brief Safely retrieve the current pulse count for a signal group. Good for debugging. @param group_id The signal group (0-63). @return The 64-bit pulse count, or 0 if invalid.
- splinter_
get_ ⚠slot_ snapshot - @brief Copy the current atomic Splinter slot header to a corresponding client structure. @param snapshot A splinter_slot_snaphshot_t structure to receive the values. @return -1 on failure, 0 on success.
- splinter_
integer_ ⚠op - @brief Bitwise & arithmetic ops on keys named as big unsigned @param key Name of the key to operate on @param op Operation you want to do @param mask What you want to do it with @return 0 on success, -1 / -2 on internal / caller errors respectively
- splinter_
list ⚠ - @brief Lists all keys currently in the store.
@param out_keys An array of
char*to be filled with pointers to the keys. @param max_keys The maximum number of keys to write toout_keys. @param out_count Pointer to a size_t to store the number of keys found. @return 0 on success, -1 on failure. - splinter_
madvise ⚠ - @brief Cooperative posix_madvise(): the voluntary-yield entry point.
- splinter_
open ⚠ - @brief Opens an existing splinter store. @param name_or_path The name of the shared memory object or path to the file. @return 0 on success, -1 on failure (e.g., store does not exist).
- splinter_
open_ ⚠or_ create - @brief Opens an existing splinter store, or creates it if it does not exist. @param name_or_path The name of the shared memory object or path to the file. @param slots The total number of key-value slots if creating. @param max_value_sz The maximum value size in bytes if creating. @return 0 on success, -1 on failure.
- splinter_
poll ⚠ - @brief Waits for a key’s value to be changed. @param key The key to monitor for changes. @param timeout_ms The maximum time to wait in milliseconds. @return 0 if the value changed, -1 on timeout or if the key doesn’t exist.
- splinter_
pulse_ ⚠keygroup - @brief Pulse a key group by one of its members (if known) @param key string key to find @return 0 on success, -2 on system failure, -1 if key is not found
- splinter_
pulse_ ⚠watchers - @brief Internal helper to pulse the Signal Arena for a slot. @param slot pointer to a splinter_slot structure
- splinter_
purge ⚠ - @brief Check each key, and zero out memory past the value length to the allocated slot length (essentially sweep out any old data). Designed to be used as part of backfill runs when I/O slamming has stopped.
- splinter_
retrain_ ⚠slot - @brief Reset a slot for retraining: scrub its vectors and republish.
- splinter_
set ⚠ - @brief Sets or updates a key-value pair in the store.
@param key The null-terminated key string.
@param val Pointer to the value data.
@param len The length of the value data. Must not exceed
max_val_sz. @return 0 on success, -1 on failure (e.g., store is full). - splinter_
set_ ⚠as_ system - @brief Promotes a key to “system” usage @param key the key to scope
- splinter_
set_ ⚠label - @brief Atomically apply a label mask to a slot’s Bloom filter. @return 0 on success, -1 if key not found.
- splinter_
set_ ⚠mop - @brief Control Splinter’s mop mode. @param unsigned mode: 0 = off, 1 = hybrid, 2 = full boil. @return 0 on success, -1 on invalid mode, -2 if something is wrong with the store This will replace all _av() functions.
- splinter_
set_ ⚠named_ type - @brief Name (declare intent to) a type fo a slot @param key Name of the key to change @param mask Splinter type bitmask to apply (e.g SPL_SLOT_TYPE_BIGUINT) @return -1 or on error (sets errno), 0 on success
- splinter_
set_ ⚠slot_ time - @brief Update a slot’s ctime / atime @param key Name of the key to change @param mode (SPL_TIME_CTIME or SPL_TIME_ATIME) @param epoch client-supplied timestamp @param offset value to subtract from epoch due to update-after-write @return -1/-2 or on error (sets errno), 0 on success
- splinter_
shard_ ⚠claim - @brief Claim a shard bid slot and declare memory intent.
- splinter_
shard_ ⚠claim_ ex - @brief Advanced/testing claim: explicit pid and claimed_at.
- splinter_
shard_ ⚠election - @brief Run the read-only election scan and return the current sovereign.
- splinter_
shard_ ⚠is_ sovereign - @brief Convenience: is shard_id the current sovereign? @return 1 if sovereign, 0 if not (including unknown/expired), -2 on no store.
- splinter_
shard_ ⚠rebid - @brief Refresh (re-bid) an existing claim’s window. Updates claimed_at to splinter_now() and optionally changes intent/priority/duration. This is the fairness re-bid: a shard that needs more time must re-bid rather than hold. @return 0 on success, -1 if shard_id holds no slot, -2 on bad args.
- splinter_
shard_ ⚠release - @brief Voluntarily release (yield) the caller’s bid slot. Zeroes shard_id (marking the slot empty) last, after clearing the other fields. @return 0 on success, -1 if shard_id holds no slot, -2 on bad args/no store.
- splinter_
shard_ ⚠table_ snapshot - @brief Copy a non-atomic snapshot of every bid slot for inspection/audit. @param out Array of at least SPLINTER_MAX_SHARDS records. @param max Capacity of out (capped at SPLINTER_MAX_SHARDS). @return number of records copied, or -2 on bad args/no store.
- splinter_
slot_ ⚠usr_ clear - @brief Clear a user slot flag @param slot Splinter slot structure @param mask bitmask to clear
- splinter_
slot_ ⚠usr_ set - @brief Set a user slot flag @param slot Splinter slot structure @param mask bitmask to set
- splinter_
slot_ ⚠usr_ snapshot - @brief Get a user slot flag snapshot @param slot Splinter slot structure
- splinter_
slot_ ⚠usr_ test - @brief Test a user slot flag @param slot Splinter slot structure @param mask bitmask to test
- splinter_
unset ⚠ - @brief “unsets” a key. This function does one atomic operation to zero the slot hash, which marks the slot available for write. It then zeroes out the used key and value regions, and resets the slot.
- splinter_
unset_ ⚠label - @brief Atomically remove a previously applied bloom label @return 0 on success, negative on failure
- splinter_
watch_ ⚠label_ register - @brief Maps a Bloom label (bitmask) to a signal group.
- splinter_
watch_ ⚠register - @brief Registers interest in a key’s group signal.
- splinter_
watch_ ⚠unregister - @brief Unregisters interest in a key’s group signal.
Type Aliases§
- __
blkcnt64_ t - __
blkcnt_ t - __
blksize_ t - __
caddr_ t - __
clock_ t - __
clockid_ t - __
daddr_ t - __dev_t
- __
fsblkcnt64_ t - __
fsblkcnt_ t - __
fsfilcnt64_ t - __
fsfilcnt_ t - __
fsword_ t - __gid_t
- __id_t
- __
ino64_ t - __ino_t
- __
int8_ t - __
int16_ t - __
int32_ t - __
int64_ t - __
int_ least8_ t - __
int_ least16_ t - __
int_ least32_ t - __
int_ least64_ t - __
intmax_ t - __
intptr_ t - __key_t
- __
loff_ t - __
mode_ t - __
nlink_ t - __
off64_ t - __off_t
- __pid_t
- __
quad_ t - __
rlim64_ t - __
rlim_ t - __
sig_ atomic_ t - __
socklen_ t - __
ssize_ t - __
suseconds64_ t - __
suseconds_ t - __
syscall_ slong_ t - __
syscall_ ulong_ t - __
time_ t - __
timer_ t - __
u_ char - __u_int
- __
u_ long - __
u_ quad_ t - __
u_ short - __uid_t
- __
uint8_ t - __
uint16_ t - __
uint32_ t - __
uint64_ t - __
uint_ least8_ t - __
uint_ least16_ t - __
uint_ least32_ t - __
uint_ least64_ t - __
uintmax_ t - __
useconds_ t - atomic_
bool - atomic_
char - atomic_
char16_ t - atomic_
char32_ t - atomic_
int - atomic_
int_ fast8_ t - atomic_
int_ fast16_ t - atomic_
int_ fast32_ t - atomic_
int_ fast64_ t - atomic_
int_ least8_ t - atomic_
int_ least16_ t - atomic_
int_ least32_ t - atomic_
int_ least64_ t - atomic_
intmax_ t - atomic_
intptr_ t - atomic_
llong - atomic_
long - atomic_
ptrdiff_ t - atomic_
schar - atomic_
short - atomic_
size_ t - atomic_
uchar - atomic_
uint - atomic_
uint_ fast8_ t - atomic_
uint_ fast16_ t - atomic_
uint_ fast32_ t - atomic_
uint_ fast64_ t - atomic_
uint_ least8_ t - atomic_
uint_ least16_ t - atomic_
uint_ least32_ t - atomic_
uint_ least64_ t - atomic_
uintmax_ t - atomic_
uintptr_ t - atomic_
ullong - atomic_
ulong - atomic_
ushort - atomic_
wchar_ t - int_
fast8_ t - int_
fast16_ t - int_
fast32_ t - int_
fast64_ t - int_
least8_ t - int_
least16_ t - int_
least32_ t - int_
least64_ t - intmax_
t - memory_
order - splinter_
header_ snapshot_ t - @struct splinter_header_snapshot @brief structure to hold splinter bus snapshots
- splinter_
integer_ op_ t - @brief for atomic integer operations
- splinter_
intent_ t - @brief Memory-intent classes for a shard bid (the
intentfield). These mirror the POSIX_MADV_* advice classes. SPL_INTENT_NONE marks a record whose owner has not yet declared (or has cleared) its intent. DONTNEED is accepted as a bid but is governed by the soft bumper in splinter_shard_election(): it cannot win while live WILLNEED/SEQUENTIAL bids exist. - splinter_
slot_ snapshot_ t - @structure splinter_slot_snapshot @brief A structure to hold a snapshot of a single slot
- uint_
fast8_ t - uint_
fast16_ t - uint_
fast32_ t - uint_
fast64_ t - uint_
least8_ t - uint_
least16_ t - uint_
least32_ t - uint_
least64_ t - uintmax_
t - wchar_t