static int _hostfs_closedir(oe_fd_t* desc)
{
    int ret = -1;
    dir_t* dir = _cast_dir(desc);
    int retval = -1;

    if (!dir)
        OE_RAISE_ERRNO(OE_EINVAL);

    if (oe_syscall_closedir_ocall(&retval, dir->host_dir) != OE_OK)
        OE_RAISE_ERRNO(OE_EINVAL);

    oe_free(dir);

    ret = retval;

done:

    return ret;
}
static int _hostfs_closedir(oe_fd_t* desc)
{
    int ret = -1;
    dir_t* dir = _cast_dir(desc);
    int retval = -1;

    if (!dir)
        OE_RAISE_ERRNO(OE_EINVAL);

    if (oe_syscall_closedir_ocall(&retval, dir->host_dir) != OE_OK)
        OE_RAISE_ERRNO(OE_EINVAL);

    oe_free(dir);

    ret = retval;

done:

    return ret;
}