core: Fix BSD breakage, I hope
auto merge of #5028 : catamorphism/rust/bsd-breakage, r=catamorphism