Update the name of experimental IO devices in fs

This commit is contained in:
Mark McCaskey 2020-01-10 17:00:26 -08:00
parent 50f3079d82
commit 600f4ded9e

View File

@ -451,21 +451,10 @@ pub fn initialize(fs: &mut WasiFs) -> Result<(), String> {
cursor: 0, cursor: 0,
}); });
let dev_fd = unsafe { let base_dir_fd = unsafe {
fs.open_dir_all( fs.open_dir_all(
VIRTUAL_ROOT_FD, VIRTUAL_ROOT_FD,
"dev".to_string(), "_wasmer/fb0".to_string(),
ALL_RIGHTS,
ALL_RIGHTS,
0,
)
.map_err(|e| format!("fb: Failed to create dev folder {:?}", e))?
};
let fb_fd = unsafe {
fs.open_dir_all(
VIRTUAL_ROOT_FD,
"sys/class/graphics/wasmerfb0".to_string(),
ALL_RIGHTS, ALL_RIGHTS,
ALL_RIGHTS, ALL_RIGHTS,
0, 0,
@ -475,7 +464,7 @@ pub fn initialize(fs: &mut WasiFs) -> Result<(), String> {
let _fd = fs let _fd = fs
.open_file_at( .open_file_at(
dev_fd, base_dir_fd,
input_file, input_file,
Fd::READ, Fd::READ,
"input".to_string(), "input".to_string(),
@ -489,10 +478,10 @@ pub fn initialize(fs: &mut WasiFs) -> Result<(), String> {
let _fd = fs let _fd = fs
.open_file_at( .open_file_at(
dev_fd, base_dir_fd,
frame_buffer_file, frame_buffer_file,
Fd::READ | Fd::WRITE, Fd::READ | Fd::WRITE,
"wasmerfb0".to_string(), "fb".to_string(),
ALL_RIGHTS, ALL_RIGHTS,
ALL_RIGHTS, ALL_RIGHTS,
0, 0,
@ -503,7 +492,7 @@ pub fn initialize(fs: &mut WasiFs) -> Result<(), String> {
let _fd = fs let _fd = fs
.open_file_at( .open_file_at(
fb_fd, base_dir_fd,
resolution_file, resolution_file,
Fd::READ | Fd::WRITE, Fd::READ | Fd::WRITE,
"virtual_size".to_string(), "virtual_size".to_string(),
@ -517,7 +506,7 @@ pub fn initialize(fs: &mut WasiFs) -> Result<(), String> {
let _fd = fs let _fd = fs
.open_file_at( .open_file_at(
fb_fd, base_dir_fd,
index_file, index_file,
Fd::READ | Fd::WRITE, Fd::READ | Fd::WRITE,
"buffer_index_display".to_string(), "buffer_index_display".to_string(),