Adding Termios library as std::libc::termios (posix libc functions)
fixed version of posix libc's termios binding, I putted it inside libc/os/posix.c3 because it is a posix only part of the libc
People will look for functions using their C name, e.g. cfgetospeed, so I would do it like this:
- First just create the
externdeclarations as is, e.g.extern fn CInt tcdrain(Fd fd); - Then create the abstraction variant, e.g.
fn int drain(Fd fd) => tcdrain(fd);or similar, and place it outside of the libc::os as an actual stdlib feature.
Because the idea is that people should in general not need to use libc functions directly, but instead go for (preferably) cross platform functionality that is based on libc.
So I could either accept this as-is and I'll do the changes afterwards, or you do modifications. What would be the best? If you use it then you probably have a better idea of how you think the "normal" stdlib interface should look like.
I made the following changes:
- added extern functions corresponding to the c symbols;
- added abstraction variants for all;
- added unreachable function for all the symbols if either libc or posix is not available;
Thank you for your work. Now there's just the part when not on posix/libc and it's done!
Maybe some of the constants should also use the distinct types.
Thank you!