blink icon indicating copy to clipboard operation
blink copied to clipboard

timerfd_create not implemented

Open bradrn opened this issue 1 year ago • 3 comments

Out of curiosity I tried to run a Haskell program of mine on blink, and got the following error:

brassica: internal error: timerfd_create: Function not implemented
    (GHC version 9.2.7 for x86_64_unknown_linux)
    Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug
Aborted (core dumped)

(brassica being the name of my program.)

The error description seems pretty descriptive to me: Blink does not yet implement timerfd_create. Is there any chance of getting it?

bradrn avatar Nov 02 '23 04:11 bradrn

I've thought about this interface a few times in the past. Something like this would most likely be tricky to polyfill on platforms where the kernel doesn't support it natively. It'd likely entail spawning a thread and creating some pipes to deliver timer notifications. Our team currently doesn't have any need for it, since most of the software we've built is able to work around it not being available. I'd be open to merging a contribution that implements this. But only if the timer fd implementation is relatively well contained, i.e. it only gets linked into your binary if you actually use it.

jart avatar Nov 02 '23 06:11 jart

Thanks for explaining! Alas, my knowledge of syscalls is depressingly miniscule, so I probably won’t be able to implement this myself. (Indeed, I’m interested in Blinkenlights mostly as a tool for learning this stuff.)

bradrn avatar Nov 02 '23 06:11 bradrn

Actually I want to take some of this back. I confused this with the Cosmopolitan Libc repository. Timer Fd is something that Blink SHOULD do. However I don't have immediate plans to develop it at the moment. Contributions are still very much welcome! Thank you again for reaching out! I'll update this issue when things change.

jart avatar Nov 02 '23 07:11 jart