Plan 9 from Bell Labs’s /usr/web/sources/patch/maybe/sys-nanotime/readme

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


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.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].