static int _hostfs_ioctl(oe_fd_t* desc, unsigned long request, uint64_t arg)
{
    int ret = -1;
    file_t* file = _cast_file(desc);
    uint64_t argsize = 0;
    void* argout = NULL;

    if (!file)
        OE_RAISE_ERRNO(OE_EINVAL);

    /*
     * MUSL uses the TIOCGWINSZ ioctl request to determine whether the file
     * descriptor refers to a terminal device. This request cannot be handled
     * by Windows hosts, so the error is handled on the enclave side. This is
     * the correct behavior since host files are not terminal devices.
     */
    switch (request)
    {
        default:
            OE_RAISE_ERRNO(OE_ENOTTY);
    }

    /* Call the host to perform the ioctl() operation. */
    if (oe_syscall_ioctl_ocall(
            &ret, file->host_fd, request, arg, argsize, argout) != OE_OK)
    {
        OE_RAISE_ERRNO(OE_EINVAL);
    }

done:
    return ret;
}
static int _hostfs_ioctl(oe_fd_t* desc, unsigned long request, uint64_t arg)
{
    int ret = -1;
    file_t* file = _cast_file(desc);
    uint64_t argsize = 0;
    void* argout = NULL;

    if (!file)
        OE_RAISE_ERRNO(OE_EINVAL);

     
    switch (request)
    {
        default:
            OE_RAISE_ERRNO(OE_ENOTTY);
    }

     
    if (oe_syscall_ioctl_ocall(
            &ret, file->host_fd, request, arg, argsize, argout) != OE_OK)
    {
        OE_RAISE_ERRNO(OE_EINVAL);
    }

done:
    return ret;
}