static int _hostfs_link(
    oe_device_t* device,
    const char* oldpath,
    const char* newpath)
{
    int ret = -1;
    device_t* fs = _cast_device(device);
    char host_oldpath[OE_PATH_MAX];
    char host_newpath[OE_PATH_MAX];
    int retval = -1;

    if (!fs || !oldpath || !newpath)
        OE_RAISE_ERRNO(OE_EINVAL);

    /* Fail if attempting to write to a read-only file system. */
    if (_is_read_only(fs))
        OE_RAISE_ERRNO(OE_EPERM);

    if (_make_host_path(fs, oldpath, host_oldpath) != 0)
        OE_RAISE_ERRNO(oe_errno);

    if (_make_host_path(fs, newpath, host_newpath) != 0)
        OE_RAISE_ERRNO(oe_errno);

    if (oe_syscall_link_ocall(&retval, host_oldpath, host_newpath) != OE_OK)
        OE_RAISE_ERRNO(OE_EINVAL);

    ret = retval;

done:

    return ret;
}
static int _hostfs_link(
    oe_device_t* device,
    const char* oldpath,
    const char* newpath)
{
    int ret = -1;
    device_t* fs = _cast_device(device);
    char host_oldpath[OE_PATH_MAX];
    char host_newpath[OE_PATH_MAX];
    int retval = -1;

    if (!fs || !oldpath || !newpath)
        OE_RAISE_ERRNO(OE_EINVAL);

     
    if (_is_read_only(fs))
        OE_RAISE_ERRNO(OE_EPERM);

    if (_make_host_path(fs, oldpath, host_oldpath) != 0)
        OE_RAISE_ERRNO(oe_errno);

    if (_make_host_path(fs, newpath, host_newpath) != 0)
        OE_RAISE_ERRNO(oe_errno);

    if (oe_syscall_link_ocall(&retval, host_oldpath, host_newpath) != OE_OK)
        OE_RAISE_ERRNO(OE_EINVAL);

    ret = retval;

done:

    return ret;
}