Skip to content

OpenOptions are not checked #2409

@mkroening

Description

@mkroening

The following program does not panic on Hermit, although it should return EBADF on read:

use std::fs::File;
use std::io::{Read, Write};

#[cfg(target_os = "hermit")]
use hermit as _;

const BUF_SIZE: usize = 8 * 1024;

fn main() {
	let mut file = File::create("/tmp/hello.txt").unwrap();
	let mut buf = vec![0; BUF_SIZE];
	file.read(&mut buf).unwrap();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions