sunfishcode / mustang

Rust programs written entirely in Rust
Other
853 stars 24 forks source link

Work on ctype functions, fix some string functions #124

Closed carbotaniuman closed 2 years ago

carbotaniuman commented 2 years ago

I'm working on getting the bat binary to run on Rustix.

The main changes in this PR are:

carbotaniuman commented 2 years ago

I can't seem to figure out how to get the alignment on x86 to be correct.

sunfishcode commented 2 years ago

The alignment appears to be 1 on i686-unknown-linug-gnu, and is overridden to be higher on specific configurations: https://github.com/rust-lang/libc/blob/master/src/unix/linux_like/linux/align.rs#L31

carbotaniuman commented 2 years ago

TIL rustix::io::OwnedFd and rustix::fd::OwnedFd are not the same...

sunfishcode commented 2 years ago

Yeah. and it's just OwnedFd that has a wrapper in rustix::io btw, because the issue is the close call that it does. For the others we just use rustix::fd directly.