-
Started prototyping a bit today to add timer support and ran into two issues.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think you can use a global counter, instead of adding a new handle map. There are two reasons for this:
But I would prefer to put all POSIX-timer functionality, including this global
But definitely I don't like the idea of using
Your understanding is correct. There is no alternative clock source for the enclave. I suggest to follow the logic as here: gramine/libos/src/sys/libos_sleep.c Line 76 in 0119fd2 In other words, emulate all clocks as
Yes. Actually, according to the man page, you'll need to implement the following syscalls:
By the way, I would recommend to start with only I think I already mentioned this in the past, but please use the following logic as your guide in POSIX-timers implementation: |
Beta Was this translation helpful? Give feedback.
I think you can use a global counter, instead of adding a new handle map. There are two reasons for this:
Simplicity. It looks like timer IDs are implemented as rather complicated numbers in Linux, but without any connections to other handles (file descriptions). So we can do something similar -- just have a global counter, for the sake of simplicity and self-containment.
POSIX timers are process-internal, i.e., they do not propagate over
fork()
andexecve()
. This is described in the man page: