// Installs a new directory at /hippo in our namespace. Does nothing if this directory already
// exists.
Installs a new directory at /hippo in our namespace. Does nothing if this directory already
exists.
Installs a new directory at / hippo in our namespace . Does nothing if this directory already exists .
pub fn install_hippo_dir() {
    let (client_chan, server_chan) = zx::Channel::create().unwrap();
    let mut ns_ptr: *mut fdio::fdio_sys::fdio_ns_t = ptr::null_mut();
    let status = unsafe { fdio::fdio_sys::fdio_ns_get_installed(&mut ns_ptr) };
    if status != zx::sys::ZX_OK {
        panic!(
            "bad status returned for fdio_ns_get_installed: {}",
            zx::Status::from_raw(status)
        );
    }
    let cstr = CString::new("/hippo").unwrap();
    let status =
        unsafe { fdio::fdio_sys::fdio_ns_bind(ns_ptr, cstr.as_ptr(), client_chan.into_raw()) };
    if status != zx::sys::ZX_OK && status != zx::sys::ZX_ERR_ALREADY_EXISTS {
        panic!("bad status returned for fdio_ns_bind: {}", zx::Status::from_raw(status));
    }
    let mut out_dir = OutDir::new();
    out_dir.add_directory();
    out_dir.host_fn()(ServerEnd::new(server_chan));
}
pub fn install_hippo_dir ( ) { let ( client_chan , server_chan ) = zx :: Channel :: create ( ) . unwrap ( ) ; let mut ns_ptr : * mut fdio :: fdio_sys :: fdio_ns_t = ptr :: null_mut ( ) ; let status = unsafe { fdio :: fdio_sys :: fdio_ns_get_installed ( & mut ns_ptr ) } ; if status != zx :: sys :: ZX_OK { panic ! ( " " zx Status from_raw ( status ) ) ; } let cstr = CString :: new ( " " ) . unwrap ( ) ; let status = unsafe { fdio :: fdio_sys :: fdio_ns_bind ( ns_ptr , cstr . as_ptr ( ) , client_chan . into_raw ( ) ) } ; if status != zx :: sys :: ZX_OK && status != zx :: sys :: ZX_ERR_ALREADY_EXISTS { panic ! ( " " zx Status from_raw ( status ) ) ; } let mut out_dir = OutDir :: new ( ) ; out_dir . add_directory ( ) ; out_dir . host_fn ( ) ( ServerEnd :: new ( server_chan ) ) ; }
Installs a new directory at /hippo in our namespace.
Installs a new directory at / hippo in our namespace .