wait: Add crate for sys/wait.h

Add the basics of sys/wait.h so that we get a bit closer to being able
to compile libc-test.
This commit is contained in:
Dan Robertson
2018-03-10 21:10:12 +00:00
parent c6f16547ff
commit ca7f3a00e6
6 changed files with 82 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
[package]
name = "wait"
version = "0.1.0"
authors = ["Dan Robertson <danlrobertson89@gmail.com>"]
[build-dependencies]
cbindgen = { path = "../../cbindgen" }
[dependencies]
platform = { path = "../platform" }
resource = { path = "../resource" }
+11
View File
@@ -0,0 +1,11 @@
extern crate cbindgen;
use std::{env, fs};
fn main() {
let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
fs::create_dir_all("../../target/include").expect("failed to create include directory");
cbindgen::generate(crate_dir)
.expect("failed to generate bindings")
.write_to_file("../../target/include/sys/wait.h");
}
+6
View File
@@ -0,0 +1,6 @@
sys_includes = ["sys/types.h", "sys/resource.h"]
include_guard = "_SYS_WAIT_H"
language = "C"
[enum]
prefix_with_name = true
+43
View File
@@ -0,0 +1,43 @@
//! sys/wait.h implementation for Redox, following
//! http://pubs.opengroup.org/onlinepubs/7908799/xsh/syswait.h.html
#![no_std]
extern crate platform;
extern crate resource;
use platform::types::*;
use resource::rusage;
#[no_mangle]
pub unsafe extern "C" fn wait(stat_loc: *mut c_int) -> pid_t {
unimplemented!();
}
#[no_mangle]
pub unsafe extern "C" fn wait3(
stat_loc: *mut c_int,
options: c_int,
resource_usage: *mut rusage,
) -> pid_t {
unimplemented!();
}
/*
* TODO: implement idtype_t, id_t, and siginfo_t
*
* #[no_mangle]
* pub unsafe extern "C" fn waitid(
* idtype: idtype_t,
* id: id_t,
* infop: siginfo_t,
* options: c_int
* ) -> c_int {
* unimplemented!();
* }
*/
#[no_mangle]
pub unsafe extern "C" fn waitpid(pid: pid_t, stat_loc: *mut c_int, options: c_int) -> pid_t {
unimplemented!();
}