From af548fd1bccca2419482071447a16c038a2d6fef Mon Sep 17 00:00:00 2001
From: Paul Sajna <paulsajna@gmail.com>
Date: Fri, 2 Mar 2018 14:49:47 -0800
Subject: [PATCH] add bindgen post-processing script, use it for unistd and
 stdlib.h

---
 bindgen_transform.sh |   4 +
 stdlib/lib.rs        | 305 ++++++++++++++++++++++++++++++++++++++
 unistd/src/lib.rs    | 346 ++++++++++++++++++++++++++++++-------------
 3 files changed, 554 insertions(+), 101 deletions(-)
 create mode 100755 bindgen_transform.sh
 create mode 100644 stdlib/lib.rs

diff --git a/bindgen_transform.sh b/bindgen_transform.sh
new file mode 100755
index 00000000..471e9883
--- /dev/null
+++ b/bindgen_transform.sh
@@ -0,0 +1,4 @@
+sed -i 's/::std::os::raw::/libc::/g' $1
+perl -i -p0e 's/extern "C" \{\n    pub fn/pub extern "C" fn/g' $1 
+perl -i -p0e 's/;\n\}/ {\n    unimplemented!();\n\}\n/g' $1
+
diff --git a/stdlib/lib.rs b/stdlib/lib.rs
new file mode 100644
index 00000000..38bf4da0
--- /dev/null
+++ b/stdlib/lib.rs
@@ -0,0 +1,305 @@
+/* automatically generated by rust-bindgen */
+
+pub type wchar_t = libc::c_int;
+
+#[repr(C)]
+#[derive(Debug, Copy)]
+pub struct div_t {
+    pub quot: libc::c_int,
+    pub rem: libc::c_int,
+}
+
+impl Clone for div_t {
+    fn clone(&self) -> Self { *self }
+}
+#[repr(C)]
+#[derive(Debug, Copy)]
+pub struct ldiv_t {
+    pub quot: libc::c_long,
+    pub rem: libc::c_long,
+}
+impl Clone for ldiv_t {
+    fn clone(&self) -> Self { *self }
+}
+pub extern "C" fn abort() {
+    unimplemented!();
+}
+
+pub extern "C" fn abs(arg1: libc::c_int) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn atexit(arg1: ::std::option::Option<unsafe extern "C" fn()>)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn atof(arg1: *const libc::c_char) -> f64 {
+    unimplemented!();
+}
+
+pub extern "C" fn atoi(arg1: *const libc::c_char) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn atol(arg1: *const libc::c_char)
+     -> libc::c_long {
+    unimplemented!();
+}
+
+pub extern "C" fn bsearch(arg1: *const libc::c_void,
+                   arg2: *const libc::c_void, arg3: usize,
+                   arg4: usize,
+                   arg5:
+                       ::std::option::Option<unsafe extern "C" fn(arg1:
+                                                                      *const libc::c_void,
+                                                                  arg2:
+                                                                      *const libc::c_void)
+                                                 -> libc::c_int>)
+     -> *mut libc::c_void {
+    unimplemented!();
+}
+
+pub extern "C" fn calloc(arg1: usize, arg2: usize) -> *mut libc::c_void {
+    unimplemented!();
+}
+
+pub extern "C" fn div(arg1: libc::c_int, arg2: libc::c_int)
+     -> div_t {
+    unimplemented!();
+}
+
+pub extern "C" fn drand48() -> f64 {
+    unimplemented!();
+}
+
+pub extern "C" fn ecvt(arg1: f64, arg2: libc::c_int,
+                arg3: *mut libc::c_int,
+                arg4: *mut libc::c_int)
+     -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn erand48(arg1: *mut libc::c_ushort) -> f64 {
+    unimplemented!();
+}
+
+pub extern "C" fn exit(arg1: libc::c_int) {
+    unimplemented!();
+}
+
+pub extern "C" fn fcvt(arg1: f64, arg2: libc::c_int,
+                arg3: *mut libc::c_int,
+                arg4: *mut libc::c_int)
+     -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn free(arg1: *mut libc::c_void) {
+    unimplemented!();
+}
+
+pub extern "C" fn gcvt(arg1: f64, arg2: libc::c_int,
+                arg3: *mut libc::c_char)
+     -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn getenv(arg1: *const libc::c_char)
+     -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn getsubopt(arg1: *mut *mut libc::c_char,
+                     arg2: *const *const libc::c_char,
+                     arg3: *mut *mut libc::c_char)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn grantpt(arg1: libc::c_int) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn initstate(arg1: libc::c_uint,
+                     arg2: *mut libc::c_char, arg3: usize)
+     -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn jrand48(arg1: *mut libc::c_ushort)
+     -> libc::c_long {
+    unimplemented!();
+}
+
+pub extern "C" fn l64a(arg1: libc::c_long) -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn labs(arg1: libc::c_long) -> libc::c_long {
+    unimplemented!();
+}
+
+pub extern "C" fn lcong48(arg1: *mut libc::c_ushort) {
+    unimplemented!();
+}
+
+pub extern "C" fn ldiv(arg1: libc::c_long, arg2: libc::c_long)
+     -> ldiv_t {
+    unimplemented!();
+}
+
+pub extern "C" fn lrand48() -> libc::c_long {
+    unimplemented!();
+}
+
+pub extern "C" fn malloc(arg1: usize) -> *mut libc::c_void {
+    unimplemented!();
+}
+
+pub extern "C" fn mblen(arg1: *const libc::c_char, arg2: usize)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn mbstowcs(arg1: *mut wchar_t, arg2: *const libc::c_char,
+                    arg3: usize) -> usize {
+    unimplemented!();
+}
+
+pub extern "C" fn mbtowc(arg1: *mut wchar_t, arg2: *const libc::c_char,
+                  arg3: usize) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn mktemp(arg1: *mut libc::c_char)
+     -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn mkstemp(arg1: *mut libc::c_char)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn mrand48() -> libc::c_long {
+    unimplemented!();
+}
+
+pub extern "C" fn nrand48(arg1: *mut libc::c_ushort)
+     -> libc::c_long {
+    unimplemented!();
+}
+
+pub extern "C" fn ptsname(arg1: libc::c_int)
+     -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn putenv(arg1: *mut libc::c_char) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn qsort(arg1: *mut libc::c_void, arg2: usize, arg3: usize,
+                 arg4:
+                     ::std::option::Option<unsafe extern "C" fn(arg1:
+                                                                    *const libc::c_void,
+                                                                arg2:
+                                                                    *const libc::c_void)
+                                               -> libc::c_int>) {
+    unimplemented!();
+}
+
+pub extern "C" fn rand() -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn rand_r(arg1: *mut libc::c_uint) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn random() -> libc::c_long {
+    unimplemented!();
+}
+
+pub extern "C" fn realloc(arg1: *mut libc::c_void, arg2: usize)
+     -> *mut libc::c_void {
+    unimplemented!();
+}
+
+pub extern "C" fn realpath(arg1: *const libc::c_char,
+                    arg2: *mut libc::c_char)
+     -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn seed48(arg1: *mut libc::c_ushort)
+     -> libc::c_ushort {
+    unimplemented!();
+}
+
+pub extern "C" fn setkey(arg1: *const libc::c_char) {
+    unimplemented!();
+}
+
+pub extern "C" fn setstate(arg1: *const libc::c_char)
+     -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn srand(arg1: libc::c_uint) {
+    unimplemented!();
+}
+
+pub extern "C" fn srand48(arg1: libc::c_long) {
+    unimplemented!();
+}
+
+pub extern "C" fn srandom(arg1: libc::c_uint) {
+    unimplemented!();
+}
+
+pub extern "C" fn strtod(arg1: *const libc::c_char,
+                  arg2: *mut *mut libc::c_char) -> f64 {
+    unimplemented!();
+}
+
+pub extern "C" fn strtol(arg1: *const libc::c_char,
+                  arg2: *mut *mut libc::c_char,
+                  arg3: libc::c_int) -> libc::c_long {
+    unimplemented!();
+}
+
+pub extern "C" fn strtoul(arg1: *const libc::c_char,
+                   arg2: *mut *mut libc::c_char,
+                   arg3: libc::c_int) -> libc::c_ulong {
+    unimplemented!();
+}
+
+pub extern "C" fn system(arg1: *const libc::c_char)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn ttyslot() -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn unlockpt(arg1: libc::c_int) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn valloc(arg1: usize) -> *mut libc::c_void {
+    unimplemented!();
+}
+
+pub extern "C" fn wcstombs(arg1: *mut libc::c_char, arg2: *const wchar_t,
+                    arg3: usize) -> usize {
+    unimplemented!();
+}
+
+pub extern "C" fn wctomb(arg1: *mut libc::c_char, arg2: wchar_t)
+     -> libc::c_int {
+    unimplemented!();
+}
+
diff --git a/unistd/src/lib.rs b/unistd/src/lib.rs
index 9e85fb8b..5455473e 100644
--- a/unistd/src/lib.rs
+++ b/unistd/src/lib.rs
@@ -1,252 +1,396 @@
-/// unistd implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/unistd.h.html
-
-extern crate libc;
-
-use libc::*;
-
-#[no_mangle]
-pub extern "C" fn access(path: *const c_char, amode: c_int) -> c_int {
-    unimplemented!();
-}
-
-#[no_mangle]
-pub extern "C" fn alarm(seconds: c_uint) -> c_uint {
+pub extern "C" fn alarm(arg1: libc::c_uint) -> libc::c_uint {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn brk(addr: *mut c_void) -> c_int {
+pub extern "C" fn brk(arg1: *mut libc::c_void) -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn chdir(path: *const c_char) -> c_int {
+pub extern "C" fn chdir(arg1: *const libc::c_char)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn chroot(path: *const c_char) -> c_int {
+pub extern "C" fn chroot(arg1: *const libc::c_char)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn chown(path: *const c_char, owner: uid_t, group: gid_t) -> c_int {
+pub extern "C" fn chown(arg1: *const libc::c_char, arg2: uid_t,
+                 arg3: gid_t) -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn close(fildes: c_int) -> c_int {
+pub extern "C" fn close(arg1: libc::c_int) -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn confstr(name: c_int, buf: *mut c_char, len: size_t) -> size_t {
+pub extern "C" fn confstr(arg1: libc::c_int,
+                   arg2: *mut libc::c_char, arg3: usize) -> usize {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn crypt(key: *const c_char, salt: *const c_char) -> *mut c_char {
+pub extern "C" fn crypt(arg1: *const libc::c_char,
+                 arg2: *const libc::c_char)
+     -> *mut libc::c_char {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn ctermid(s: *mut c_char) -> *mut c_char {
+pub extern "C" fn ctermid(arg1: *mut libc::c_char)
+     -> *mut libc::c_char {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn cuserid(s: *mut c_char) -> *mut c_char {
+pub extern "C" fn cuserid(s: *mut libc::c_char)
+     -> *mut libc::c_char {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn dup(fildes: c_int) -> c_int {
+pub extern "C" fn dup(arg1: libc::c_int) -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn dup2(fildes: c_int, fildes2: c_int) -> c_int {
+pub extern "C" fn dup2(arg1: libc::c_int, arg2: libc::c_int)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn encrypt(block: [c_char; 64], edflag: c_int) {
+pub extern "C" fn encrypt(arg1: *mut libc::c_char,
+                   arg2: libc::c_int) {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn execl(path: *const c_char, arg0: *const c_char /* TODO: , mut args: ... */) -> c_int {
+pub extern "C" fn execl(arg1: *const libc::c_char,
+                 arg2: *const libc::c_char, ...)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn execle(path: *const c_char, arg0: *const c_char /* TODO: , mut args: ... */) -> c_int {
+pub extern "C" fn execle(arg1: *const libc::c_char,
+                  arg2: *const libc::c_char, ...)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn execlp(file: *const c_char, arg0: *const c_char /* TODO: , mut args: ... */) -> c_int {
+pub extern "C" fn execlp(arg1: *const libc::c_char,
+                  arg2: *const libc::c_char, ...)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn execv(path: *const c_char, argv: *const *mut c_char) -> c_int {
+pub extern "C" fn execv(arg1: *const libc::c_char,
+                 arg2: *const *const libc::c_char)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn execve(path: *const c_char, argv: *const *mut c_char, envp: *const *mut c_char) -> c_int {
+pub extern "C" fn execve(arg1: *const libc::c_char,
+                  arg2: *const *const libc::c_char,
+                  arg3: *const *const libc::c_char)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn execvp(file: *const c_char, argv: *const *mut c_char) -> c_int {
+pub extern "C" fn execvp(arg1: *const libc::c_char,
+                  arg2: *const *const libc::c_char)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn _exit(status: c_int) {
+pub extern "C" fn _exit(arg1: libc::c_int) {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn fchown(fildes: c_int, owner: uid_t, group: gid_t) -> c_int {
+pub extern "C" fn fchown(arg1: libc::c_int, arg2: uid_t, arg3: gid_t)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn fchdir(fildes: c_int) -> c_int {
+pub extern "C" fn fchdir(arg1: libc::c_int) -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn fdatasync(fildes: c_int) -> c_int {
+pub extern "C" fn fdatasync(arg1: libc::c_int) -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
 pub extern "C" fn fork() -> pid_t {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn fpathconf(fildes: c_int, name: c_int) -> c_long {
+pub extern "C" fn fpathconf(arg1: libc::c_int, arg2: libc::c_int)
+     -> libc::c_long {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn fsync(fildes: c_int) -> c_int {
+pub extern "C" fn fsync(arg1: libc::c_int) -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn ftruncate(fildes: c_int, length: off_t) -> c_int {
+pub extern "C" fn ftruncate(arg1: libc::c_int, arg2: off_t)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char {
+pub extern "C" fn getcwd(arg1: *mut libc::c_char, arg2: usize)
+     -> *mut libc::c_char {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn getdtablesize() -> c_int {
+pub extern "C" fn getdtablesize() -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
 pub extern "C" fn getegid() -> gid_t {
     unimplemented!();
 }
 
-#[no_mangle]
 pub extern "C" fn geteuid() -> uid_t {
     unimplemented!();
 }
 
-#[no_mangle]
 pub extern "C" fn getgid() -> gid_t {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn getgroups(gidsetsize: c_int, grouplist: *mut gid_t) -> c_int {
+pub extern "C" fn getgroups(arg1: libc::c_int, arg2: *mut gid_t)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn gethostid() -> c_long {
+pub extern "C" fn gethostid() -> libc::c_long {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn getlogin() -> *mut c_char {
+pub extern "C" fn getlogin() -> *mut libc::c_char {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn getlogin_r(name: *mut c_char, namesize: size_t) -> c_int {
+pub extern "C" fn getlogin_r(arg1: *mut libc::c_char, arg2: usize)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn getopt(argc: c_int, argv: *const *mut c_char, opstring: *const c_char) -> c_int {
+pub extern "C" fn getopt(arg1: libc::c_int,
+                  arg2: *const *const libc::c_char,
+                  arg3: *const libc::c_char)
+     -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn getpagesize() -> c_int {
+pub extern "C" fn getpagesize() -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn getpass(prompt: *const c_char) -> *mut c_char {
+pub extern "C" fn getpass(arg1: *const libc::c_char)
+     -> *mut libc::c_char {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn getpgid(pid: pid_t) -> pid_t {
+pub extern "C" fn getpgid(arg1: pid_t) -> pid_t {
     unimplemented!();
 }
 
-#[no_mangle]
 pub extern "C" fn getpgrp() -> pid_t {
     unimplemented!();
 }
 
-#[no_mangle]
 pub extern "C" fn getpid() -> pid_t {
     unimplemented!();
 }
 
-#[no_mangle]
 pub extern "C" fn getppid() -> pid_t {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn getsid(pid: pid_t) -> pid_t {
+pub extern "C" fn getsid(arg1: pid_t) -> pid_t {
     unimplemented!();
 }
 
-#[no_mangle]
 pub extern "C" fn getuid() -> uid_t {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn getwd(path_name: *mut c_char) -> *mut c_char {
+pub extern "C" fn getwd(arg1: *mut libc::c_char)
+     -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn isatty(arg1: libc::c_int) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn lchown(arg1: *const libc::c_char, arg2: uid_t,
+                  arg3: gid_t) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn link(arg1: *const libc::c_char,
+                arg2: *const libc::c_char) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn lockf(arg1: libc::c_int, arg2: libc::c_int,
+                 arg3: off_t) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn lseek(arg1: libc::c_int, arg2: off_t,
+                 arg3: libc::c_int) -> off_t {
+    unimplemented!();
+}
+
+pub extern "C" fn nice(arg1: libc::c_int) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn pathconf(arg1: *const libc::c_char,
+                    arg2: libc::c_int) -> libc::c_long {
+    unimplemented!();
+}
+
+pub extern "C" fn pause() -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn pipe(arg1: *mut libc::c_int) -> libc::c_int {
     unimplemented!();
 }
 
-#[no_mangle]
-pub extern "C" fn isatty(fildes: c_int) -> c_int {
+pub extern "C" fn pread(arg1: libc::c_int,
+                 arg2: *mut libc::c_void, arg3: usize, arg4: off_t)
+     -> isize {
     unimplemented!();
 }
 
-/*
-#[no_mangle]
-pub extern "C" fn func(args) -> c_int {
+pub extern "C" fn pthread_atfork(arg1: ::std::option::Option<unsafe extern "C" fn()>,
+                          arg2: ::std::option::Option<unsafe extern "C" fn()>,
+                          arg3: ::std::option::Option<unsafe extern "C" fn()>)
+     -> libc::c_int {
     unimplemented!();
 }
-*/
+
+pub extern "C" fn pwrite(arg1: libc::c_int,
+                  arg2: *const libc::c_void, arg3: usize,
+                  arg4: off_t) -> isize {
+    unimplemented!();
+}
+
+pub extern "C" fn read(arg1: libc::c_int,
+                arg2: *mut libc::c_void, arg3: usize) -> isize {
+    unimplemented!();
+}
+
+pub extern "C" fn readlink(arg1: *const libc::c_char,
+                    arg2: *mut libc::c_char, arg3: usize)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn rmdir(arg1: *const libc::c_char)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn sbrk(arg1: isize) -> *mut libc::c_void {
+    unimplemented!();
+}
+
+pub extern "C" fn setgid(arg1: gid_t) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn setpgid(arg1: pid_t, arg2: pid_t) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn setpgrp() -> pid_t {
+    unimplemented!();
+}
+
+pub extern "C" fn setregid(arg1: gid_t, arg2: gid_t) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn setreuid(arg1: uid_t, arg2: uid_t) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn setsid() -> pid_t {
+    unimplemented!();
+}
+
+pub extern "C" fn setuid(arg1: uid_t) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn sleep(arg1: libc::c_uint) -> libc::c_uint {
+    unimplemented!();
+}
+
+pub extern "C" fn swab(arg1: *const libc::c_void,
+                arg2: *mut libc::c_void, arg3: isize) {
+    unimplemented!();
+}
+
+pub extern "C" fn symlink(arg1: *const libc::c_char,
+                   arg2: *const libc::c_char)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn sync() {
+    unimplemented!();
+}
+
+pub extern "C" fn sysconf(arg1: libc::c_int) -> libc::c_long {
+    unimplemented!();
+}
+
+pub extern "C" fn tcgetpgrp(arg1: libc::c_int) -> pid_t {
+    unimplemented!();
+}
+
+pub extern "C" fn tcsetpgrp(arg1: libc::c_int, arg2: pid_t)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn truncate(arg1: *const libc::c_char, arg2: off_t)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn ttyname(arg1: libc::c_int)
+     -> *mut libc::c_char {
+    unimplemented!();
+}
+
+pub extern "C" fn ttyname_r(arg1: libc::c_int,
+                     arg2: *mut libc::c_char, arg3: usize)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn ualarm(arg1: useconds_t, arg2: useconds_t) -> useconds_t {
+    unimplemented!();
+}
+
+pub extern "C" fn unlink(arg1: *const libc::c_char)
+     -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn usleep(arg1: useconds_t) -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn vfork() -> libc::c_int {
+    unimplemented!();
+}
+
+pub extern "C" fn write(arg1: libc::c_int,
+                 arg2: *const libc::c_void, arg3: usize) -> isize {
+    unimplemented!();
+}
+
-- 
GitLab