(no title)
Panino | 1 year ago
> Users of syscall(2), such as Perl and the Go programming language were converted to use the libc functions.
I think the following may still need to be converted:
* unix.Pledge from golang.org/x/sys/unix
* unix.Unveil from golang.org/x/sys/unix
* terminal.ReadPassword from golang.org/x/crypto/ssh/terminal
qweqwe14|1 year ago
On Linux, using direct syscalls is a good idea, since it's the stable userspace-kernel interface. There's really no need for libc on Linux, each language should just implement it's standard library on top of syscalls.
int_19h|1 year ago
This was previously discussed at length here: https://news.ycombinator.com/item?id=25999623
zokier|1 year ago
Its not always not so clearcut. For example using pthreads instead of just calling clone can be useful for interop etc. Similarly, anything involving NSS is probably best done through libc. Having libc malloc integrated makes interacting with other C libs easier. And so on.
LAC-Tech|1 year ago
Rustix is a great implementation of that idea https://docs.rs/rustix/latest/rustix/
Any similar projects in other langs?
tedunangst|1 year ago
ikmckenz|1 year ago
Panino|1 year ago
After tedu's comment here I installed 7.5 in a VM and could build and run my Go software in it successfully, so I figured there were some Go build or config files or something somewhere getting in the way. I pkg_delete'd go, removed every Go build/config file I could find, and re-added Go with pkg_add. Now I can build apps with the previously mentioned modules; everything works fine now.
Thank you for the responses. :-)
citizenpaul|1 year ago