Skip to content

timer_create, timer_settime and timer_delete syscall implementation #1242

Answered by dimakuv
ghost asked this question in Q&A
Discussion options

You must be logged in to vote
  1. Can we use a global timerid counter in libos_utils.c? Or would we want a separate handle map inside libos_handle.c?

I think you can use a global counter, instead of adding a new handle map. There are two reasons for this:

  1. 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.

  2. POSIX timers are process-internal, i.e., they do not propagate over fork() and execve(). This is described in the man page:

    Timers are not inherited by the child of a fork(2), and are disarmed and …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant