7.8 Transactions
A transaction batches key creates and mutating value/key operations into an atomic unit.
int ;
int ;
int ;
peios_reg_begin_transactionstarts one and returns a transaction fd (initially unbound; it binds to a source on first use), or-1/ENOMEM. Pass this fd as thetxn_fdargument to the create and mutating calls to enlist them. Closing the fd without committing aborts the transaction — so a transaction is abort-by-default, which makes error paths safe.peios_reg_commitatomically applies everything enlisted. On success the fd is terminal — close it. Errors tell you what to do:EINVAL(already committed / never bound),EBUSY(write-lock contention — the transaction stays active, retry the commit),EIO(source failure — stays active),ETIMEDOUT.peios_reg_txn_statusreads a transaction's state:state_outreceives theREG_TXN_*state, andterminal_errno_outreceives the errno that ended it (0while active or after a clean commit). Both may beNULL.
The lifecycle: begin → enlist operations by passing txn_fd → commit (retry on EBUSY/EIO) → close, or just close to abort.