Closed
Description
I tried this code on my Linux machine:
use std::os::unix::net::UnixListener;
fn main() {
let listener = UnixListener::bind("/tmp/rust-uds.sock").unwrap();
println!("{:?}", listener.local_addr().unwrap());
}
I got this output:
"/tmp/rust-uds.sock" (pathname)
However, on OpenBSD 7, I got this output:
"/tmp/rust-uds.sock\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" (pathname)
I expected the output to be the same as Linux: not padded with zeroes like this.
Meta
rustc --version --verbose
:
$ rustc --version --verbose
rustc 1.63.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-openbsd
release: 1.63.0
LLVM version: 13.0.0