Specify crates.io versions, update rust, cleanup modules
This commit is contained in:
parent
8a6d99e3f4
commit
fc0e54ac68
21 changed files with 18 additions and 69 deletions
|
@ -5,4 +5,4 @@ version = "0.1.0"
|
|||
[dependencies]
|
||||
netutils = { git = "https://github.com/redox-os/netutils.git" }
|
||||
redox_event = { git = "https://github.com/redox-os/event.git" }
|
||||
redox_syscall = { git = "https://github.com/redox-os/syscall.git" }
|
||||
redox_syscall = "0.1"
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
[package]
|
||||
name = "example"
|
||||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
redox_syscall = { git = "https://github.com/redox-os/syscall.git" }
|
|
@ -1,39 +0,0 @@
|
|||
extern crate syscall;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::{Read, Write};
|
||||
use std::str;
|
||||
|
||||
use syscall::{Packet, Result, Scheme};
|
||||
|
||||
struct ExampleScheme;
|
||||
|
||||
impl Scheme for ExampleScheme {
|
||||
fn open(&self, path: &[u8], _flags: usize, uid: u32, gid: u32) -> Result<usize> {
|
||||
println!("{} from {}:{}", unsafe { str::from_utf8_unchecked(path) }, uid, gid);
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
fn dup(&self, file: usize, _buf: &[u8]) -> Result<usize> {
|
||||
Ok(file)
|
||||
}
|
||||
|
||||
fn close(&self, _file: usize) -> Result<usize> {
|
||||
Ok(0)
|
||||
}
|
||||
}
|
||||
|
||||
fn main(){
|
||||
// Daemonize
|
||||
if unsafe { syscall::clone(0).unwrap() } == 0 {
|
||||
let mut socket = File::create(":example").expect("example: failed to create example scheme");
|
||||
let scheme = ExampleScheme;
|
||||
loop {
|
||||
let mut packet = Packet::default();
|
||||
socket.read(&mut packet).expect("example: failed to read events from example scheme");
|
||||
println!("{:?}", packet);
|
||||
scheme.handle(&mut packet);
|
||||
socket.write(&packet).expect("example: failed to write responses to example scheme");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,4 +5,4 @@ version = "0.1.0"
|
|||
[dependencies]
|
||||
netutils = { git = "https://github.com/redox-os/netutils.git" }
|
||||
redox_event = { git = "https://github.com/redox-os/event.git" }
|
||||
redox_syscall = { git = "https://github.com/redox-os/syscall.git" }
|
||||
redox_syscall = "0.1"
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit baa69a2fa69b827645e59abc389f5a162d76f035
|
||||
Subproject commit c70e11f9e94a0bf445aa1c96243a514ee5b46d3e
|
|
@ -3,4 +3,4 @@ name = "ptyd"
|
|||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
redox_syscall = { git = "https://github.com/redox-os/syscall.git" }
|
||||
redox_syscall = "0.1"
|
||||
|
|
|
@ -3,5 +3,5 @@ name = "randd"
|
|||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
raw-cpuid = "2.*"
|
||||
redox_syscall = { git = "https://github.com/redox-os/syscall.git" }
|
||||
raw-cpuid = "2.0"
|
||||
redox_syscall = "0.1"
|
||||
|
|
|
@ -6,4 +6,4 @@ version = "0.1.0"
|
|||
netutils = { git = "https://github.com/redox-os/netutils.git" }
|
||||
rand = "0.3"
|
||||
redox_event = { git = "https://github.com/redox-os/event.git" }
|
||||
redox_syscall = { git = "https://github.com/redox-os/syscall.git" }
|
||||
redox_syscall = "0.1"
|
||||
|
|
|
@ -6,4 +6,4 @@ version = "0.1.0"
|
|||
netutils = { git = "https://github.com/redox-os/netutils.git" }
|
||||
rand = "0.3"
|
||||
redox_event = { git = "https://github.com/redox-os/event.git" }
|
||||
redox_syscall = { git = "https://github.com/redox-os/syscall.git" }
|
||||
redox_syscall = "0.1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue