japaric / steed

[INACTIVE] Rust's standard library, free of C dependencies, for Linux systems
519 stars 22 forks source link

Generate syscalls ? #38

Open arnaud-lb opened 7 years ago

arnaud-lb commented 7 years ago

Awesome project!

Golang took the same approach, partly for the same reasons. I believe that some of the Golang work / ideas could be reused here.

What they do is to generate simple functions that do nothing but calling syscall() with the right syscall number and arguments (example). Then these functions are used in the standard library.

Generation is done by the mksyscall.pl script. It takes an input file like this one, and generates this.

Syscall number constants are also generated by a script.

japaric commented 7 years ago

Awesome project!

Thanks.

We are doing something similar but not generating everything "all the way down". The system call numbers have all been automatically generated but the thin syscall wrappers (thinner than go's -- they only add type checking to the "untyped" syscall! macro; they don't any conversion) are being manually written. It would be great to generate those too from the Linux source or something!