Hacker News new | ask | show | jobs
by saagarjha 1986 days ago
Using .ascii is fine; the string is going to a syscall–not libc. And using the standard library in a program like this is kind of beside the point…
1 comments

nope, every decent OS has system call library you can write like:

  bl _Open ; whatever syscall name you have
and the linker or the OS dynamic linker will get you the proper system call code, with the numbers.

BTW even in our small threos.io os we use dynamic linked system calls.

I know how dynamic linkers work and am not arguing against using the libc interface in general. I'm saying that this program intentionally doesn't use those interfaces.
This can be a problem on macOS; Apple doesn't keep compatibility among releases at sysenter level.

Golang used to run into this, they switched to using libSystem in 1.11: https://golang.org/doc/go1.11#runtime

The system call library is NOT libc.
Then Apple doesn't have it.
/usr/lib/system/libsystem_kernel.dylib
you don't know about it

/usr/lib/system/libsystem_kernel.dylib

ex. https://stackoverflow.com/questions/37656016/osx-setgid-syst...

That's part of libSystem, macOS's libc implementation…