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

Generate epoll bindings #5

Open
4 tasks
leostera opened this issue Feb 28, 2024 · 2 comments
Open
4 tasks

Generate epoll bindings #5

leostera opened this issue Feb 28, 2024 · 2 comments
Milestone

Comments

@leostera
Copy link
Contributor

Similar to #4, we need to generate EPoll bindings to be able to drop custom C code from gluon.

The syscalls we need are:

  • Create an epoll instance with flags: epoll_create1 : flags:int -> epoll
  • Await on an epoll instance: epoll_wait : timeout:int64 -> max_events:int -> epoll -> event array
  • Configure an epoll instance: epoll_ctl : epoll -> flags:int -> fd:Fd.t -> event -> unit
  • Reset an epoll instance: epoll_ctl_null : epoll -> flags:int -> fd:Fd.t -> unit

The C code we wrote for this lives here.

The generated does not need to match this 1-to-1, so some of the decision I made writing these bindings can be changed, no problem there.

@leostera leostera added this to the riot/phase-1 milestone Feb 28, 2024
@omnisci3nce
Copy link
Contributor

I'm pretty keen to keep working on bindgen and this seems like a good a way as any to 'dogfood' (😂 ). I can begin working on this if that's okay. No doubt starting on this will spawn a bunch of smaller issues that get us closer one step at a time.

@omnisci3nce
Copy link
Contributor

Could you expand on the caml_enter_blocking_section a tiny bit? I found the section https://v2.ocaml.org/manual/intfc.html on here that talks a bit about it and I think I get it but a little more context might save me wasting a bunch of time. I get the feeling we won't be able to intuit its necessity, if it indeed is necessary, purely from the .h header 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants