Browse Source

mman: mman.h should be located at sys/mman.h

 - Update target location of mman.h to sys/mman.h
 - Add more types to sys/type.h
Dan Robertson 7 years ago
parent
commit
2f718d40d6
4 changed files with 7 additions and 3 deletions
  1. 3 0
      include/sys/types.h
  2. 1 1
      src/mman/build.rs
  3. 2 2
      src/mman/cbindgen.toml
  4. 1 0
      src/platform/src/types.rs

+ 3 - 0
include/sys/types.h

@@ -8,6 +8,7 @@ typedef long dev_t;
 typedef unsigned long ino_t;
 
 typedef int gid_t;
+
 typedef int uid_t;
 
 typedef int mode_t;
@@ -18,6 +19,8 @@ typedef long off_t;
 
 typedef int pid_t;
 
+typedef unsigned id_t;
+
 typedef long ssize_t;
 
 typedef long time_t;

+ 1 - 1
src/mman/build.rs

@@ -7,5 +7,5 @@ fn main() {
     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/mman.h");
+        .write_to_file("../../target/include/sys/mman.h");
 }

+ 2 - 2
src/mman/cbindgen.toml

@@ -1,5 +1,5 @@
-sys_includes = []
-include_guard = "_MMAN_H"
+sys_includes = ["sys/types.h"]
+include_guard = "_SYS_MMAN_H"
 language = "C"
 
 [enum]

+ 1 - 0
src/platform/src/types.rs

@@ -50,6 +50,7 @@ pub type off_t = i64;
 pub type mode_t = u16;
 pub type time_t = i64;
 pub type pid_t = usize;
+pub type id_t = usize;
 pub type gid_t = usize;
 pub type uid_t = usize;
 pub type dev_t = usize;