Some libc functions, e.g. sigemptyset(set: *mut sigset_t)
take a pointer to a variable, treat it as uninitialized and initialize it.
I end up with this code:
let mut newmask = std::mem::uninitialized();
libc::sigemptyset(&mut newmask);
This is ok, but when I have many of those variables I end up with something like this:
let mut newmask = std::mem::uninitialized();
let mut oldmask = std::mem::uninitialized();
let mut pendmask = std::mem::uninitialized();
I could condense it:
use std::mem::unitialized as uninit;
let (mut newmask, mut oldmask, mut pendmask) = (uninit(), uninit(), uninit());
Is there a nicer way to write this code? For educational purposes I explicitly want to use libc.