HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
matheusmoreira
liblinux
Rust2020–2026
matheusmoreira / liblinux

liblinux

Linux system calls in Rust

4Distinct people
22Mentions
0Explicit recommenders
4GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Linux system calls in Rust

GitHub

Where it is used

The source check is incomplete. Verified examples will appear here.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 3:30:57 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year22 dated mentions

Observed mentions: 2020-03-26 18:52:45 UTC to 2026-08-19 13:28:30 UTC.

02468102020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 9 mentions; 1 submissions, 8 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC303
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC918
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC404
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC413
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

What Hacker News says

4 sources
> Now, do I think it would make total sense for syscall wrappers and NSS to be split into their own libs (or dbus interfaces maybe) with stable ABIs to enable other libc's, absolutely! I worked on this a few years ago: liblinux. https://github.com/matheusmoreira/liblinux It's still a nice proof of concept but I abandoned it when I found out the Linux kernel itself has a superior nolibc library that they use for their own tools: https://github.com/torvalds/linux/tree/master/tools/include/... It used to be a single header but it looks like they've recently organized it into a proper project! > This is something the BSD's got absolutely right. BSDs and all the other operating systems force us to use their C libraries and the C ABI. I think Linux's approach is better. It has a language-agnostic system call binary interface: it's just a simple
Read the rest
calling convention and the system call instruction. The right place for system call support is the compiler. We should have a system_call keyword that makes it emit code in the aforementioned calling convention. With this single keyword, it's possible to do literally anything on Linux. Wrappers for every specific system call should be part of every language's standard library with language-specific types and semantics. An example of one such language is Virgil by HN used titzer: https://news.ycombinator.com/item?id=28283632
In Win32 Is the Only Stable ABI on Linux?
I'm not using this stuff professionally, it's just my own home lab's virtual machines with little services implemented as freestanding C programs. Not doing anything fancy right now, much of it was just to see if I could do it. I've seen other people commenting here on HN saying they're using the same approach in production so it's defenitely not my invention. Hopefully they'll see this thread and reply. I published some of my work in the form of a liblinux that I use to make system calls: https://github.com/matheusmoreira/liblinux I'm not developing it anymore though because I found out the kernel itself has a superior nolibc library: https://github.com/torvalds/linux/tree/master/tools/include/... It used to be a single header but it looks like they've recently organized it into a proper project! I wonder if it will become some kind of o
Read the rest
fficial kernel library at some point. I asked Greg Kroah-Hartman about this and he mentioned there was once a klibc: https://old.reddit.com/r/linux/comments/fx5e4v/im_greg_kroah...
In Oasis: Small statically-linked Linux system
That's awesome. I didn't know about rwildcard until now. Is it part of GMSL? I searched for rwildcard on gmsl.sourceforge.io but didn't find it. I think my function is needlessly complicated compared to rwildcard. Here's my code: https://github.com/matheusmoreira/liblinux/blob/modular-buil... https://github.com/matheusmoreira/liblinux/blob/modular-buil... The file? and directory? functions were inspired by GMSL. I think I learned how to check whether a path is a directory from one of your posts. I wrote a general recursion function. It takes a function to apply to lists and a function to compute whether an element is a base case. The recursive file system traversal function applies a directory globbing function to the list of paths and has file? as base case. It returns all files without filtering. The find function recursively traverses
Read the rest
the file system while filtering out all items not matching the given predicate function. It was my intention to provide predicates like c_file? and header_file? but I stopped developing that project before that happened. Users can easily write their own predicates too. I think rwildcard is probably simpler and more efficient! If my code helps in any way though, feel free to use it.
In A Tutorial on Portable Makefiles (2017)
Linux is the only operating system that guarantees kernel binary interface stability. You can discard the entire user space and write dependency-free software that interfaces with Linux directly. You can even boot Linux straight into your own program and bring up the system yourself. This single function is all you need to do literally anything on x86_64 Linux from writing to a file descriptor to graphics card ioctls: https://github.com/matheusmoreira/liblinux/blob/master/sourc... In all others, interfacing with the kernel directly eventually leads to breakage because the people in charge change the system calls. Go binaries broke on OS X because of this. We're not meant to bypass their system libraries.
In Virgil: A fast and lightweight programming language that compiles to WASM

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.