Implement the nanotime system call.
This is notably useful for the port of the Go Programming Language
on Plan 9. In the Go environment, we are currently relying on the
/dev/bintime file to get time. However it has the disadvantage of
introducing latency (in order of ten microseconds) and require the
/dev/bintime file to be opened for every child process and call
to the nanotime() function.
The nanotime syscall should also be implemented in /sys/src/9k/port/sysfile.c:
void
sysnanotime(Ar0* ar0, va_list)
{
/*
* vlong nanotime(void);
*/
ar0->vl = todget(nil);
}
This is an idea from Ron Minnich, which was originaly implemented
as part of NxM. I think Jim already reviewed this change last year.
|