static int _hostfs_stat(
    oe_device_t* device,
    const char* pathname,
    struct oe_stat_t* buf)
{
    int ret = -1;
    device_t* fs = _cast_device(device);
    char host_path[OE_PATH_MAX];
    int retval = -1;

    if (buf)
        oe_memset_s(buf, sizeof(*buf), 0, sizeof(*buf));

    if (!fs || !pathname || !buf)
        OE_RAISE_ERRNO(OE_EINVAL);

    if (_make_host_path(fs, pathname, host_path) != 0)
        OE_RAISE_ERRNO(oe_errno);

    if (oe_syscall_stat_ocall(&retval, host_path, buf) != OE_OK)
        OE_RAISE_ERRNO(OE_EINVAL);

    ret = retval;

done:

    return ret;
}
static int _hostfs_stat(
    oe_device_t* device,
    const char* pathname,
    struct oe_stat_t* buf)
{
    int ret = -1;
    device_t* fs = _cast_device(device);
    char host_path[OE_PATH_MAX];
    int retval = -1;

    if (buf)
        oe_memset_s(buf, sizeof(*buf), 0, sizeof(*buf));

    if (!fs || !pathname || !buf)
        OE_RAISE_ERRNO(OE_EINVAL);

    if (_make_host_path(fs, pathname, host_path) != 0)
        OE_RAISE_ERRNO(oe_errno);

    if (oe_syscall_stat_ocall(&retval, host_path, buf) != OE_OK)
        OE_RAISE_ERRNO(OE_EINVAL);

    ret = retval;

done:

    return ret;
}