Skip to content

std::os::MemoryMap::new() fails on Windows #16070

Closed
@jamesluke

Description

@jamesluke

Code:

extern crate native;
extern crate rustrt;
use rustrt::rtio::{Open,Read};
fn main() {
    let file = native::io::file::open(&"test.txt".to_c_str(), Open, Read)
        .ok().unwrap();
    let map_options = [std::os::MapReadable, std::os::MapFd(file.fd())];
    std::os::MemoryMap::new(2048, map_options).unwrap();
}

Error: task '

' failed at 'called Result::unwrap() on an Err value: MapViewOfFile failure = 998', C:\bot\slave\nightly-win\build\src\libcore\result.rs:548
OS: Windows 8.1 Pro
Compiler version: rustc 0.12.0-pre-nightly (b2bd998 2014-07-28 22:36:39 +0000)

The file is being opened, as shown by this process monitor scrape:
procmon

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions