Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Depends on the OS. We also do include some specific things, see https://doc.rust-lang.org/stable/std/os/index.html and https://doc.rust-lang.org/stable/core/arch/index.html


Sure platform specific things can be useful. But that's exactly what `syscall()` is. As far as I'm aware, other platforms don't have any real equivalent. On other platforms syscalls must be made via libraries (as Go rather famously found out the hard way).


Yes, you're right that most platforms don't have something stable here. I was thinking of the problem more abstractly.


Doesn't most platforms have a reasonably stable interface for functions that are supposed to be reached from userspace? When does it actually matter if that border coincide with where execution privileges are raised?


They do: the interface is (usually) libc (or some equivalent), not the actual details of how libc makes said call.

For an example of how this can play out, the parent is referring to things like https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: