mod fd;
pub use fd::Fd;
pub fn c_string_to_str(s: &[libc::c_char]) -> &str {
let pos = s.iter().position(|c| *c == 0).unwrap_or(s.len());
let s = unsafe { core::slice::from_raw_parts(s.as_ptr() as * const _, pos) };
core::str::from_utf8(s).unwrap()
}