Skip to content

Commit 67a590b

Browse files
committed
orbital: Use libredox for file syscall
1 parent 840683c commit 67a590b

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎Cargo.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ web-sys = { version = "0.3.55", features = [
140140

141141
# Orbital dependencies.
142142
[target.'cfg(target_os = "redox")'.dependencies]
143-
redox_syscall = "0.7"
143+
redox_syscall = "0.9"
144+
libredox = "0.1.18"
144145

145146
[package.metadata.docs.rs]
146147
all-features = true

‎src/backends/orbital.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl BufferInterface for BufferImpl<'_> {
194194
match self.pixels {
195195
Pixels::Mapping(mapping) => {
196196
drop(mapping);
197-
syscall::fsync(self.window_fd).expect("failed to sync orbital window");
197+
libredox::call::fsync(self.window_fd).expect("failed to sync orbital window");
198198
*self.presented = true;
199199
}
200200
Pixels::Buffer(buffer) => {
@@ -212,7 +212,7 @@ fn window_size(window_fd: usize) -> (usize, usize) {
212212
let mut window_height = 0;
213213

214214
let mut buf: [u8; 4096] = [0; 4096];
215-
let count = syscall::fpath(window_fd, &mut buf).unwrap();
215+
let count = libredox::call::fpath(window_fd, &mut buf).unwrap();
216216
let path = str::from_utf8(&buf[..count]).unwrap();
217217
// orbital:/x/y/w/h/t
218218
let mut parts = path.split('/').skip(3);
@@ -237,7 +237,7 @@ fn set_buffer(
237237
let (window_width, window_height) = window_size(window_fd);
238238

239239
let Some(urect) = util::union_damage(damage) else {
240-
syscall::fsync(window_fd).expect("failed to sync orbital window");
240+
libredox::call::fsync(window_fd).expect("failed to sync orbital window");
241241
return;
242242
};
243243

@@ -272,5 +272,5 @@ fn set_buffer(
272272
};
273273

274274
// Tell orbital to show the latest window data
275-
syscall::write(window_fd, damage_buf.as_bytes()).expect("failed to sync orbital window");
275+
libredox::call::write(window_fd, damage_buf.as_bytes()).expect("failed to sync orbital window");
276276
}

0 commit comments

Comments
 (0)