The library exposes Linux mechanisms through typed Go operations. The package index links each facility’s usage guide; those guides and GoDoc own detailed prerequisites, ownership, concurrency, errors, and omissions. Verification records observed environments, and verification limits records missing execution evidence.
| Dimension | Support boundary |
|---|---|
| Operating system | Linux 7.0 or newer; repository Go files use the linux build constraint |
| Native architectures | amd64 and arm64 |
| Go | Minimum Go 1.27.0, declared in go.mod; CI uses the configured image’s single toolchain |
| Implementation | Pure Go with maintained golang.org/x/sys/unix bindings and public runtime integration; no cgo or private runtime hooks |
| Runtime verification | Native architecture lanes and facility-specific isolation; exact Linux 7.0 is required by the baseline lanes specified in verification |
Newer kernels do not prove the Linux 7.0 baseline. Other architectures and non-Linux operating systems are outside the supported set. Kernel configuration, filesystem support, namespace ownership, seccomp/LSM policy, resource limits, and permissions remain separate requirements. No constructor promises that every operation will be permitted, and errors never silently select a weaker mechanism.
All rows assume the supported platform/toolchain and permission for the relevant syscalls. These are selection guidance; follow the linked guide for the operation’s exact contract.
| Facility | Additional requirements |
|---|---|
| memfd | Memory-backed file creation/sealing permitted; sealing state can irreversibly forbid later operations |
| mmap | Readable source for file mappings, write permission for shared writable mappings, coordinated mapping/truncation lifetime, and sufficient RLIMIT_MEMLOCK or privilege for memory locking |
| eventfd, timerfd, epoll | Descriptor creation, polling, and duplication permitted; ordinary operations need no extra capabilities; timer clocks remain explicit |
| pidfd | Process-handle operations permitted, with ptrace attach permission and applicable security policy for file duplication. Reaping requires an eligible child and one designated reaper. |
| process | Child-subreaper prctl and waitid permitted. A dedicated supervisor owns the eligible child wait set. |
| file | Path access and filesystem support for the selected operation. Allocation requires a writable handle, and readahead requires a readable handle. |
| xattr | Filesystem and attribute-namespace support plus access to the selected object; system/security attributes can require privilege |
| inotify | Access to watched objects and available per-user watch/instance capacity; consumers must reconcile reported queue overflow |
| fanotify | CONFIG_FANOTIFY and initial-user-namespace CAP_SYS_ADMIN for the supported classes; permission events also require CONFIG_FANOTIFY_ACCESS_PERMISSIONS |
| mount | Modern mount API, filesystem support, applicable CAP_SYS_ADMIN, and an explicitly isolated/private mount namespace before mutations |
| socket | Unix/Netlink message sockets permitted; protocol, multicast, and file-passing permissions apply; use standard net for TCP/UDP/streams |
| netlink, netlink/route | Selected kernel protocol/family/groups available; routing mutations normally require CAP_NET_ADMIN in the applicable network namespace |
| namespace | Namespace kernel support, applicable authority/quotas, and permitted transitions; new user namespaces/mappings use standard Go child startup |
| cgroup | A v2 hierarchy; mutations require an explicit writable delegation with the requested controllers enabled and correct topology |
| sched | An eligible CPU for the requested affinity, applicable authority for priority, and kernel admission for deadline budgets |
| rlimit | Target credentials or authority in its user namespace. Raising a hard limit requires initial-user-namespace CAP_SYS_RESOURCE. |
| uring | An enabled io_uring facility, permitted setup and enter syscalls, and files supporting the requested operations. Fixed I/O, cancellation, and eventfd notifications need the register syscall. Fixed buffers also need sufficient locked memory. |
| perf | A permitted perf_event_open under the runner’s syscall policy and perf_event_paranoid setting. Hardware and raw events require a compatible PMU. |
| capability | Thread credential operations permitted; bounding-set drops require CAP_SETPCAP, and existing permitted/inheritable sets constrain transitions |
| seccomp | Kernel filter support and either no-new-privileges or applicable CAP_SYS_ADMIN; policies must accommodate the workload and Go runtime |
| landlock | Landlock enabled and the ABI required by selected rights/synchronization; enforcement uses no-new-privileges or applicable authority |
| procfs, sysfs | Explicit trusted readable roots and access to requested entries; visibility need not be container-local or an atomic snapshot |
Use a dedicated locked goroutine and bounded subprocess where the package guide requires it for thread-local namespaces, credentials, or irreversible restrictions. Root or capability observations alone do not prove an operation works. The library never changes the shared host’s clocks, creates a cgroup delegation, or supplies a complete sandbox automatically.
This index describes the 26 facilities against the selected storage, worker, and container scenarios. Implemented means the listed contract is callable; it does not mean every Linux interface in that family is wrapped. Partial identifies missing mechanisms needed to extend those scenarios. Absent means this module has no public operation for the capability. Externally supplied and excluded boundaries appear below. Detailed operations, accepted flags, returned fields, and omissions belong to the linked usage guides.
The comparison uses the versioned Linux 7.0 UAPI, its memory definitions, and the v2 cgroup contract, alongside the public APIs. It is a scope comparison; operation evidence and configuration-specific limits remain in the verification guides.
| Facility | Coverage | Current Linux-specific contribution and boundary |
|---|---|---|
| memfd | Implemented | Anonymous files, all six named baseline seals, executable opt-in, and independently owned mappings; ordinary I/O uses Go file behavior. Huge-page creation and opaque-file passing are omitted. |
| eventfd | Implemented | Accumulating/semaphore counters, record I/O, deadlines, and typed epoll registration. Go channels and mutexes remain the ordinary in-process choice. |
| timerfd | Implemented | Relative/absolute timers on three explicit clocks, periodic counts, realtime cancellation, deadlines, and epoll registration. Wakeup/alarm clocks and tick injection are omitted. |
| mmap | Partial | Owned anonymous and file mappings with shared/private views, resizing, protection, synchronization, immediate and on-fault locks, page residency, and whole-region advice for reclamation, inheritance, dumps, population, huge pages, and guards. |
| pidfd | Partial | Stable acquired process identity, signals, exit observation, designated child reaping, and owned duplicates of open target files. Waiting on a selected set of handles is outside the current coverage. |
| process | Implemented | Process-wide child-subreaper controls and blocking or nonblocking wait-any for eligible children, including adopted descendants. Startup and signal handling use standard Go. |
| mount | Partial | Filesystem configuration and reconfiguration, detached creation and cloning, mount restrictions, atime, propagation, detached ID mapping, attachment, root switching, diagnostics, unmount, and discovery. Replacing or clearing an existing ID mapping is outside the current coverage. |
| epoll | Implemented | Owned registrations, identity-preserving readiness, level/edge/one-shot modes, bounded waits, and close interruption. Ordinary Go I/O retains runtime polling; signal-mask waits and power/exclusive controls are omitted. |
| file | Partial | Restricted openat2 lookup, unnamed temporary files and publication, direct and synchronous opening, statx metadata including direct-I/O alignment, subvolume identity and atomic-write limits, atomic rename modes including whiteouts, range allocation, hole punching, zero-range, collapse, insert, reflink unsharing, write-zeroes, access advice, readahead, file data and filesystem synchronization, and advisory whole-file and POSIX/OFD byte-range locks on standard files. Issuing atomic data writes is outside this surface. |
| xattr | Implemented | Handle/relative-path byte attributes, atomic create/replace, bounded reads, and visible-name enumeration. ACL, capability, and security-label interpretation remain external. |
| inotify | Implemented | Native watch conditions/options, complete-record decoding, rename cookies, explicit overflow, and synchronous iteration. Recursive watch management and reconciliation policy remain external. |
| fanotify | Implemented | Descriptor notification/content groups, scoped marks, event-file inspection, allow/deny decisions, and bounded reading. FID/name, PIDFD, pre-content, and other reporting modes are omitted. |
| socket | Implemented | Unix datagram/seqpacket messages, file transfer, credentials, deadlines, and Netlink transport. Standard net owns ordinary stream/Internet networking. |
| netlink | Implemented | Framing, attributes, ACK diagnostics, matched requests/dumps, multicast/loss, and Generic Netlink family discovery. Family-specific policy and automatic resynchronization remain external. |
| netlink/route | Partial | Link, address, neighbor, route, nexthop, and rule observations and notifications. Configure dummy links, veth pairs, bridges and membership, namespace moves, selected addresses and routes, ordinary IPv4/IPv6 neighbors, policy rules, weighted inline routes, and shared nexthop objects. Resolve flows against kernel policy. Route metrics and encapsulation mutations and resilient group management remain outside the typed API. |
| namespace | Implemented | Eight handle types, identity/hierarchy, adoption, and explicit supported thread transitions. New-user-namespace startup/mappings use Go child startup; hostname and time-offset mutation are omitted. |
| cgroup | Implemented | Explicit delegated v2 handles, atomic command placement, process migration, CPU limits and utilization clamps, local CPU throttling, memory and swap controls and accounting, proactive memory reclaim, PIDs limits, peaks and events, block I/O controls and statistics, pressure snapshots, cpuset placement and partitions, HugeTLB, RDMA, misc, and device-memory controls and accounting, subtree freezing and kill, and event snapshots/watchers. |
| sched | Partial | Dynamic CPU affinity, scheduling policies with nice, real-time priority, deadline budgets and utilization clamps, and thread or process-group block I/O priority. SCHED_EXT policy identity is observable. External BPF schedulers own its configuration. |
| rlimit | Implemented | All 16 baseline resources, exact unsigned soft and hard limits, and atomic replacement with previous limits for the current process or a numeric PID. |
| uring | Partial | Bounded owned io_uring queues with asynchronous positional and vectored I/O, whole-file sync, soft-linked operations, one-shot polls and timeouts, bounded waits, eventfd completion notifications, cancellation by request ID, close draining, and fixed file and buffer tables. |
| perf | Partial | Owned software, hardware, and raw counters, fixed event groups, task and CPU targeting, count inheritance, raw counts with IDs and timing, and bounded forward sampling streams with loss and throttle records. |
| capability | Implemented | All 41 baseline capability masks, thread sets, bounding drops, and ambient controls. Go child credentials/ambient setup complement this; securebits and file-capability policy are omitted. |
| seccomp | Partial | Native classic-BPF construction, ABI guards, selected actions, action discovery, thread/all-thread loading, and calling-thread notification listeners with ID validation, synthetic or continue responses, and file injection with separate or atomic replies. |
| landlock | Implemented | Baseline ABI 8 filesystem/TCP/scoped IPC policy, logging, and kernel all-thread restriction; explicit optional newer rights. Errata discovery and newer rule interfaces are omitted. |
| procfs | Implemented | Selected process, descriptor, mapping, mount, system CPU, and memory observations through a private Prometheus backend. Path views do not pin process identity or provide exhaustive procfs capture. |
| sysfs | Implemented | Block/network discovery, selected typed identity fields, and bounded explicit attribute reads through a private Prometheus backend. No mutation or device-specific control. |
The expansion families below are absent, including their proposed package homes. They are not additional shipped packages or API promises. The execution queue owns their implementation sequence; new guides and dependencies arrive with callable capabilities.
| Capability and proposed home | Application contract | Implementation route |
|---|---|---|
Workload eBPF: bpf |
Compiled-program loading, maps, cgroup traffic accounting, tracepoints, and event readers | Cilium eBPF is the selected future internal backend; it is not yet a module dependency. |
Fault handling: userfaultfd |
Negotiated registration, missing/write-protect/minor fault resolution, and lifecycle events | Internal typed fault/mapping owners over Linux bindings; full checkpoint orchestration remains external. |
Workload credentials: keyring |
Private rings/keys, permissions, requests, and expiry | Internal typed key-management operations; no application secret-management policy. |
Priority IPC: mqueue |
POSIX queue identity, message priorities, timing, and readiness | Internal Linux queue operations; no stream abstraction that loses records/priorities. |
Persistent IPC: sysvipc |
System V queues, atomic semaphore sets, and shared-memory attachments | Internal typed operations with explicit removal and mapping lifetimes. |
Existing file, mmap, mount, pidfd, seccomp, and the new scheduling/IPC owners should first reuse x/sys operations where they fit. Complex routing extensions will evaluate vishvananda/netlink; cgroup extensions will evaluate containerd/cgroups. Those are evaluation candidates, not current dependencies or decided backend replacements. The API conventions require any adapter to retain project-owned types, ownership, errors, and namespace behavior. Cilium is the selected eBPF backend because the expanded loading/relocation/BTF work is substantial; its types and descriptors must remain private when introduced.
Use os.File/os.Root for ordinary storage, ReadAt/WriteAt for positioned I/O, Truncate for logical sizing, and File.Sync for its standard synchronization contract. Add file for restricted lookup, metadata, atomic rename, log preallocation, or sparse-range changes. Use xattr for byte metadata and mmap for mapped indexes or shared buffers. Call Region.Sync to wait for shared mapped data writeback. Database layout, transaction ordering, logging, and crash recovery belong to the application.
Use os/exec to start workers, Go pipes/message sockets for coordination, and pidfd.OpenProcess for independent stable exit observation/signaling. Keep Cmd.Wait as the reaper for a managed command. A dedicated process supervisor can adopt descendants and collect their exits after separately managed startup children have been reaped. Counters/timers can join epoll through typed registration; procfs/sysfs supply non-atomic observations. Use sched for thread CPU placement. Closing handles does not terminate workers, flush mappings, undo restrictions, or remove persistent kernel objects.
| Stage | Existing contribution | Missing mechanism or external owner |
|---|---|---|
| Prepare rootfs | Standard Go file operations, file, xattr, and detached mount trees |
The application supplies image fetching and unpacking, filesystem formatting, and device policy. |
| Establish isolation | Standard exec.Cmd.SysProcAttr clone/unshare flags and UID/GID mappings; namespace handles/explicit entry |
Use Go’s pre-runtime child setup for new user namespaces. UTS identity/time-offset configuration is outside the current API; selecting a namespace alone does not configure it. |
| Activate root | Private propagation, mount attachment, mount.PivotRoot, and explicit old-root detachment |
The application starts the isolated child, prepares the root tree and old-root directory, and controls working-directory changes and cleanup. |
| Place resources | Explicit cgroup delegation, limits, Group.Start for new commands, AddProcess for existing processes, and resource limits |
The runtime supplies the delegation, configures the leaf, and coordinates later migration or limit changes. A cooperating worker can apply its resource limits before starting work. |
| Connect networking | Standard net I/O, veth pairs, bridge membership, namespace moves, and typed address/route operations |
IP allocation, DNS, forwarding policy, and NAT/firewalls are external. Connect a workload to a bridge. |
| Set credentials/restrictions and exec | Standard child credentials/ambient setup, explicit capability operations, seccomp, and Landlock | Caller chooses order, executable, allowed resources, and policy. Go offers no general pre-exec Go callback; a reexecuted setup child must apply library operations before starting the workload. |
| Supervise and reap | pidfd signals and exit observation, process orphan adoption and wait-any reaping, standard Cmd.Wait and os/signal |
The application chooses each child’s reaper, handles signal forwarding, and owns restart policy. |
| Observe and tear down | Mount discovery, procfs/sysfs snapshots, cgroup events and recursive kill, explicit handle close, unmount, and empty-group removal | Workload BPF observation is absent. The application orders workload termination and reaping, attachment release, unmount, and object removal. |
NAT/firewall configuration should compose with google/nftables or the application’s existing networking stack. Full checkpoint/restore should compose with CRIU and go-criu. OCI runtime lifecycle, CNI plugins/IPAM, image distribution, cluster scheduling/reconciliation, security policy compilation, and general init policy remain externally supplied, without becoming dependencies of this module. Their integration needs separate actual workload evidence; a package inventory does not establish a working container runtime.
The library follows Go module compatibility and semantic versioning. Public package/import paths, exported names and types, documented zero values, flag/mode meanings, ownership, error matching, and blocking/close semantics are compatibility surfaces. New optional facilities may arrive in a minor version. Incompatible changes require a new major module path, subject to the ordinary Go compatibility exceptions for correcting security defects and clearly incorrect behavior.
Linux errno identity is preserved through errors.Is/errors.As; error text is diagnostic rather than a machine-readable format. Unknown kernel output values are preserved where documented. Successful ownership transfer and Adopt failure consumption remain explicit; borrowing leaves the original resource caller-owned. Closing a local handle is distinct from undoing a kernel effect. API conventions define those shared design decisions.
The Linux floor and supported native architectures are part of the support contract. The Go minimum follows maintained Go releases and may advance in a documented minor release; consumers should check go.mod before upgrading. Verification evidence applies to its recorded revision and environment, not every kernel configuration or future toolchain.
Internal packages and implementation dependencies are outside the stable library API; callers must not depend on upstream procfs types leaking through project packages.
To migrate from v1, add the v2 module with go get github.com/alexfalkowski/go-linux/v2, then insert /v2 after go-linux in each import path. Update calls that used the boolean selectors below and run go mod tidy. Zero options continue to select the previous defaults.
| Previous selector | Replacement |
|---|---|
file.StatOptions.NoFollow, NoAutomount |
Flags: file.StatNoFollow, file.StatNoAutomount, or file.StatNoFollow \| file.StatNoAutomount |
xattr.PathOptions.NoFollow |
Symlinks: xattr.NoFollowFinalSymlink |
memfd.Options.Executable |
Execution: memfd.AllowExecute |
mount.AttributeChange.Recursive |
Scope: mount.MountTree |
netlink.Options.StrictCheck |
Validation: netlink.StrictValidation |
seccomp.Options.NoNewPrivileges, landlock.Options.NoNewPrivileges |
Privileges: seccomp.SetNoNewPrivileges or landlock.SetNoNewPrivileges, respectively |
seccomp.Options.Log |
Flags: seccomp.LogNonAllow |
socket.UnixAddress.Pathname |
Interpretation: socket.LiteralPathname |
Conn.SetPassCredentials, SetExtendedAck, SetCapAck, SetStrictCheck |
Use the corresponding Enable…() or Disable…() method. |
The absent expansion families in the coverage index are future work. Device-specific APIs, raw futex interfaces, direct signal management, a general profiler, a checkpoint engine, and a secret-management product are excluded from this sequence. The selected eBPF scope excludes XDP/TCX, LSM and device policy, scheduler programs, compilation tooling, and persistent pin management. It does not rebuild os, net, time, sync, or os/exec. Facility-specific omissions remain in their usage guides, and verification limits records source-reviewed paths without direct execution evidence.
Descriptors and syscall plumbing stay internal to facility owners; use concrete typed operations and standard Go resource interfaces where provided. Namespace, capability, seccomp, and Landlock mechanisms do not together imply a complete container runtime or security policy. Kernel and application guarantees must be evaluated for the actual operation and workload.
The device-memory test module carries a GPL-2.0 license. The MIT license covers the remaining repository-owned code. After make dep, the current dependency license files are available at these checkout paths; vendor/ is generated and is not committed:
| Module | Version | License files |
|---|---|---|
github.com/prometheus/procfs |
v0.23.0 | Apache-2.0: vendor/github.com/prometheus/procfs/LICENSE and NOTICE |
golang.org/x/sys |
v0.50.0 | BSD-3-Clause: vendor/golang.org/x/sys/LICENSE |
golang.org/x/sync |
v0.24.0 | BSD-3-Clause: vendor/golang.org/x/sync/LICENSE |
github.com/stretchr/testify |
v1.12.1 | MIT: vendor/github.com/stretchr/testify/LICENSE; bundled BSD/ISC terms: internal/difflib/LICENSE and internal/spew/LICENSE within that directory |
go.yaml.in/yaml/v3 |
v3.0.5 | File-specific MIT/Apache-2.0: vendor/go.yaml.in/yaml/v3/LICENSE and NOTICE |
go.mod, go.sum, and vendor/modules.txt own the resolved versions; preserve the applicable dependency licenses/notices when redistributing their source or binaries. The project MIT license does not replace dependency terms. testify and YAML serve the test harness; procfs/sysfs use the private Prometheus dependency, with x/sys supplying native bindings.