News for hackers. Stuff that matters.
Re:Go 1.16 will make system calls through Libc on OpenBSD by lxgr on Tuesday February 02, 2021 @02:50PM (#26005676)
I'm talking about a userspace-only Linux compatibility layer for Windows.

As far as I understand, Wine (a userspace-only Win32 emulator) is possible because Windows applications always go through the standard library for system calls, which therefore can be hooked without kernel support.

The same is not generally true for Linux binaries – these usually do go through glibc, but direct syscalls are possible (through raising the appropriate interrupt or instruction).

I don't think there's an easy way to trap these without kernel support (which is what WSL 1 has been doing).

Re:Go 1.16 will make system calls through Libc on OpenBSD by masklinn on Tuesday February 02, 2021 @05:08PM (#26007562)
> The same is not generally true for Linux binaries – these usually do go through glibc, but direct syscalls are possible (through raising the appropriate interrupt or instruction).

OTOH Linux having a well defined set of syscalls you can very convincingly fake being a Linux kernel. That’s what wsl1 did. That’s also what SmartOS does, which allows it to mix native and Linux (LX) zones.

Re:Go 1.16 will make system calls through Libc on OpenBSD by lxgr on Wednesday February 03, 2021 @03:49AM (#26011827)
Definitely, iSH does the same thing on iOS and it works really well.

But I don't see why we can't have both (a stable syscall interface and requiring all syscalls to go through a standard library).

Re:Go 1.16 will make system calls through Libc on OpenBSD by masklinn on Wednesday February 03, 2021 @10:40AM (#26014595)
> But I don't see why we can't have both (a stable syscall interface and requiring all syscalls to go through a standard library).

What's the point of having a stable syscall interface when you can require that only libc perform syscalls?

Re:Go 1.16 will make system calls through Libc on OpenBSD by severino on Friday February 05, 2021 @08:14AM (#26035925)
> I don't think there's an easy way to trap these without kernel support (which is what WSL 1 has been doing).

Thanks four your explanation. So is WSL2 different in this regards?