NetBSD Blog
" The Guide | Manual pages | Mailing lists and Archives | CVS repository | Report or query a bug | Software Packages
Home |<br>RSS |<br>Release engineering | Development | The NetBSD Foundation | Networking | General | Ports | Security | Events | Packages |<br>Login
Bookmarks
The NetBSD Project
NetBSD Wiki
Feeds
All
/Release engineering
/Development
/The NetBSD Foundation
/Networking
/General
/Ports
/Security
/Events
/Packages
Comments
Google Summer of Code 2026 Reports: Testing Compat Linux: Syscall testing
July 21, 2026 posted by Leonardo Taccari
This report was written by Henrique Brito as part of Google Summer of Code 2026.
Introduction & Description
NetBSD is capable of executing Linux compiled binaries through a thin, in-kernel translation layer, compat_linux, which, among many other things, is responsible for ‘capturing’ the syscalls made by the program and calling a stub, which is responsible for generating the expected output and behavior. Generally this stub ends up calling the NetBSD version of the syscall and translating the results in a way a Linux program would expect. Sometimes it has to do more work.
The goal is to use LTP, the already known and battle-tested Linux test suite, to check how close compat_linux is to a native Linux system. Focusing on the syscall aspect of it.
Current Status
Used the compat_linux and suse15_gcc12 to statically compile the LTP syscall-related tests
Updated the suse15_gcc12 to include the required RPMs for the compilation: glibc-devel, linux-glibc-devel and glibc-devel-static
Ran and documented tests for some of the most commonly used syscalls. Highlighted some interesting issues and results.
Created a package that allows easy testing with the LTP on NetBSD and compat_linux.
Next Steps
Improve the general user-friendliness
Fix some of the issues found with the tests
Development Environment & Testing Environment
Testing: Running NetBSD (10 and 11RC5) in a VM (QEMU on Linux) for testing
Writing code: Linux system with Debian 13
Testing
Tested compat_linux using the LTP test suite, running it with a custom script (from the package) that makes the tests work as expected on NetBSD.
Documenting
Comprehensive spreadsheet grouping the tests and notes made during the GSoC
Virtual Drive with the raw logs from the tests, for future reference and in-depth search
Experience, Observation, Impressions
I noticed that compat_linux is much more mature and resilient than I had originally thought. It manages pretty well most syscalls that stick with the POSIX standard, with the exception of some edge cases and some Linux exclusive features (like flags) that are not present in the NetBSD syscall equivalent.
Nevertheless, I have found many situations where compat_linux produces unexpected behavior and diverges from what a Linux program would expect.
[0 comments]
Slashdot It!<br>-->
" NetBSD 11.0 RC6... |<br>Main
Post a Comment:
Name:
E-Mail:
URL:
Remember Information?
Your Comment:
HTML Syntax:<br>NOT allowed
Contact | Disclaimer | Copyright © 1994-2015 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.
NetBSD® is a registered trademark of The NetBSD Foundation, Inc.