Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timerfd_create not implemented #155

Open
bradrn opened this issue Nov 2, 2023 · 3 comments
Open

timerfd_create not implemented #155

bradrn opened this issue Nov 2, 2023 · 3 comments
Labels
help wanted Extra attention is needed syscalls Issues relating to Linux Kernel system call ABI emulation

Comments

@bradrn
Copy link

bradrn commented Nov 2, 2023

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?

@jart
Copy link
Owner

jart commented Nov 2, 2023

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 jart added help wanted Extra attention is needed syscalls Issues relating to Linux Kernel system call ABI emulation labels Nov 2, 2023
@bradrn
Copy link
Author

bradrn commented Nov 2, 2023

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

@jart
Copy link
Owner

jart commented Nov 2, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed syscalls Issues relating to Linux Kernel system call ABI emulation
Projects
None yet
Development

No branches or pull requests

2 participants