add-syscall
Skill20k starsChanged 3 months agoApache-2.0View on GitHub
Add or extend a Linux syscall in gvisor. Handles two cases: (1) Adding a brand-new syscall that currently returns ENOSYS or is missing from the table. (2) Adding missing flags/options to an existing partially-supported syscall (e.g., a new prctl option, ioctl command, or socket option). Use when asked to implement a syscall, add a flag, or improve compatibility for a specific syscall.
Trending
Less talk lately.about the whole repository
Who's talking about google/gvisor
- A Hacker News story“Go CheckLocks Analyzer”Hacker News · Dec 29, 2021 · 94 points
- cncf/sandbox“[Sandbox] gVisor”GitHub · Sep 7, 2026 · 45 reactions
- A Hacker News story“Gvisor: Application Kernel for Containers”Hacker News · Jan 3, 2024 · 26 points
- golang/go“all: remove nacl port”GitHub · Feb 27, 2019 · 26 reactions
- Homebrew/homebrew-core“go 1.26.0, go@1.25 1.25.7 (new formula)”GitHub · Dec 16, 2025 · 12 reactions
The biggest 5 of 44 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 44
Talked about on GitHub, Hacker News and Bluesky (44 times).
On GitHub · 35
- Sep 7, 2026[Sandbox] gVisor — cncf/sandbox45 reactions · 13 comments
- Feb 27, 2019all: remove nacl port — golang/go26 reactions · 55 comments
- Dec 16, 2025go 1.26.0, go@1.25 1.25.7 (new formula) — Homebrew/homebrew-core12 reactions · 10 comments
- Jul 23, 2022tun/netstack: bump to latest gvisor — WireGuard/wireguard-go5 reactions · 1 comment
- May 2, 2018x/playground: use gVisor on linux/amd64 binaries instead of NaCl for sandboxing — golang/go4 reactions · 57 comments
30 more on GitHub
- Jul 7, 2024Disable racy `EpollTest.UnblockWithSignal` — asterinas/asterinas3 reactions · 8 comments
- Feb 8, 2019Proposal & looking for feedback: fostering more of a community — u-root/u-root3 reactions · 4 comments
- May 8, 2018pre-fetch all dependencies for build envs without network — bazelbuild/bazel3 reactions · 5 comments
- Jul 6, 2026Report `ENOMEM` in `mmap()` if the address is not in user space (even if it is not page-aligned) — asterinas/asterinas2 reactions
- Feb 10, 2026Does not build with Go 1.26rc3 — netbirdio/netbird2 reactions · 2 comments
- Mar 29, 2024Does not search all specified devcontainer locations — coder/envbuilder2 reactions
- Feb 18, 2024Add support for gVisor — pdtpartners/nix-snapshotter2 reactions · 1 comment
- Jun 18, 2020maybe u could refer this project — PioneerIncubator/betterGo2 reactions · 2 comments
- May 2, 2018package request/idea: gvisor — NixOS/nixpkgs2 reactions · 1 comment
- Oct 24, 2026Allow root-module Linux header defaults — hermeticbuild/hermetic-llvm1 reaction · 3 comments
- Aug 4, 2026tools/gvisor-smoke-test.sh: Unmount `null-netns` before workdir cleanup — google/syzkaller1 reaction · 1 comment
- Jul 3, 2026Support gvisor and sandboxed nodes in Karpener — cloudpilot-ai/karpenter-provider-gcp1 reaction · 1 comment
- Feb 8, 2026[gvisor-tests] Nightly Summary: gVisor Syscall Analysis [2026-02-08] - 93 Syscalls Verified ✅ — lpcox/aw-litebox1 reaction
- Oct 28, 2025proposal: package to parse coverage data — golang/go1 reaction · 6 comments
- Sep 8, 2025Support container checkpoint/restore for gVisor runtime — containerd/containerd1 reaction · 8 comments
- Aug 23, 2025Preview / Blocked by upstream: MLX on three clouds: Fal, Modal, Replicate — mflux-community/mflux1 reaction · 2 comments
- Aug 15, 2025ci: automatically bump GVISOR_VERSION file — gardener/gardener-extension-runtime-gvisor1 reaction
- Mar 13, 2025Add way to specify `--runtime-flag` in `containers.conf` — podman-container-tools/podman1 reaction · 9 comments
- Dec 15, 2023tools/docker/syzbot: add libbpf-dev to Dockerfile — google/syzkaller1 reaction · 2 comments
- May 9, 2023wgengine/netstack: switch to cubic congestion control — tailscale/tailscale1 reaction · 5 comments
- Mar 24, 2021Explore circumvention of Iran's "Protocol Whitelister" — celzero/firestack1 reaction · 5 comments
- Nov 2, 2026chore: bump gVisor to 20261026.0 — Vincinator/gardener-extension-runtime-gvisor0 reactions
- Oct 30, 2026chore: bump gVisor to 20261026.0 — gardener/gardener-extension-runtime-gvisor0 reactions · 6 comments
- Oct 26, 2026chore: bump gVisor to 20261019.0 — Vincinator/gardener-extension-runtime-gvisor0 reactions
- Oct 19, 2026chore: bump gVisor to 20261012.0 — Vincinator/gardener-extension-runtime-gvisor0 reactions
- Oct 12, 2026chore: bump gVisor to 20261005.0 — Vincinator/gardener-extension-runtime-gvisor0 reactions
- Oct 5, 2026chore: bump gVisor to 20260928.0 — Vincinator/gardener-extension-runtime-gvisor0 reactions
- Sep 28, 2026chore: bump gVisor to 20260921.0 — Vincinator/gardener-extension-runtime-gvisor0 reactions
- Sep 21, 2026chore: bump gVisor to 20260914.0-staging — Vincinator/gardener-extension-runtime-gvisor0 reactions
- Sep 14, 2026chore: bump gVisor to 20260907.0-staging — Vincinator/gardener-extension-runtime-gvisor0 reactions
On Hacker News · 7
- Dec 29, 2021Go CheckLocks Analyzer94 points · 19 comments
- Jan 3, 2024Gvisor: Application Kernel for Containers26 points · 5 comments
- May 8, 2018gVisor: Container Runtime Sandbox, a user-space kernel for containers9 points · 1 comment
- May 2, 2018GVisor: Google Sandboxed Container Runtime6 points
- May 3, 2018Google created generics for Go5 points
2 more on Hacker News
- May 4, 2018GVisor: making it simple to run sandboxed containers2 points
- Aug 21, 2018Gvisor1 point
On Bluesky · 2
- Aug 16, 2026gvisor by @GoogleOSS (⭐️ 19094) Application Kernel for Containers #go — @golangoss.bsky.social1 likes and repost
- May 10, 2018A new runtime on AppEngine: node.js Serverless, autoscaled, fully managed, and built on state of the art open source container on bare… — @martin-gorner.bsky.social0 likes and reposts · 1 reply
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- images/systemd-user/gnome-mcp/AGENTS.mdAGENTS.md
- update-gvisor-maintainersSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
32 rules. About 0 are common, 8 are distinctive, and 24 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
24
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 63
Wait for user confirmation before proceeding.
- Distinctive: line 67
Follow this checklist — not all steps apply to every change:
- Distinctive: line 71
Add any missing constants to the appropriate file
- Very specific: line 72
Follow the existing naming convention (e.g., PR_ prefix for prctl, CLONE_ for clone flags)
- Very specific: line 74
Add a one-line comment matching the Linux kernel comment style: // PR_FOO does bar.
- Very specific: line 76
If adding a new struct, use pkg/marshal for user-space copying
- Very specific: line 80
New syscall: Create sys_<name>.go with the handler function.
- Very specific: line 87
New flag on existing syscall: Add a case to the existing switch statement
- Very specific: line 90
Use linuxerr package for errors (e.g., linuxerr.EINVAL, linuxerr.EPERM)
- Very specific: line 93
Use t.CopyIn* / t.CopyOut* or primitive.Copy* for userspace memory access
- Very specific: line 96
Use hostarch.Addr for user pointers: args[N].Pointer()
- Very specific: line 98
Use args[N].Int(), args[N].Uint(), args[N].Uint64() for scalar arguments
- Very specific: line 107
Improved existing: Update PartiallySupported note to reflect newly supported options, or upgrade to Supported if fully implemented
- Very specific: line 114
Add new .go files to srcs in pkg/sentry/syscalls/linux/BUILD
- Very specific: line 115
Add any new package dependencies to deps
- Very specific: line 116
Add new ABI files to pkg/abi/linux/BUILD if created
- Very specific: line 126
Add or extend C++ tests in test/syscalls/linux/<syscall>.cc
- Very specific: line 127
Use the gtest framework with gvisor's test utilities:
- Very specific: line 131
Add test to test/syscalls/linux/BUILD if it's a new file
- Distinctive: line 132
Test both the happy path and error cases
- Very specific: line 160
Run the native test FIRST and iterate until it passes: If the native test fails, the test itself is buggy — fix the test before touching …
- Very specific: line 176
After the native test passes, verify the gvisor code compiles:
- Distinctive: line 182
If ABI constants changed:
- Very specific: line 190
After the native test passes and the gvisor implementation compiles, run the test under gvisor to verify the implementation is correct:
- Very specific: line 204
Write/update the C++ test in test/syscalls/linux/<syscall>.cc
- Distinctive: line 206
If it fails → fix the test (it's a bug in the test, not Linux)
- Very specific: line 209
Run bazel test //test/syscalls:<syscall>_test_runsc_ptrace_shared --test_output=errors
- Very specific: line 211
If it fails → fix the gvisor implementation and repeat from step 5
- Very specific: line 261
Always handle the default: case in switch statements
- Very specific: line 262
Use t.Kernel().EmitUnimplementedEvent(t, sysno) before returning ENOSYS for deliberate non-implementation — this enables tracking of …
- Distinctive: line 265
Prefer returning errors over panicking
- Distinctive: line 266
Consider both amd64 and arm64 when the syscall exists on both architectures
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add or extend syscall: $target
You are adding or extending Linux syscall support in gvisor. The target is: $target
Phase 1: Understand the current state
Check the syscall table — search
pkg/sentry/syscalls/linux/linux64.gofor the syscall name. Determine:- Is it registered? (has a table entry)
- What is its support level? (
Supported,PartiallySupported,ErrorWithEvent,Error) - What handler function is it mapped to?
Read the existing implementation (if any) — find the handler in
pkg/sentry/syscalls/linux/sys_*.go. Look for:- Which flags/options are already handled
- Which flags fall through to
default:/ returnEINVAL/ENOSYS - The function signature pattern:
func Name(t *kernel.Task, sysno uintptr, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)
- Check existing ABI constants — look in
pkg/abi/linux/for the relevant constants file (e.g.,prctl.go,ioctl.go,socket.go) - Read the Linux man page / kernel source — use WebSearch or WebFetch to
look up the exact Linux behavior for the syscall or flag. This is critical
for correctness. Search for the man page (e.g.,
man 2 prctl) and/or relevant kernel source.
Phase 2: Plan the changes
Present the user a summary before writing code:
- What the target syscall/flag does in Linux
- What changes are needed in gvisor (list files)
- Any kernel subsystems that need new support (e.g., new task fields, VFS operations)
- Whether this can be a simple implementation or needs deeper infrastructure
Wait for user confirmation before proceeding.
Phase 3: Implement
Follow this checklist — not all steps apply to every change:
A. ABI Constants (pkg/abi/linux/)
- Add any missing constants to the appropriate file
- Follow the existing naming convention (e.g.,
PR_prefix for prctl,CLONE_for clone flags) - Add a one-line comment matching the Linux kernel comment style:
// PR_FOO does bar. - If adding a new struct, use
pkg/marshalfor user-space copying
B. Syscall Implementation (pkg/sentry/syscalls/linux/sys_*.go)
New syscall: Create
sys_<name>.gowith the handler function. Follow the standard signature:func SyscallName(t *kernel.Task, sysno uintptr, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error) {- New flag on existing syscall: Add a
caseto the existing switch statement - Use
linuxerrpackage for errors (e.g.,linuxerr.EINVAL,linuxerr.EPERM) - Use
t.CopyIn*/t.CopyOut*orprimitive.Copy*for userspace memory access - Use
hostarch.Addrfor user pointers:args[N].Pointer() - Use
args[N].Int(),args[N].Uint(),args[N].Uint64()for scalar arguments
C. Syscall Table (pkg/sentry/syscalls/linux/linux64.go)
- New syscall: Change from
syscalls.ErrorWithEvent(...)orsyscalls.Error(...)tosyscalls.Supported("name", HandlerFunc)orsyscalls.PartiallySupported("name", HandlerFunc, "note about limitations", nil) - Improved existing: Update
PartiallySupportednote to reflect newly supported options, or upgrade toSupportedif fully implemented - The table has entries for both AMD64 and ARM64 — update both if the syscall applies to both architectures
D. BUILD files
- Add new
.gofiles tosrcsinpkg/sentry/syscalls/linux/BUILD - Add any new package dependencies to
deps - Add new ABI files to
pkg/abi/linux/BUILDif created
E. Kernel/Sentry Support (if needed)
- New task-level state →
pkg/sentry/kernel/task.goor related - New filesystem operations →
pkg/sentry/vfs/orpkg/sentry/fsimpl/ - New network features →
pkg/tcpip/
F. Tests (test/syscalls/linux/)
- Add or extend C++ tests in
test/syscalls/linux/<syscall>.cc - Use the gtest framework with gvisor's test utilities:
SyscallSucceeds(),SyscallFailsWithErrno(EINVAL), etc. fromtest/util/test_util.hASSERT_NO_ERRNO_AND_VALUE()for operations that return PosixErrorOr
- Add test to
test/syscalls/linux/BUILDif it's a new file - Test both the happy path and error cases
Phase 4: Test-driven verification against native Linux
The test MUST pass on native Linux first. This ensures the test itself is correct before running it inside gvisor. Native test targets run the C++ test binary directly on the host kernel.
Step 1: Run the native test
The native test target naming convention is:
bazel test //test/syscalls:<syscall>_test_nativeFor example:
bazel test //test/syscalls:access_test_native
bazel test //test/syscalls:prctl_test_native
bazel test //test/syscalls:eventfd_test_nativeThe native target is auto-generated by the syscall_test() macro in
test/syscalls/BUILD from the cc_binary in test/syscalls/linux/BUILD. It
runs with --platform=native (directly on the host kernel, no gvisor sandbox).
Run the native test FIRST and iterate until it passes. If the native test fails, the test itself is buggy — fix the test before touching the gvisor implementation.
bazel test //test/syscalls:<syscall>_test_native --test_output=errorsTo run a specific test case:
bazel test //test/syscalls:<syscall>_test_native --test_output=errors --test_arg=--gtest_filter='TestSuite.TestCase'Step 2: Build the gvisor implementation
After the native test passes, verify the gvisor code compiles:
bazel build //pkg/sentry/syscalls/linux/...If ABI constants changed:
bazel build //pkg/abi/linux/...Step 3: Run the gvisor (runsc) test
After the native test passes and the gvisor implementation compiles, run the test under gvisor to verify the implementation is correct:
bazel test //test/syscalls:<syscall>_test_runsc_ptrace_shared --test_output=errorsThis test MUST pass. If it fails, the gvisor implementation has a bug — fix the implementation and re-run until it passes.
Iterative workflow
The expected loop is:
- Write/update the C++ test in
test/syscalls/linux/<syscall>.cc - Run
bazel test //test/syscalls:<syscall>_test_native --test_output=errors - If it fails → fix the test (it's a bug in the test, not Linux)
- Once native passes → implement/update the gvisor handler
- Build gvisor:
bazel build //pkg/sentry/syscalls/linux/... - Run
bazel test //test/syscalls:<syscall>_test_runsc_ptrace_shared --test_output=errors - If it fails → fix the gvisor implementation and repeat from step 5
Key patterns to follow
Error handling
// Return Linux error codes from linuxerr package
return 0, nil, linuxerr.EINVAL
return 0, nil, linuxerr.EPERM
return 0, nil, linuxerr.ENOSYSCopying data to/from userspace
// Copy a single int32 to userspace
_, err := primitive.CopyInt32Out(t, args[1].Pointer(), value)
// Copy a struct from userspace
var s SomeStruct
_, err := s.CopyIn(t, args[0].Pointer())
// Copy a string from userspace
name, err := t.CopyInString(addr, maxLen)Unimplemented options pattern
// For options you deliberately don't implement, emit an event:
t.Kernel().EmitUnimplementedEvent(t, sysno)
return 0, nil, linuxerr.ENOSYSCredential checks
creds := t.Credentials()
if !creds.HasCapabilityIn(linux.CAP_SYS_ADMIN, creds.UserNamespace) {
return 0, nil, linuxerr.EPERM
}Important notes
- Match Linux behavior exactly — check the man page and kernel source for edge cases
- gvisor does NOT have a real kernel, so some things (hardware access, kernel modules) cannot be implemented — stub them with appropriate errors
- Always handle the
default:case in switch statements - Use
t.Kernel().EmitUnimplementedEvent(t, sysno)before returning ENOSYS for deliberate non-implementation — this enables tracking of missing features - Prefer returning errors over panicking
- Consider both amd64 and arm64 when the syscall exists on both architectures
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

