a rewritten clock.c for plan9port
Plan9port currently does not implement etimer(), which means that clock.c can't be compiled under lunix. This slight rewrite is an exercise in threaded programming under Plan 9. Instead of etimer() we use a thread which sleeps for 30 seconds, wakes up and sends an event on a channel, which is then picked by the main thread. Note that we use Mousectl instead of the event library (event.h is for non-threaded programs only).
Download in $PLAN9/src/cmd/draw:
9clock.c
mkfile (needs a slight change in the mkfile).
screenshot
BUGS:
the binary is huge (2MB)
uses some tricks available only in plan9port (threadsleep)
Last Modified: August 26, 2004
mirtchovski at gmail