On Mon, Apr 27, 2020 at 1:42 PM Maxim Pugachev <
pugac...@gmail.com> wrote:
> I'm wondering about unimplemented syscalls for Linux, especially timerfd. The only mention I found is in syscall_linux.go, and it's marked as "Unimplemented".
> Is there any reason for that? Or it's just because of the low priority of the task, and no one had time to support it?
All the contents required by timefd_* syscalls are there, so you can
always use raw unix.Syscall and unix.Syscall6 to perform these
syscalls.
my guess the reason they do not have wrapper is that we already have a
portable timer facility that doesn't consume fd; besides, timerfd
usually requires integration with the runtime poller to be performant.
Besides timerfd_* syscalls, it seems other timer related syscalls
(like get/setitimer, and
timer_create/settime/gettime/getoverrun/delete) timer are also not
implemented, probably for the same reason.
But again, all necessary pieces are there so if you really want them,
can use them. (struct Itimerspec is not included, but it's trivial to
define your own.)
in the case for itimer, the other reason is probably the runtime uses
ITIMER_PROF for cpu profiling, so allowing user manipulation of
itimers might be undesirable. User programs should be free to use the
other two kinds of itimers though. it's just I don't see why use those
unportable features when we already have package time.