Skip to content

Instantly share code, notes, and snippets.

@sajattack
Last active November 6, 2017 00:33
Show Gist options
  • Save sajattack/fb6e14f0f25e91a927da5002287bbaa8 to your computer and use it in GitHub Desktop.
Save sajattack/fb6e14f0f25e91a927da5002287bbaa8 to your computer and use it in GitHub Desktop.
extern crate core;
extern crate libc;
#[repr(C)]
pub struct dirent {
pub d_ino: libc::c_ulong,
pub d_off: libc::c_long,
pub d_reclen: libc::c_ushort,
pub d_type: libc::c_uchar,
pub d_name: [libc::c_char; 4096],
}
impl core::default::Default for dirent {
fn default() -> dirent {
dirent {
d_ino: 0,
d_off: 0,
d_reclen: 0,
d_type: 0,
d_name: [0; 4096],
}
}
}
fn main() {
let mut names: Vec<*mut dirent>;
names = Vec::with_capacity(4096);
names.resize_default(8192);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment