Closed Gobidev closed 1 year ago
So starting a process is faster than emitting a syscall.
What?
@CarterLi you're right, I somehow did not think of making the syscall directly😅 I will look into how that could be done
sysinfo
and libmacchina
essentially do the same thing. If we were
to depend on sysinfo
, we would do that in macchina. At that point,
maintaining libmacchina would be pointless, except it does what
sysinfo
doesn't currently do, and that is to provide support for
NetBSD.
Ok, in that case I will work on a proper implementation without spawning a process, closing this for now.
Thank you @Gobidev! I'm eager to see the FreeBSD implementation improve.
This PR adds uptime detection on FreeBSD by spawning a
sysctl
system command. This is sadly pretty much the fastest option on FreeBSD, as getting the uptime requires a syscall and cannot be read directly from /proc.