Peios Learn
Documentation

Peios

Peios Peios Kernel Universal Directory Project

Developer Tools

Trail Acta Provium clackatoo CAF GCSL Pekit

Applications

Framewright

Standards and Conventions

Standards and Conventions Peios Specifications
Peios Kernel

LCS

Single-page view · as markdown

LCS

Peios Kernel / Userspace interfaces / Native interfaces / LCS

Use these articles to understand lcs in the Peios kernel.

  • File descriptors and buffer conventions
  • Open, create and transaction syscalls
  • Key ioctls
  • Transaction ioctls
  • Errors
  • Generated syscall and common ABI
  • Generated key and security ABI
  • Generated watch ABI
  • Generated transaction and backup ABI
  • Generated source and diagnostic ABI

File descriptors and buffer conventions

Peios Kernel / Userspace interfaces / Native interfaces / LCS

LCS uses a hybrid syscall/ioctl interface, the same shape KACS uses within PKM.

Syscalls create file descriptors: opening a key, creating a key, beginning a transaction. There are three, numbered 1100 to 1102 in the PKM range.

Ioctls operate on a descriptor that already exists — eighteen of them, all under type byte 'R'.

close() releases both kinds of fd through the ordinary fd lifecycle.

Key fds #

A key fd is an anonymous inode created with O_CLOEXEC, holding:

FieldDescription
Source and key GUIDThe identity of the opened key.
Granted access maskComputed once by AccessCheck at open. Immutable.
Resolved pathAfter symlink resolution and CurrentUser\ rewriting.
Ancestor chainThe GUID at each path component from the hive root down. Captured during the open walk, used for subtree watch dispatch (Dispatch).
Watch stateArmed or not, filter, subtree flag, pending event queue.

Key fds behave like any other fd: close(), close-on-exec, poll/epoll, and passing over Unix sockets with SCM_RIGHTS. That last one is what makes them capabilities (The Access Flow).

Open-time checking #

A caller names a desired access mask, and AccessCheck evaluates it against the key's Security Descriptor. All of it is granted or the open fails with EACCES. MAXIMUM_ALLOWED is the only way to ask for whatever is available.

The granted mask lives on the fd, and every subsequent ioctl is a bitmask test against it — not a fresh AccessCheck, and not a fresh read of the descriptor.

Opening relative to a parent fd skips both path parsing and AccessCheck for the parent portion. The caller already proved its access when it obtained the parent fd, and this is the ordinary way to walk a subtree.

Transaction fds #

A transaction fd is an anonymous inode holding a transaction id and, once bound, its source and hive. Transaction lifetime is fd lifetime: closing without committing aborts (Scope and Lifetime).

Reserved fields #

Every syscall and ioctl argument structure uses natural C layout with fixed-width fields and explicit padding. Nothing is packed.

Fields named _pad, and anything else described as reserved, are ABI extension points. A caller must set them to zero, and a non-zero reserved or padding field fails the operation with EINVAL — before source dispatch, before transaction enlistment, before sequence allocation, and before any output is copied.

In the other direction, LCS zeroes every reserved and padding byte of an output structure or a watch event before copying it to userspace.

Flags fields carry only the bits defined for them. An unknown or reserved flag bit is EINVAL unless a specific field says otherwise.

The point of all this is that a future version can give a reserved field meaning without an older kernel having silently accepted a value it did not understand.

Strings #

Strings in ioctl structures are length-delimited, not null-terminated. Each is a (len, ptr) pair where len is a byte count and ptr is a u64 userspace address. LCS reads exactly len bytes. A terminator is neither required nor expected, and one included in the length is a null byte and therefore invalid.

Syscall paths are the exception: they arrive as null-terminated C strings and have the terminator stripped before validation (Names and Case).

Variable-size output buffers #

Six ioctls return variable-size data — REG_IOC_QUERY_VALUE, QUERY_VALUES_BATCH, ENUM_VALUES, ENUM_SUBKEYS, QUERY_KEY_INFO and GET_SECURITY — and all six use one convention.

For each output buffer described by (length, pointer):

  • length 0 is a size probe, whether the pointer is null or not. The pointer is not dereferenced.
  • length greater than 0 requires a non-null pointer writable for that many bytes, or the ioctl returns EFAULT.

If any output buffer is too small the ioctl returns ERANGE and writes every required size it can determine, not just the first one that failed — so a caller with two undersized buffers learns both sizes from one call.

On ERANGE, output buffers are not partially filled; their contents are unspecified.

Output scalar metadata is meaningful only on success, unless an ioctl explicitly documents a field as carrying a required size or count on ERANGE.

Input pointer faults return EFAULT, validated before source dispatch wherever that is possible.

LCS ABI Reference is generated from include/uapi/pkm/lcs.h and holds only what a compiler can measure. This appendix holds the rest.

The split is structural rather than editorial. gen-lcs-abi.py overwrites LCS ABI Reference wholesale on every run, so anything written there is lost the next time the ABI changes.

What is not here #

The header carries names, numbers and layouts. Everything else about the interface is a property of the implementation rather than of the ABI, and is documented with the operation it belongs to: the required access right for each ioctl and the two-pass output buffer convention in The Fd Model, the error vocabulary in The Error Model, the RSI payload shapes in the Registry Source Interface specification, and the backup stream's record payloads in the Registry Backup Format specification.

REG_BACKUP_MAGIC in LCS ABI Reference is the eight-byte header magic; the record type codes are the framing, not the payloads.

Open, create and transaction syscalls

Peios Kernel / Userspace interfaces / Native interfaces / LCS

reg_open_key (1100) #

int reg_open_key(int parent_fd, const char __user *path,
                 u32 desired_access, u32 flags);

Opens an existing key. Fails if it does not exist after layer resolution.

ParameterDescription
parent_fdAn open key fd to resolve relative to, or -1 for an absolute path. No AccessCheck is performed on the parent.
pathA null-terminated registry path — absolute with a hive prefix when parent_fd is -1, relative to the parent key otherwise.
desired_accessRequested rights, raw generic bits, MAXIMUM_ALLOWED, or a combination (Access Rights). Zero and unknown bits are EINVAL.
flagsREG_OPEN_LINK (0x01) opens a symlink key rather than following it. Every other bit is reserved and must be zero.

The open proceeds as follows.

  1. Parse and canonicalise the path: normalise separators, reject empty components and a trailing separator, check the total length and each component length.
  2. Rewrite a leading CurrentUser\ to Users\<caller SID>\ — only for an absolute path, and only the first component (Hives and Routing).
  3. Route. For an absolute path, look the hive name up, private hives before global ones. For a relative one, use the parent key's source and resolve from the parent's GUID.
  4. Walk the path component by component through RSI_LOOKUP, resolving each through the layer stack and following symlinks — except a final component when REG_OPEN_LINK is set. Collect the ancestor chain as you go.
  5. Run AccessCheck against the final key's descriptor.
  6. Publish an fd holding the key GUID, the granted mask, the resolved path and the ancestor chain.

If the path traversed a symlink, the fd stores the resolved path and ancestor chain. It refers to the target object.

ErrnoCondition
ENOENTThe key does not exist after layer resolution.
EACCESAccessCheck did not grant everything requested.
EINVALMalformed path; zero or unknown desired_access bits; a symlink whose effective default value is not REG_LINK; maximum depth exceeded.
ELOOPSymlink depth limit exceeded.
ENAMETOOLONGA component or the total path is too long.
ETIMEDOUTThe source did not answer within RequestTimeoutMs.
EIOThe source failed or is unavailable.
ENOMEMKernel allocation failure.

reg_create_key (1101) #

int reg_create_key(const struct reg_create_key_args __user *args);

Opens the key if it exists after layer resolution, creates it with an inherited descriptor if not, and reports which happened.

FieldDescription
parent_fdAs reg_open_key.
path_ptrPointer to a null-terminated path.
desired_accessAs reg_open_key.
flagsREG_OPTION_VOLATILE (0x01), REG_OPTION_CREATE_LINK (0x02). Other bits reserved.
layer_ptrPointer to a null-terminated layer name for creation, or null for the base layer. Names the layer whose entry is created; what "exists" means depends on it (below).
txn_fdA transaction fd, or -1. A non-negative value makes creation a mutating operation that binds or reuses that transaction.
disposition_ptrReceives REG_CREATED_NEW (1) or REG_OPENED_EXISTING (2). May be null.
_pad0, _pad1Reserved; must be zero.

If the key exists, this behaves as reg_open_key and the disposition is REG_OPENED_EXISTING. What "exists" means depends on the layer named. For the base layer (a null layer_ptr) it is the path resolving through any enabled layer. For a named layer it is that layer holding an entry at the path: presence is per layer (Path Entries), so another layer's key at the same path does not count, and the create makes the named layer's own entry, with its own GUID and REG_CREATED_NEW — which is how hide-and-replace is authored.

The named-layer presence check is read-only and compares layer names without case sensitivity. If that layer already names a key, LCS opens the effective key using normal layer resolution and checks the requested rights on that key. It does not require KEY_CREATE_SUB_KEY on the parent, perform layer write authorization, or send CREATE_ENTRY/CREATE_KEY for an existing key. An unbound transaction remains unbound by this open; a bound transaction uses its own view, including entries it has created but not yet committed. The checks below still apply when the named layer has no key entry there.

If it does not:

  1. Resolve the parent, which must exist. Check that the parent's depth plus one is within MaxKeyDepth.
  2. AccessCheck the parent for KEY_CREATE_SUB_KEY.
  3. Perform layer write authorization against the target layer's metadata key (Writing Into a Layer).
  4. Mint a fresh UUIDv4 GUID.
  5. Compute the new key's descriptor from the parent's, through KACS.
  6. Create the path entry with a new sequence number, then the key record (Path Entries).
  7. AccessCheck the new key's inherited descriptor against desired_access — an inherited descriptor may not grant everything the creator asked for.
  8. Publish the fd with the granted mask and disposition REG_CREATED_NEW.

Intermediate path components are not auto-created. Only the final one is.

Races. If two callers race, one creates and the other observes the key as existing. RSI_ALREADY_EXISTS on the path entry is retried as an open, reporting REG_OPENED_EXISTING, and EEXIST never reaches userspace from this syscall. RSI_ALREADY_EXISTS on the key record, for a GUID LCS has just minted, is not a race — the source and the kernel disagree about what exists — and fails closed with EIO (Keys).

ErrnoCondition, in addition to reg_open_key's
ENOENTThe parent does not exist, or the named layer is not in the layer table.
EACCESThe parent denied KEY_CREATE_SUB_KEY, the inherited descriptor denied the requested access, or layer write authorization failed.
EPERMREG_OPTION_CREATE_LINK without KEY_CREATE_LINK on the parent, or without SeTcbPrivilege or Administrators.
ENOSPCThe per-value layer cap was exceeded.
EINVALA non-volatile key under a volatile parent; a non-zero reserved field.

reg_begin_transaction (1102) #

int reg_begin_transaction(void);

Allocates a transaction id, publishes a transaction fd in state REG_TXN_ACTIVE_UNBOUND, and starts the lifetime timer. It contacts no source and chooses none (Scope and Lifetime). It can fail only with ENOMEM, EOVERFLOW on transaction id exhaustion, or EINVAL.

reg_begin_read_transaction (1103) #

int reg_begin_read_transaction(void);

Creates a read-only transaction with the same fd lifetime and status model. The first read binds one source/hive, pins its persistent and volatile stores, and freezes layer selection. Later reads, enumeration and transacted opens use that view. Mutations fail EROFS; another hive fails EXDEV.

Capture overlapping Registry publication fails EAGAIN. Start a fresh transaction and repeat the complete read. It never falls back to live reads. The lifetime starts at begin and uses TransactionTimeoutMs. The source's MaxReadOnlyTransactionsPerSource quota applies once bound. Closing releases the snapshot; a bound snapshot may also be ended with REG_IOC_COMMIT.

The caller's ordered private-layer and hive-scope attachments must remain the same throughout the read transaction. A changed attachment view fails EACCES; it cannot silently select different data from the same snapshot. This does not freeze the caller's identity or permissions for new opens.

reg_open_key_transacted (1104) #

int reg_open_key_transacted(int parent_fd, const char __user *path,
                           u32 desired_access, u32 flags, int txn_fd);

Uses the same path and access arguments as reg_open_key, with a transaction fd. In a read-only transaction, names and symlinks resolve through the frozen view. AccessCheck uses the current descriptor of the resolved GUID and the calling thread's effective token. A deleted GUID fails ENOENT, even if its old path remains in the snapshot. A replacement at the same path has a distinct GUID and cannot substitute its permissions. Existing key fds retain their ordinary granted-access semantics.

Key ioctls

Peios Kernel / Userspace interfaces / Native interfaces / LCS

REG_IOC_QUERY_KEY_INFO_TRANSACTED and REG_IOC_GET_SECURITY_TRANSACTED accept reg_read_transacted_args: args_ptr points to the corresponding ordinary argument structure, txn_fd names the transaction, and _pad is zero. They retain the ordinary access checks and buffer contracts, with data read from the transaction. Key-info hive generation is fixed at read snapshot capture. Existing non-transacted commands retain their live-read behaviour.

Sixteen ioctls act on a key fd. Each checks the fd's granted mask first and returns EACCES without contacting the source if the required right is absent (Access Rights). Numbers, directions and argument layouts are in LCS ABI Reference.

Every mutating ioctl accepts an optional transaction fd. So do the four read ioctls — a read inside a bound transaction sees the transaction's own uncommitted writes. A transaction bound to a different hive is EXDEV; a committed, aborted or closed one is EINVAL; a timed-out one is ETIMEDOUT; one whose source went Down is EIO. An unbound transaction fd does not bind on a read, which is simply performed non-transactionally.

Every mutating ioctl that names a layer performs layer write authorization first (Writing Into a Layer).

Common errors #

ErrnoCondition
EACCESThe granted mask lacks the required right, or layer write authorization failed.
EFAULTAn input pointer is invalid, or a non-zero-length output buffer pointer is null or unwritable.
EIOThe source is unavailable, failed, or the transaction's source went Down.
ETIMEDOUTThe source did not answer within RequestTimeoutMs, or the transaction had timed out.
ENOMEMKernel allocation failure.
EXDEVThe transaction is bound to a different hive.
ENOENTThe named layer is not in the layer table.
EINVALA non-zero reserved or padding field.
ENOTTYAn ioctl number this fd type does not implement.

Reading #

REG_IOC_QUERY_VALUE returns the effective value at a name: its type, data, the sequence number of the winning entry, and the canonical name of the winning layer — which is the layer table's spelling, not whatever string the source stored. A base-layer entry therefore reports base.

A winning tombstone or blanket, or no entries at all, is ENOENT.

REG_IOC_QUERY_VALUES_BATCH returns every effective value on the key in one call: name, type and data for each, with tombstoned and blanket-masked values omitted. This is the call to use when you want them all (Resolution).

REG_IOC_ENUM_VALUES and REG_IOC_ENUM_SUBKEYS return the entry at an index, and ENOENT past the end.

Both re-resolve the full set on every call, and enumeration order is undefined — see Resolution for why the batch call usually wins.

ENUM_SUBKEYS performs no per-child access check. It returns every visible child with its last write time, subkey count and value count. The caller learns names and must open each child separately to read anything (Access Rights).

REG_IOC_QUERY_KEY_INFO returns the key's name, last write time, subkey and value counts, the maximum subkey name length, maximum value name length and maximum value data size, the descriptor size, the volatile and symlink flags, and the hive generation number. It requires READ_CONTROL.

For a non-root key, the name is the stored key record's informational name, with its original spelling, rather than the spelling used to open the fd. The required buffer length is that stored name's UTF-8 byte length, including when the opening spelling folds to it but has a different byte length. The source name must fold to the leaf the fd resolved; an unrelated name is malformed key metadata, audited and refused with EIO, including on a buffer-length probe. Hive roots have no child name and instead report the preserved hive name from source registration, with its own byte length.

It is declared _IOWR, which is what it does: it reads the caller's output-buffer fields out of the argument structure before writing it back.

It was declared _IOR, and because the direction bits are part of the encoded ioctl number and the kernel dispatches on the whole encoded value, correcting that was an ABI break rather than a relabelling. A binary built against the old constant gets ENOTTY from a kernel carrying the new one.

The hive generation number #

A monotonic per-hive change epoch owned by the kernel. It is not a sequence number and must not be read as one: sources neither report it nor persist it (The Sequence Counter).

It is incremented once per committed mutation, or once per committed transaction per affected hive, however many operations that transaction contained.

Its baseline is initialised from the source's reported maximum sequence at registration so that observed values are monotonic relative to persisted entries; saturating at U64_MAX is EOVERFLOW.

It is exposed on every key because it is cheap and because a watcher that receives OVERFLOW can compare the generation it last saw with the current one and skip the recovery re-read entirely if nothing has committed (Queues and Overflow).

Layer operations produce a single generation increment covering the metadata key deletion, RSI_DELETE_LAYER, the recomputation and the resulting watch effects. There is no generation at which the metadata key is gone but the layer's entries are still resolving.

An operation affecting several hives increments each independently.

Writing #

REG_IOC_SET_VALUE writes a value entry in a layer. LCS allocates a sequence number and tells the source to store (key GUID, value name, layer) → (type, data, sequence), then updates the key's last write time.

Writing type REG_TOMBSTONE is the explicit tombstone operation and requires zero-length data (Values).

A non-zero expected_sequence makes the write conditional. It is passed to the source, which atomically verifies that the layer's own current entry carries that sequence number before writing, and answers RSI_CAS_FAILED if not — which LCS returns as EAGAIN. LCS reads the key's entries before every write, for watch dispatch, but there is no kernel-side query-then-write for the condition: the check is the source's, and it is atomic there or nowhere.

The condition is evaluated against the layer's own entry, not against the effective value. A higher-precedence layer overriding a value is not a lost update; it is the layer system working.

Additional errors:

  • EINVAL for an unknown type or a tombstone with data.
  • EAGAIN for a failed conditional write.
  • ENOSPC for the layer cap or oversized data.
  • ENAMETOOLONG for the value name.
  • EPERM for a Precedence above 0 without SeTcbPrivilege (Writing Into a Layer).

REG_IOC_DELETE_VALUE removes one layer's entry at a value name — whether that entry was a value or a tombstone. Removing a layer's opinion lets lower-precedence layers surface.

The operation is meant to be idempotent, and it is idempotent as far as a caller sees, provided the source answers RSI_OK for an entry that was not there. LCS does not mask a source's RSI_NOT_FOUND; that propagates as ENOENT. Idempotency is a source obligation, not a kernel behaviour.

REG_IOC_BLANKET_TOMBSTONE sets or removes a blanket tombstone for a layer on this key (Tombstones). A new sequence number is assigned for dispatch ordering, and watch events are generated for every value whose effective state changed.

REG_IOC_DELETE_KEY removes this key's path entry from a layer.

The parent GUID comes from the fd's ancestor chain and the child name from the last component of its resolved path. ENOTEMPTY if the key has visible children; EINVAL on a hive root (Deletion and Orphans).

REG_IOC_HIDE_KEY creates a HIDDEN path entry at the same place instead, masking lower-precedence entries. The caller must hold an open fd to the key, which is how it proved access to it. EINVAL on a hive root.

Security #

REG_IOC_GET_SECURITY and REG_IOC_SET_SECURITY read and merge Security Descriptor components, selected by a security_info bitmask. Inheritance and Hive Roots covers the rights, the merge, and the validation.

Watches, durability, bulk #

REG_IOC_NOTIFY arms, re-arms or disarms a watch (The Watch Model).

REG_IOC_FLUSH tells the source to persist pending writes for this key's hive, and returns when persistence is confirmed. The hive name comes from the first component of the fd's resolved path. It requires KEY_SET_VALUE (Access Rights).

REG_IOC_BACKUP and REG_IOC_RESTORE export and replace a subtree. They are privilege-gated with no per-key access check, and they are covered in The Stream.

Transaction ioctls

Peios Kernel / Userspace interfaces / Native interfaces / LCS

Two ioctls act on a transaction fd. Everything else on that fd is ENOTTY — there are no savepoint or nesting operations to have.

The common key fd error table does not apply here.

REG_IOC_COMMIT #

Commits every operation in the transaction. Commit and Failure covers what happens in each case; in summary:

ErrnoCondition
—Success. The object becomes COMMITTED, poll waiters are woken, watch events are delivered, and further use of the fd returns EINVAL.
EINVALAlready committed, or never bound to a source.
EBUSYThe source could not take the write lock. The transaction stays ACTIVE_BOUND; retry.
EIOThe source failed to commit. The transaction stays ACTIVE_BOUND.
ETIMEDOUTThe transaction timed out before the commit completed.

EBUSY and EIO both leave the transaction usable: the mutation log is retained, no events are emitted, and poll waiters are not woken as though it had become terminal. The caller retries or closes the fd to abort.

REG_IOC_TXN_STATUS #

Reports the transaction's state and a terminal errno into a reg_txn_status_args. It reads nothing from the caller, consistent with its _IOR direction, and can fail only with EFAULT on an unwritable output pointer.

Stateterminal_errno
REG_TXN_ACTIVE_UNBOUND0
REG_TXN_ACTIVE_BOUND0
REG_TXN_COMMITTED0
REG_TXN_ABORTEDEINVAL
REG_TXN_TIMED_OUTETIMEDOUT
REG_TXN_SOURCE_DOWNEIO

For the three failed terminal states, terminal_errno is the errno a further operation on the fd would return. For COMMITTED it is not: the transaction reports 0, but using the fd again returns EINVAL.

This ioctl is what makes a poll wakeup useful. A terminal transition reports POLLERR | POLLHUP, which says only that something terminal happened; the status call says what.

Errors

Peios Kernel / Userspace interfaces / Native interfaces / LCS

Syscalls and ioctls follow the ordinary Linux convention: -1 and errno.

The errno is the whole interface — source-specific error detail is never surfaced to a caller.

ErrnoWhat it means here
ENOENTA key or value does not exist after layer resolution; an enumeration index is past the end; a named layer is not in the layer table; a namespace operation on an orphaned key.
EACCESAccessCheck denied a right, the fd's granted mask lacks it, or layer write authorization failed.
EINVALAn invalid path or argument; a non-zero reserved or padding field; a zero or unknown-bit desired_access; an operation on a committed, aborted or closed transaction; a symlink target that is not REG_LINK; maximum key depth exceeded; delete or hide on a hive root.
EFAULTAn invalid userspace pointer. A zero-length output probe ignores its pointer; a non-zero length with a null or unwritable pointer does not.
ENAMETOOLONGA key or value name exceeds MaxPathComponentLength, or a path exceeds MaxTotalPathLength.
ELOOPThe symlink resolution depth limit was exceeded.
ETIMEDOUTThe source did not answer within RequestTimeoutMs, or a timed-out transaction fd was used.
EIOThe source failed, is unavailable, returned malformed data, or a transaction's bound source went Down.
ENOMEMKernel allocation failure.
ENOSPCA layer cap was exceeded, or value data exceeds MaxValueSize.
ENOTEMPTYA key with visible children cannot be deleted.
EXDEVAn operation targeted a different hive from the one its transaction is bound to.
EPERMA privilege the caller does not hold: symlink creation, creating or raising a layer above precedence 0, backup, restore.
EAGAINA conditional write failed — the layer entry's sequence did not match. Re-read and retry.
EBUSYA commit could not take the source's write lock, or MaxBoundTransactionsPerSource or MaxReadOnlyTransactionsPerSource was exceeded.
ERANGEAn output buffer is too small. Every determinable required size is written; buffers are not partially filled. Retry with larger ones.
EEXISTA path entry or key already exists at the source.
ENOTSUPThe source does not support the transaction mode being requested.
EBADFAn fd argument is not valid or not open in the required mode — a backup output fd that is not writable, a restore input fd that is not readable.
EOVERFLOWA counter cannot advance: a source reported a persisted sequence number too large to allocate past, a hive generation saturated, restore sequence remapping would overflow, or transaction ids are exhausted.
ESTALEA source re-registration tried to resume a Down slot with a mismatched hive identity.

Two errnos worth reading closely #

ETIMEDOUT means "may or may not have happened." If the deadline expired before an in-flight RSI slot was reserved, no request was sent at all. If it expired after dispatch, the source may still apply the operation and answer later, and LCS will apply the kernel-side effects when it does (Failure and Late Responses). A caller that needs certainty checks state before retrying. The same applies to a transaction commit.

EEXIST is rarer than it looks. It never comes out of reg_create_key, which retries a losing race as an open (Syscalls). From REG_IOC_RESTORE it arrives only by propagation: the source answers RSI_ALREADY_EXISTS while the stream is being replayed. There is no kernel-side pre-check that a non-root GUID in a backup already exists outside the subtree being replaced, so a collision is detected during the restore rather than before it — inside the restore transaction, which then rolls back (Restore). Its other source is source registration, where a hive identity collides with an Active slot; a collision with a Down slot yields EINVAL or ESTALE instead (Registration and Slots).

Generated syscall and common ABI

Peios Kernel / Userspace interfaces / Native interfaces / LCS

Every name, value, offset and size in this appendix is generated from include/uapi/pkm/lcs.h by tools/docs/peios-reference/generators/gen-lcs-abi.py, with ioctl encodings and struct layouts measured by compiling a probe against the real header. Regenerate it whenever the ABI changes; do not edit it by hand. The names here are the ones a program actually compiles against.

What a compiler cannot measure -- which properties belong with their operations rather than here, and the kernel configuration -- is in the notes appendix, LCS ABI Notes, which this generator does not touch.

Syscall numbers #

Signatures are read from the SYSCALL_DEFINE sites in security/pkm/lcs/. The PKM UAPI exports the uppercase constants in <pkm/syscall.h>. Peios glibc 2.44-5 and later exports the standard lowercase SYS_reg_* aliases in <sys/syscall.h>; each alias has the same number as its PKM constant.

NumberPKM constantglibc aliasSignature
1100SYS_REG_OPEN_KEYSYS_reg_open_keyreg_open_key(int parent_fd, const char __user *path, u32 desired_access, u32 flags)
1101SYS_REG_CREATE_KEYSYS_reg_create_keyreg_create_key(const struct reg_create_key_args __user *args)
1102SYS_REG_BEGIN_TRANSACTIONSYS_reg_begin_transactionreg_begin_transaction(void)
1103SYS_REG_BEGIN_READ_TRANSACTIONSYS_reg_begin_read_transactionreg_begin_read_transaction(void)
1104SYS_REG_OPEN_KEY_TRANSACTEDSYS_reg_open_key_transactedreg_open_key_transacted(int parent_fd, const char __user *path, u32 desired_access, u32 flags, int txn_fd)

Ioctls #

The type byte is 'R'. Ioctl number namespaces are per fd type, so REG_SRC_REGISTER (number 0 on the source device) and REG_IOC_QUERY_VALUE (number 0 on a key fd) do not collide: the kernel dispatches on the fd's file_operations, not globally. The encoded value is what _IOC produces from the direction, type byte, number and argument size.

Source device fd.

IoctlNumberDirectionArgumentArg sizeEncoded
REG_SRC_REGISTER0_IOWstruct reg_src_register_args240x40185200
REG_SRC_NEGOTIATE1_IOWRstruct reg_src_negotiate_args160xC0105201
REG_SRC_REQUEST_CONTEXT2_IOWRstruct reg_src_request_context_args400xC0285202
REG_SRC_RENEW3_IOWRstruct reg_src_renew_args320xC0205203

Key fd.

IoctlNumberDirectionArgumentArg sizeEncoded
REG_IOC_QUERY_VALUE0_IOWRstruct reg_query_value_args640xC0405200
REG_IOC_SET_VALUE1_IOWstruct reg_set_value_args640x40405201
REG_IOC_DELETE_VALUE2_IOWstruct reg_delete_value_args400x40285202
REG_IOC_BLANKET_TOMBSTONE3_IOWstruct reg_blanket_tombstone_args240x40185203
REG_IOC_QUERY_VALUES_BATCH4_IOWRstruct reg_query_values_batch_args240xC0185204
REG_IOC_ENUM_VALUES5_IOWRstruct reg_enum_value_args400xC0285205
REG_IOC_ENUM_SUBKEYS6_IOWRstruct reg_enum_subkey_args400xC0285206
REG_IOC_QUERY_KEY_INFO7_IOWRstruct reg_query_key_info_args640xC0405207
REG_IOC_DELETE_KEY8_IOWstruct reg_delete_key_args240x40185208
REG_IOC_HIDE_KEY9_IOWstruct reg_hide_key_args240x40185209
REG_IOC_GET_SECURITY10_IOWRstruct reg_get_security_args160xC010520A
REG_IOC_SET_SECURITY11_IOWstruct reg_set_security_args240x4018520B
REG_IOC_NOTIFY12_IOWstruct reg_notify_args80x4008520C
REG_IOC_FLUSH13_IOnone00x0000520D
REG_IOC_BACKUP14_IOWstruct reg_backup_args40x4004520E
REG_IOC_RESTORE15_IOWstruct reg_restore_args40x4004520F
REG_IOC_QUERY_KEY_INFO_TRANSACTED18_IOWRstruct reg_read_transacted_args160xC0105212
REG_IOC_GET_SECURITY_TRANSACTED19_IOWRstruct reg_read_transacted_args160xC0105213

Transaction fd.

IoctlNumberDirectionArgumentArg sizeEncoded
REG_IOC_COMMIT16_IOnone00x00005210
REG_IOC_TXN_STATUS17_IORstruct reg_txn_status_args80x80085211

Structure layouts #

Offsets and sizes are measured, not declared. The header also defines a _SIZE constant for each of these structures; the two agree by construction, and a mismatch fails the build in uapi/smoke_test.c.

Constants #

Grouped as the header groups them.

Optional RSI lifetime extension, negotiated before REG_SRC_REGISTER. All timestamps use CLOCK_MONOTONIC nanoseconds. Zero lifetime means an operation-owned transaction with no independent lifetime limit. The session is unique to this open source fd, including across restarts.

ConstantValue
REG_SRC_LIFETIME_VERSION1

Syscall and ioctl argument sizes (Kernel TRM section 5.A, LCS ABI).

ConstantValue
REG_CREATE_KEY_ARGS_SIZE48
REG_QUERY_VALUE_ARGS_SIZE64
REG_SET_VALUE_ARGS_SIZE64
REG_DELETE_VALUE_ARGS_SIZE40
REG_BLANKET_TOMBSTONE_ARGS_SIZE24
REG_QUERY_VALUES_BATCH_ARGS_SIZE24
REG_ENUM_VALUE_ARGS_SIZE40
REG_ENUM_SUBKEY_ARGS_SIZE40
REG_QUERY_KEY_INFO_ARGS_SIZE64
REG_READ_TRANSACTED_ARGS_SIZE16
REG_DELETE_KEY_ARGS_SIZE24
REG_HIDE_KEY_ARGS_SIZE24
REG_GET_SECURITY_ARGS_SIZE16
REG_SET_SECURITY_ARGS_SIZE24
REG_NOTIFY_ARGS_SIZE8
REG_BACKUP_ARGS_SIZE4
REG_RESTORE_ARGS_SIZE4
REG_TXN_STATUS_ARGS_SIZE8
REG_SRC_NEGOTIATE_ARGS_SIZE16
REG_SRC_REQUEST_CONTEXT_ARGS_SIZE40
REG_SRC_RENEW_ARGS_SIZE32
REG_SRC_REGISTER_ARGS_SIZE24
REG_SRC_HIVE_ENTRY_SIZE56

Transaction state codes.

ConstantValue
REG_TXN_ACTIVE_UNBOUND0
REG_TXN_ACTIVE_BOUND1
REG_TXN_COMMITTED2
REG_TXN_ABORTED3
REG_TXN_TIMED_OUT4
REG_TXN_SOURCE_DOWN5

Syscall flags and dispositions.

ConstantValue
REG_OPEN_LINK0x01
REG_OPTION_VOLATILE0x01
REG_OPTION_CREATE_LINK0x02
REG_CREATED_NEW1
REG_OPENED_EXISTING2

Registry key access rights.

ConstantValue
KEY_QUERY_VALUE0x00000001
KEY_SET_VALUE0x00000002
KEY_CREATE_SUB_KEY0x00000004
KEY_ENUMERATE_SUB_KEYS0x00000008
KEY_NOTIFY0x00000010
KEY_CREATE_LINK0x00000020
DELETE0x00010000
READ_CONTROL0x00020000
WRITE_DAC0x00040000
WRITE_OWNER0x00080000
ACCESS_SYSTEM_SECURITY0x01000000
MAXIMUM_ALLOWED0x02000000
GENERIC_ALL0x10000000
GENERIC_EXECUTE0x20000000
GENERIC_WRITE0x40000000
GENERIC_READ0x80000000
KEY_READ0x00020019
KEY_WRITE0x00020006
KEY_ALL_ACCESS0x000F003F
REG_VALID_DESIRED_ACCESS_MASK0xF30F003F
REG_VALID_MAPPED_ACCESS_MASK0x010F003F
REG_VALID_ACE_ACCESS_MASK0xF10F003F

Security information flags for REG_IOC_GET_SECURITY / SET_SECURITY.

ConstantValue
OWNER_SECURITY_INFORMATION0x00000001
GROUP_SECURITY_INFORMATION0x00000002
DACL_SECURITY_INFORMATION0x00000004
SACL_SECURITY_INFORMATION0x00000008
LABEL_SECURITY_INFORMATION0x00000010
REG_VALID_SECURITY_INFORMATION0x0000001F

Registry value types.

ConstantValue
REG_NONE0
REG_SZ1
REG_EXPAND_SZ2
REG_BINARY3
REG_DWORD4
REG_DWORD_BIG_ENDIAN5
REG_LINK6
REG_MULTI_SZ7
REG_RESOURCE_LIST8
REG_FULL_RESOURCE_DESCRIPTOR9
REG_RESOURCE_REQUIREMENTS_LIST10
REG_QWORD11
REG_TOMBSTONE0xFFFF

Watch event types and filters.

ConstantValue
REG_WATCH_VALUE_SET1
REG_WATCH_VALUE_DELETED2
REG_WATCH_SUBKEY_CREATED3
REG_WATCH_SUBKEY_DELETED4
REG_WATCH_SD_CHANGED5
REG_WATCH_KEY_DELETED6
REG_WATCH_OVERFLOW7

Watch event raw byte layout.

ConstantValue
REG_WATCH_EVENT_TOTAL_LEN_OFFSET0
REG_WATCH_EVENT_TYPE_OFFSET4
REG_WATCH_EVENT_NAME_LEN_OFFSET6
REG_WATCH_EVENT_NAME_OFFSET8
REG_WATCH_EVENT_MIN_SIZE8
REG_WATCH_SUBTREE_PATH_DEPTH_REL_OFFSET0
REG_WATCH_SUBTREE_PATH_DEPTH_SIZE2
REG_WATCH_SUBTREE_PATH_COMPONENTS_REL_OFFSET2
REG_WATCH_PATH_COMPONENT_LEN_SIZE2
REG_NOTIFY_VALUE0x01
REG_NOTIFY_SUBKEY0x02
REG_NOTIFY_SD0x04
REG_NOTIFY_ALL0x07

RSI common wire layout.

ConstantValue
RSI_REQUEST_TOTAL_LEN_OFFSET0
RSI_REQUEST_ID_OFFSET4
RSI_REQUEST_OP_CODE_OFFSET12
RSI_REQUEST_TXN_ID_OFFSET14
RSI_REQUEST_HEADER_SIZE22
RSI_RESPONSE_TOTAL_LEN_OFFSET0
RSI_RESPONSE_ID_OFFSET4
RSI_RESPONSE_OP_CODE_OFFSET12
RSI_RESPONSE_HEADER_SIZE14
RSI_RESPONSE_STATUS_OFFSET14
RSI_STATUS_SIZE4
RSI_MIN_RESPONSE_SIZE18
RSI_LENGTH_PREFIX_SIZE4
RSI_GUID_SIZE16
RSI_RESPONSE_BIT0x8000

RSI op codes and response op codes.

ConstantValue
RSI_LOOKUP0x0001
RSI_CREATE_ENTRY0x0002
RSI_HIDE_ENTRY0x0003
RSI_DELETE_ENTRY0x0004
RSI_ENUM_CHILDREN0x0005
RSI_CREATE_KEY0x0010
RSI_READ_KEY0x0011
RSI_WRITE_KEY0x0012
RSI_DROP_KEY0x0013
RSI_QUERY_VALUES0x0020
RSI_SET_VALUE0x0021
RSI_DELETE_VALUE_ENTRY0x0022
RSI_SET_BLANKET_TOMBSTONE0x0023
RSI_BEGIN_TRANSACTION0x0030
RSI_COMMIT_TRANSACTION0x0031
RSI_ABORT_TRANSACTION0x0032
RSI_FLUSH0x0040
RSI_DELETE_LAYER0x0050
RSI_LOOKUP_RESPONSE0x8001
RSI_CREATE_ENTRY_RESPONSE0x8002
RSI_HIDE_ENTRY_RESPONSE0x8003
RSI_DELETE_ENTRY_RESPONSE0x8004
RSI_ENUM_CHILDREN_RESPONSE0x8005
RSI_CREATE_KEY_RESPONSE0x8010
RSI_READ_KEY_RESPONSE0x8011
RSI_WRITE_KEY_RESPONSE0x8012
RSI_DROP_KEY_RESPONSE0x8013
RSI_QUERY_VALUES_RESPONSE0x8020
RSI_SET_VALUE_RESPONSE0x8021
RSI_DELETE_VALUE_ENTRY_RESPONSE0x8022
RSI_SET_BLANKET_TOMBSTONE_RESPONSE0x8023
RSI_BEGIN_TRANSACTION_RESPONSE0x8030
RSI_COMMIT_TRANSACTION_RESPONSE0x8031
RSI_ABORT_TRANSACTION_RESPONSE0x8032
RSI_FLUSH_RESPONSE0x8040
RSI_DELETE_LAYER_RESPONSE0x8050

RSI status codes.

ConstantValue
RSI_OK0
RSI_NOT_FOUND1
RSI_ALREADY_EXISTS2
RSI_STORAGE_ERROR3
RSI_NOT_EMPTY4
RSI_TOO_LARGE5
RSI_TXN_BUSY6
RSI_INVALID7
RSI_CAS_FAILED8
RSI_TXN_NOT_SUPPORTED9

RSI path target types.

ConstantValue
RSI_PATH_TARGET_GUID0
RSI_PATH_TARGET_HIDDEN1

RSI_WRITE_KEY field mask bits.

ConstantValue
RSI_WRITE_KEY_FIELD_SD0x01
RSI_WRITE_KEY_FIELD_LAST_WRITE_TIME0x02
RSI_WRITE_KEY_FIELD_KNOWN_MASK0x00000003

RSI transaction modes and source-registration flags.

ConstantValue
RSI_TXN_READ_WRITE0
RSI_TXN_READ_ONLY1
RSI_HIVE_PRIVATE0x01

Backup record types and magic.

ConstantValue
REG_BACKUP_HEADER0x01
REG_BACKUP_LAYER0x02
REG_BACKUP_KEY0x03
REG_BACKUP_PATH_ENTRY0x04
REG_BACKUP_VALUE0x05
REG_BACKUP_BLANKET_TOMBSTONE0x06
REG_BACKUP_TRAILER0xFF
REG_BACKUP_MAGIC"PEIOSREG"

Related explanations #

  • Generated key and security ABI
  • Generated watch ABI
  • Generated transaction and backup ABI
  • Generated source and diagnostic ABI

Generated key and security ABI

Peios Kernel / Userspace interfaces / Native interfaces / LCS

struct reg_create_key_args #

Total size 48 bytes.

OffsetSizeTypeField
04__s32parent_fd
44__u32_pad0
88__u64path_ptr
164__u32desired_access
204__u32flags
248__u64layer_ptr
324__s32txn_fd
364__u32_pad1
408__u64disposition_ptr

struct reg_query_value_args #

Total size 64 bytes.

OffsetSizeTypeField
04__u32name_len
44__u32_pad0
88__u64name_ptr
164__u32type
204__u32data_len
244__s32txn_fd
284__u32layer_buf_len
328__u64data_ptr
408__u64sequence
484__u32layer_len
524__u32_pad1
568__u64layer_ptr

struct reg_set_value_args #

Total size 64 bytes.

OffsetSizeTypeField
04__u32name_len
44__u32_pad0
88__u64name_ptr
164__u32type
204__u32data_len
248__u64data_ptr
324__u32layer_len
364__u32_pad1
408__u64layer_ptr
484__s32txn_fd
524__u32_pad2
568__u64expected_seq

struct reg_delete_value_args #

Total size 40 bytes.

OffsetSizeTypeField
04__u32name_len
44__u32_pad0
88__u64name_ptr
164__u32layer_len
204__u32_pad1
248__u64layer_ptr
324__s32txn_fd
364__u32_pad2

struct reg_blanket_tombstone_args #

Total size 24 bytes.

OffsetSizeTypeField
04__u32layer_len
44__u32_pad0
88__u64layer_ptr
161__u8set
173__u8``[3]_pad1
204__s32txn_fd

struct reg_query_values_batch_args #

Total size 24 bytes.

OffsetSizeTypeField
04__u32buf_len
44__u32count
88__u64buf_ptr
164__s32txn_fd
204__u32_pad

struct reg_enum_value_args #

Total size 40 bytes.

OffsetSizeTypeField
04__u32index
44__u32name_len
88__u64name_ptr
164__u32type
204__u32data_len
248__u64data_ptr
324__s32txn_fd
364__u32_pad

struct reg_enum_subkey_args #

Total size 40 bytes.

OffsetSizeTypeField
04__u32index
44__u32name_len
88__u64name_ptr
168__u64last_write_time
244__u32subkey_count
284__u32value_count
324__s32txn_fd
364__u32_pad

struct reg_query_key_info_args #

Total size 64 bytes.

OffsetSizeTypeField
04__u32name_len
44__u32_pad0
88__u64name_ptr
168__u64last_write_time
244__u32subkey_count
284__u32value_count
324__u32max_subkey_name_len
364__u32max_value_name_len
404__u32max_value_data_size
444__u32sd_size
481__u8volatile_key
491__u8symlink
506__u8``[6]_pad1
568__u64hive_generation

struct reg_delete_key_args #

Total size 24 bytes.

OffsetSizeTypeField
04__u32layer_len
44__u32_pad0
88__u64layer_ptr
164__s32txn_fd
204__u32_pad1

struct reg_hide_key_args #

Total size 24 bytes.

OffsetSizeTypeField
04__u32layer_len
44__u32_pad0
88__u64layer_ptr
164__s32txn_fd
204__u32_pad1

struct reg_get_security_args #

Total size 16 bytes.

OffsetSizeTypeField
04__u32security_info
44__u32sd_len
88__u64sd_ptr

struct reg_set_security_args #

Total size 24 bytes.

OffsetSizeTypeField
04__u32security_info
44__u32sd_len
88__u64sd_ptr
164__s32txn_fd
204__u32_pad

struct reg_read_transacted_args #

Total size 16 bytes.

OffsetSizeTypeField
08__u64args_ptr
84__s32txn_fd
124__u32_pad

Generated watch ABI

Peios Kernel / Userspace interfaces / Native interfaces / LCS

struct reg_notify_args #

Total size 8 bytes.

OffsetSizeTypeField
04__u32filter
41__u8subtree
53__u8``[3]_pad

Generated transaction and backup ABI

Peios Kernel / Userspace interfaces / Native interfaces / LCS

struct reg_backup_args #

Total size 4 bytes.

OffsetSizeTypeField
04__s32output_fd

struct reg_restore_args #

Total size 4 bytes.

OffsetSizeTypeField
04__s32input_fd

struct reg_txn_status_args #

Total size 8 bytes.

OffsetSizeTypeField
04__u32state
44__s32terminal_errno

Generated source and diagnostic ABI

Peios Kernel / Userspace interfaces / Native interfaces / LCS

struct reg_src_register_args #

Total size 24 bytes.

OffsetSizeTypeField
04__u32hive_count
44__u32_pad
88__u64max_sequence
168__u64hives_ptr

struct reg_src_negotiate_args #

Total size 16 bytes.

OffsetSizeTypeField
04__u32version
44__u32flags
88__u64session

struct reg_src_request_context_args #

Total size 40 bytes.

OffsetSizeTypeField
08__u64session
88__u64request_id
168__u64request_deadline_ns
248__u64lifetime_deadline_ns
328__u64lease_deadline_ns

struct reg_src_renew_args #

Total size 32 bytes.

OffsetSizeTypeField
08__u64session
88__u64transaction_id
168__u64lifetime_deadline_ns
248__u64lease_deadline_ns

struct reg_src_hive_entry #

Total size 56 bytes.

OffsetSizeTypeField
04__u32name_len
44__u32_pad0
88__u64name_ptr
1616__u8``[16]root_guid
324__u32flags
364__u32_pad1
4016__u8``[16]scope_guid

Tracepoint diagnostic codes #

From uapi/pkm/trace.h. These are a diagnostic contract for ftrace, perf and eBPF consumers, letting a tool decode an lcs: event's reason, op or state field without recompiling against a specific kernel. No LCS syscall accepts or returns them, and values are append-only.

lcs_rsi_request op — which of the 18 RSI dispatch verbs a source-side request admission record describes. Emitted by lcs:lcs_rsi_request on successful queue admission and on the admission error rungs; the rung is read from ret (0 == enqueued, -EAGAIN == in-flight at limit / backpressure, -EIO == source gone / fd closing, -EOVERFLOW == request-id space exhausted, other == build reject). The same op enum tags the round-trip begin marker (lcs_rsi_roundtrip). Never records a pathname, key name, GUID, or frame bytes — only this op code, ids, counts and ret.

ConstantValueNotes
LCS_OP_LOOKUP0RSI_LOOKUP
LCS_OP_READ_KEY1RSI_READ_KEY
LCS_OP_ENUM_CHILDREN2RSI_ENUM_CHILDREN
LCS_OP_QUERY_VALUES3RSI_QUERY_VALUES
LCS_OP_SET_VALUE4RSI_SET_VALUE
LCS_OP_DELETE_VALUE5RSI_DELETE_VALUE_ENTRY
LCS_OP_BLANKET_TOMBSTONE6RSI_SET_BLANKET_TOMBSTONE
LCS_OP_DROP_KEY7RSI_DROP_KEY
LCS_OP_CREATE_ENTRY8RSI_CREATE_ENTRY
LCS_OP_HIDE_ENTRY9RSI_HIDE_ENTRY
LCS_OP_DELETE_ENTRY10RSI_DELETE_ENTRY
LCS_OP_CREATE_KEY11RSI_CREATE_KEY
LCS_OP_WRITE_KEY12RSI_WRITE_KEY
LCS_OP_TXN_BEGIN13RSI_BEGIN_TRANSACTION
LCS_OP_TXN_COMMIT14RSI_COMMIT_TRANSACTION
LCS_OP_TXN_ABORT15RSI_ABORT_TRANSACTION
LCS_OP_FLUSH16RSI_FLUSH
LCS_OP_DELETE_LAYER17RSI_DELETE_LAYER

lcs_rsi_response reason — the outcome of accepting/validating a source's RSI response frame, and the late-response effects that silently mark a source DOWN. ACCEPTED is the clean path; DESYNC / OP_MISMATCH / UNKNOWN_STATUS are the accept-time rejects that all surface as -EINVAL/-EIO; MALFORMED_PAYLOAD is a per-op body validation reject; the LATE_* codes mark a response whose deferred effect (commit/mutation/begin bookkeeping) failed and took the source DOWN. Verdict/outcome is also in ret. Never records name/GUID/frame bytes.

ConstantValueNotes
LCS_RESP_ACCEPTED0response matched an in-flight request
LCS_RESP_DESYNC1no matching delivered/unaccepted record
LCS_RESP_OP_MISMATCH2response op != request op | RESPONSE_BIT
LCS_RESP_UNKNOWN_STATUS3rsi_status not a known status code
LCS_RESP_MALFORMED_PAYLOAD4per-op response body failed validation
LCS_RESP_LATE_COMMIT_FAIL5commit late-effect failed; source DOWN
LCS_RESP_LATE_MUTATION_FAIL6mutation late-effect failed; source DOWN
LCS_RESP_LATE_BEGIN_FAIL7begin-txn late-effect failed; source DOWN

lcs_source_fd reason — which source-fd lifecycle transition a record marks.

OPEN is a fresh /dev/pkm_registry fd; the remaining codes are the entry points that drive a source to the DOWN/closing state. source_down_id is the source id that transitioned DOWN (0 if the call was a no-op). The semantic cause of a late-effect-driven DOWN is carried by lcs_rsi_response (LCS_RESP_LATE_*); here EXPLICIT/MARK_BY_ID are the mechanical transitions. No pathname/SD bytes.

ConstantValueNotes
LCS_SRC_OPEN0new source fd issued (post-TCB check)
LCS_SRC_RELEASE1fd .release() teardown
LCS_SRC_MALFORMED2malformed protocol frame -> mark down
LCS_SRC_EXPLICIT3explicit mark-down of this fd
LCS_SRC_MARK_BY_ID4mark-down requested by source id

lcs_in_flight reason — an in-flight RSI request table transition (kept lean; insert on admission, delivered when handed to the source's read(), release on response completion or teardown). in_flight_count is the post-transition depth. Emitted by lcs:lcs_in_flight.

ConstantValueNotes
LCS_IF_INSERT0request inserted into in-flight table
LCS_IF_DELIVERED1request delivered to source read()
LCS_IF_RELEASE2request released from in-flight table

lcs_route op — which resolution the lcs:lcs_route event describes.

ConstantValueNotes
LCS_ROUTE_HIVE_NAME0hive-name -> source/root resolution
LCS_ROUTE_ABSOLUTE_PATH1absolute-path -> source/root resolution
LCS_ROUTE_SYMLINK_TARGET2symlink-target -> source/root resolution

lcs_registration decision — the source registration path.

NEW/RESUME_DOWN are publish verdicts; COPY is the input-copy stage; REPLAY_FAIL/OVERFLOW_FAIL are resume post-publish -EIO paths that mark the resumed source down. Emitted by lcs:lcs_source_register / _registration_publish / _registration_copy.

ConstantValueNotes
LCS_REG_NEW0new source slot admitted
LCS_REG_RESUME_DOWN1down source slot resumed
LCS_REG_COPY2registration input copied from user
LCS_REG_REPLAY_FAIL3resume pending-delete replay failed (EIO)
LCS_REG_OVERFLOW_FAIL4resume overflow dispatch failed (EIO)

lcs_bootstrap stage — the phase of a bootstrap / self-config refresh.

Emitted by lcs:lcs_bootstrap_refresh / _self_config_refresh / _self_config_publish.

ConstantValueNotes
LCS_BOOT_REGISTRY0registry root discover phase
LCS_BOOT_KMES1kmes config root discover phase
LCS_BOOT_LAYERS2layer metadata root discover phase
LCS_BOOT_SELF_WATCH3self-watch arm phase
LCS_BOOT_COMPLETE4bootstrap refresh completed
LCS_BOOT_SELF_CONFIG_REFRESH5self-config refresh-from-key outcome
LCS_BOOT_SELF_CONFIG_PARAM_INVALID6self-config publish rejected a parameter

lcs_runtime_limits field_id — which runtime-limit field a validate reject names, or LCS_LIM_ALL for a successful whole-struct publish. Emitted by lcs:lcs_limits_validate (-EINVAL, value offending) and lcs:lcs_limits_publish.

ConstantValueNotes
LCS_LIM_REQUEST_TIMEOUT_MS0
LCS_LIM_TRANSACTION_TIMEOUT_MS1
LCS_LIM_NOTIFICATION_QUEUE_SIZE2
LCS_LIM_SYMLINK_DEPTH_LIMIT3
LCS_LIM_MAX_VALUE_SIZE4
LCS_LIM_MAX_KEY_DEPTH5
LCS_LIM_MAX_PATH_COMPONENT_LENGTH6
LCS_LIM_MAX_TOTAL_PATH_LENGTH7
LCS_LIM_MAX_LAYERS_PER_VALUE8
LCS_LIM_MAX_BOUND_TRANSACTIONS_PER_SOURCE9
LCS_LIM_MAX_READ_ONLY_TRANSACTIONS_PER_SOURCE10
LCS_LIM_MAX_TOTAL_LAYERS11
LCS_LIM_MAX_REGISTERED_SOURCES12
LCS_LIM_MAX_HIVES_PER_SOURCE13
LCS_LIM_MAX_CONCURRENT_RSI_REQUESTS14
LCS_LIM_MAX_SCOPE_GUIDS_PER_TOKEN15
LCS_LIM_MAX_PRIVATE_LAYERS_PER_TOKEN16
LCS_LIM_MAX_SUBTREE_WATCH_DEPTH17
LCS_LIM_MAX_TRANSACTION_WATCH_EVENT_BURST18
LCS_LIM_ALL19whole-struct publish (success)

lcs_audit event_type_id — which LCS audit event a record describes.

Emitted by lcs:lcs_audit_emit and lcs:lcs_audit_emit_failed. result_errno carries the op-specific numeric. No SD or raw GUID bytes; key GUID is a u64 hash.

ConstantValueNotes
LCS_AUDIT_KEY_OPEN0key-open SACL audit
LCS_AUDIT_BACKUP_START1
LCS_AUDIT_BACKUP_COMPLETE2
LCS_AUDIT_RESTORE_START3
LCS_AUDIT_RESTORE_COMPLETE4
LCS_AUDIT_VALIDATION_FAILURE5source validation-failure audit
LCS_AUDIT_SELF_CONFIG_INVALID6self-config-invalid audit

lcs_txn state — the transaction-fd state machine state carried in old_state new_state.

Emitted by lcs:lcs_txn_begin / _first_bind / _bind_mutation _commit / _abort / _timeout / _source_down.

ConstantValueNotes
LCS_TXN_ST_ACTIVE_UNBOUND0allocated, not yet source-bound
LCS_TXN_ST_ACTIVE_BOUND1bound to a source + root guid
LCS_TXN_ST_COMMITTED2commit round-trip succeeded
LCS_TXN_ST_ABORTED3aborted (close / layer writer abort)
LCS_TXN_ST_TIMED_OUT4deadline timer or commit timeout
LCS_TXN_ST_SOURCE_DOWN5bound source marked down

lcs_key_fd cmd — the key-fd ioctl verb (also stamped on lcs_key_mutation).

LCS_KCMD_NONE is used by publish/release/read. Never records key/name/SD bytes. Emitted by lcs:lcs_key_ioctl / _mutation.

ConstantValueNotes
LCS_KCMD_NONE0no ioctl verb (publish/release/read)
LCS_KCMD_SET_VALUE1
LCS_KCMD_DELETE_VALUE2
LCS_KCMD_BLANKET_TOMBSTONE3
LCS_KCMD_DELETE_KEY4
LCS_KCMD_HIDE_KEY5
LCS_KCMD_QUERY_VALUE6
LCS_KCMD_QUERY_VALUES_BATCH7
LCS_KCMD_ENUM_VALUES8
LCS_KCMD_ENUM_SUBKEYS9
LCS_KCMD_QUERY_KEY_INFO10
LCS_KCMD_GET_SECURITY11
LCS_KCMD_SET_SECURITY12
LCS_KCMD_FLUSH13
LCS_KCMD_BACKUP14
LCS_KCMD_RESTORE15
LCS_KCMD_NOTIFY16

Peios Learn — documentation for Peios software.

Built with Trail.