Verified Commit 9df7d2c8 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

0.3.20 - Update fmap support

parent dc175376
[package]
name = "orbclient"
version = "0.3.19"
version = "0.3.20"
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
description = "The Orbital Client Library"
documentation = "https://docs.rs/orbclient"
......
......@@ -136,7 +136,11 @@ impl Window {
"orbital:{}/{}/{}/{}/{}/{}",
flag_str, x, y, w, h, title
)) {
if let Ok(address) = unsafe { syscall::fmap(file.as_raw_fd(), 0, (w * h * 4) as usize) }
if let Ok(address) = unsafe { syscall::fmap(file.as_raw_fd(), &syscall::Map {
offset: 0,
size: (w * h * 4) as usize,
flags: syscall::PROT_READ | syscall::PROT_WRITE,
}) }
{
Some(Window {
x: x,
......@@ -217,7 +221,11 @@ impl Window {
.write(&format!("S,{},{}", width, height).as_bytes());
self.sync_path();
unsafe {
let address = syscall::fmap(self.file.as_raw_fd(), 0, (self.w * self.h * 4) as usize)
let address = syscall::fmap(self.file.as_raw_fd(), &syscall::Map {
offset: 0,
size: (self.w * self.h * 4) as usize,
flags: syscall::PROT_READ | syscall::PROT_WRITE,
})
.expect("orbclient: failed to map memory in resize");
self.data =
slice::from_raw_parts_mut(address as *mut Color, (self.w * self.h) as usize);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment