Merge branch 'pal' into 'master'
Intense refactor See merge request redox-os/relibc!159
This commit is contained in:
Generated
+61
-437
@@ -6,30 +6,19 @@ dependencies = [
|
||||
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "arpainet"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"errno 0.1.0",
|
||||
"netinet 0.1.0",
|
||||
"platform 0.1.0",
|
||||
"sys_socket 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atty"
|
||||
version = "0.2.10"
|
||||
version = "0.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.0.3"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@@ -38,9 +27,9 @@ version = "0.5.2"
|
||||
dependencies = [
|
||||
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"standalone-syn 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -48,12 +37,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.18"
|
||||
version = "1.0.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "0.1.4"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@@ -62,8 +51,8 @@ version = "2.32.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -73,80 +62,13 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "compiler_builtins"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/rust-lang-nursery/compiler-builtins.git#5d370bb352c915225981d89b80227afa4836cb93"
|
||||
source = "git+https://github.com/rust-lang-nursery/compiler-builtins.git#3caed3c80207fa43ba2963949c5f104a63c4264e"
|
||||
|
||||
[[package]]
|
||||
name = "crt0"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"platform 0.1.0",
|
||||
"stdio 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ctype"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dirent"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"errno 0.1.0",
|
||||
"fcntl 0.1.0",
|
||||
"platform 0.1.0",
|
||||
"stdio 0.1.0",
|
||||
"unistd 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dtoa"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fcntl"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fenv"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "float"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"fenv 0.1.0",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fnmatch"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
"relibc 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -154,7 +76,7 @@ name = "fuchsia-zircon"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -163,34 +85,6 @@ name = "fuchsia-zircon-sys"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "grp"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "in_h"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
"sys_socket 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "inttypes"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"ctype 0.1.0",
|
||||
"errno 0.1.0",
|
||||
"platform 0.1.0",
|
||||
"stdlib 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "0.4.2"
|
||||
@@ -198,56 +92,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.0.2"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"spin 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"spin 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.42"
|
||||
version = "0.2.43"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "locale"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.3.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.3"
|
||||
version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "netinet"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"in_h 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "platform"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ralloc 1.0.0",
|
||||
"redox_syscall 0.1.40 (git+https://gitlab.redox-os.org/redox-os/syscall.git?branch=relibc)",
|
||||
"sc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"spin 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -258,16 +128,6 @@ dependencies = [
|
||||
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pwd"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"errno 0.1.0",
|
||||
"fcntl 0.1.0",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "0.3.15"
|
||||
@@ -291,17 +151,17 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.4.2"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.5.4"
|
||||
version = "0.5.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -334,46 +194,15 @@ dependencies = [
|
||||
name = "relibc"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"arpainet 0.1.0",
|
||||
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cc 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"compiler_builtins 0.1.0 (git+https://github.com/rust-lang-nursery/compiler-builtins.git)",
|
||||
"ctype 0.1.0",
|
||||
"dirent 0.1.0",
|
||||
"errno 0.1.0",
|
||||
"fcntl 0.1.0",
|
||||
"fenv 0.1.0",
|
||||
"float 0.1.0",
|
||||
"fnmatch 0.1.0",
|
||||
"grp 0.1.0",
|
||||
"inttypes 0.1.0",
|
||||
"locale 0.1.0",
|
||||
"netinet 0.1.0",
|
||||
"platform 0.1.0",
|
||||
"pwd 0.1.0",
|
||||
"semaphore 0.1.0",
|
||||
"setjmp 0.1.0",
|
||||
"signal 0.1.0",
|
||||
"stdio 0.1.0",
|
||||
"stdlib 0.1.0",
|
||||
"string 0.1.0",
|
||||
"strings 0.1.0",
|
||||
"sys_ioctl 0.1.0",
|
||||
"sys_mman 0.1.0",
|
||||
"sys_resource 0.1.0",
|
||||
"sys_select 0.1.0",
|
||||
"sys_socket 0.1.0",
|
||||
"sys_stat 0.1.0",
|
||||
"sys_time 0.1.0",
|
||||
"sys_times 0.1.0",
|
||||
"sys_un 0.1.0",
|
||||
"sys_utsname 0.1.0",
|
||||
"sys_wait 0.1.0",
|
||||
"termios 0.1.0",
|
||||
"time 0.1.0",
|
||||
"unistd 0.1.0",
|
||||
"utime 0.1.0",
|
||||
"wchar 0.1.0",
|
||||
"wctype 0.1.0",
|
||||
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ralloc 1.0.0",
|
||||
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.1.40 (git+https://gitlab.redox-os.org/redox-os/syscall.git?branch=relibc)",
|
||||
"sc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"spin 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"va_list 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -384,22 +213,19 @@ dependencies = [
|
||||
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "0.2.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "sc"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "semaphore"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.70"
|
||||
version = "1.0.75"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -426,30 +252,17 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.24"
|
||||
version = "1.0.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "setjmp"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "signal"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"errno 0.1.0",
|
||||
"platform 0.1.0",
|
||||
"ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spin"
|
||||
version = "0.4.8"
|
||||
version = "0.4.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@@ -470,53 +283,6 @@ dependencies = [
|
||||
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stdio"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"errno 0.1.0",
|
||||
"fcntl 0.1.0",
|
||||
"lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"platform 0.1.0",
|
||||
"string 0.1.0",
|
||||
"va_list 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stdlib"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"ctype 0.1.0",
|
||||
"errno 0.1.0",
|
||||
"fcntl 0.1.0",
|
||||
"platform 0.1.0",
|
||||
"rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string 0.1.0",
|
||||
"time 0.1.0",
|
||||
"unistd 0.1.0",
|
||||
"wchar 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "string"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"errno 0.1.0",
|
||||
"platform 0.1.0",
|
||||
"signal 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "strings"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "strsim"
|
||||
version = "0.7.0"
|
||||
@@ -540,103 +306,12 @@ dependencies = [
|
||||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sys_ioctl"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sys_mman"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sys_resource"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
"sys_time 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sys_select"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sys_socket"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sys_stat"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sys_time"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sys_times"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sys_un"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
"sys_socket 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sys_utsname"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sys_wait"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
"sys_resource 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tempdir"
|
||||
version = "0.3.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -645,19 +320,11 @@ name = "termion"
|
||||
version = "1.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "termios"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "textwrap"
|
||||
version = "0.10.0"
|
||||
@@ -666,21 +333,12 @@ dependencies = [
|
||||
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"errno 0.1.0",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -703,26 +361,6 @@ name = "unicode-xid"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "unistd"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"errno 0.1.0",
|
||||
"platform 0.1.0",
|
||||
"stdio 0.1.0",
|
||||
"string 0.1.0",
|
||||
"sys_time 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "utime"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "va_list"
|
||||
version = "0.1.0"
|
||||
@@ -734,7 +372,7 @@ dependencies = [
|
||||
name = "va_list-helper"
|
||||
version = "0.0.2"
|
||||
dependencies = [
|
||||
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cc 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -743,24 +381,9 @@ version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "wchar"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"errno 0.1.0",
|
||||
"platform 0.1.0",
|
||||
"stdio 0.1.0",
|
||||
"time 0.1.0",
|
||||
"va_list 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wctype"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cbindgen 0.5.2",
|
||||
"platform 0.1.0",
|
||||
]
|
||||
name = "version_check"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
@@ -783,35 +406,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[metadata]
|
||||
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
|
||||
"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1"
|
||||
"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789"
|
||||
"checksum cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "2119ea4867bd2b8ed3aecab467709720b2d55b1bcfe09f772fd68066eaf15275"
|
||||
"checksum cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efe5c877e17a9c717a0bf3613b2709f723202c4e4675cc8f12926ded29bcb17e"
|
||||
"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
|
||||
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
|
||||
"checksum cc 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)" = "4a6007c146fdd28d4512a794b07ffe9d8e89e6bf86e2e0c4ddff2e1fb54a0007"
|
||||
"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3"
|
||||
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
|
||||
"checksum compiler_builtins 0.1.0 (git+https://github.com/rust-lang-nursery/compiler-builtins.git)" = "<none>"
|
||||
"checksum dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d301140eb411af13d3115f9a562c85cc6b541ade9dfa314132244aaee7489dd"
|
||||
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
|
||||
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
|
||||
"checksum itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5adb58558dcd1d786b5f0bd15f3226ee23486e24b7b58304b60f64dc68e62606"
|
||||
"checksum lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fb497c35d362b6a331cfd94956a07fc2c78a4604cdbee844a81170386b996dd3"
|
||||
"checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1"
|
||||
"checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7"
|
||||
"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
|
||||
"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
|
||||
"checksum log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "61bd98ae7f7b754bc53dca7d44b604f733c6bba044ea6f41bc8d89272d8161d2"
|
||||
"checksum log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cba860f648db8e6f269df990180c2217f333472b4a6e901e97446858487971e2"
|
||||
"checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0"
|
||||
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
|
||||
"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5"
|
||||
"checksum rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "12397506224b2f93e6664ffc4f664b29be8208e5157d3d90b44f09b5fae470ea"
|
||||
"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
|
||||
"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
|
||||
"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2"
|
||||
"checksum redox_syscall 0.1.40 (git+https://gitlab.redox-os.org/redox-os/syscall.git?branch=relibc)" = "<none>"
|
||||
"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
|
||||
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
|
||||
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
|
||||
"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7"
|
||||
"checksum sc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4ebbb026ba4a707c25caec2db5ef59ad8b41f7ad77cad06257e06229c891f376"
|
||||
"checksum serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)" = "0c3adf19c07af6d186d91dae8927b83b0553d07ca56cbf7f2f32560455c91920"
|
||||
"checksum serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)" = "22d340507cea0b7e6632900a176101fea959c7065d93ba555072da90aaaafc87"
|
||||
"checksum serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "652bc323d694dc925829725ec6c890156d8e70ae5202919869cb00fe2eff3788"
|
||||
"checksum serde_derive_internals 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "32f1926285523b2db55df263d2aa4eb69ddcfa7a7eade6430323637866b513ab"
|
||||
"checksum serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c6908c7b925cd6c590358a4034de93dbddb20c45e1d021931459fd419bf0e2"
|
||||
"checksum spin 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14db77c5b914df6d6173dda9a3b3f5937bd802934fa5edaf934df06a3491e56f"
|
||||
"checksum serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "44dd2cfde475037451fa99b7e5df77aa3cfd1536575fa8e7a538ab36dcde49ae"
|
||||
"checksum spin 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "37b5646825922b96b5d7d676b5bb3458a54498e96ed7b0ce09dc43a07038fea4"
|
||||
"checksum standalone-quote 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dcedac1d6d98e7e9d1d6e628f5635af9566688ae5f6cea70a3976f495ae8d839"
|
||||
"checksum standalone-syn 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "115808f5187c07c23cb93eee49d542fae54c6e8285d3a24c6ff683fcde9243db"
|
||||
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
|
||||
@@ -826,6 +449,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
|
||||
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
|
||||
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
|
||||
"checksum version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7716c242968ee87e5542f8021178248f267f295a5c4803beae8b8b7fd9bc6051"
|
||||
"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd"
|
||||
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
||||
+16
-39
@@ -8,56 +8,33 @@ name = "c"
|
||||
crate-type = ["staticlib"]
|
||||
|
||||
[workspace]
|
||||
members = ["src/crt0"]
|
||||
members = ["src/crt0", "cbindgen"]
|
||||
|
||||
[build-dependencies]
|
||||
cc = "1.0.17"
|
||||
|
||||
[dependencies]
|
||||
arpainet = { path = "src/arpainet" }
|
||||
ctype = { path = "src/ctype" }
|
||||
dirent = { path = "src/dirent" }
|
||||
errno = { path = "src/errno" }
|
||||
fcntl = { path = "src/fcntl" }
|
||||
fenv = { path = "src/fenv" }
|
||||
float = { path = "src/float" }
|
||||
fnmatch = { path = "src/fnmatch" }
|
||||
grp = { path = "src/grp" }
|
||||
inttypes = { path = "src/inttypes" }
|
||||
locale = { path = "src/locale" }
|
||||
netinet = { path = "src/netinet" }
|
||||
platform = { path = "src/platform" }
|
||||
pwd = { path = "src/pwd" }
|
||||
semaphore = { path = "src/semaphore" }
|
||||
setjmp = { path = "src/setjmp" }
|
||||
signal = { path = "src/signal" }
|
||||
stdio = { path = "src/stdio" }
|
||||
stdlib = { path = "src/stdlib" }
|
||||
string = { path = "src/string" }
|
||||
strings = { path = "src/strings" }
|
||||
sys_ioctl = { path = "src/sys_ioctl" }
|
||||
sys_mman = { path = "src/sys_mman" }
|
||||
sys_resource = { path = "src/sys_resource" }
|
||||
sys_select = { path = "src/sys_select" }
|
||||
sys_socket = { path = "src/sys_socket" }
|
||||
sys_stat = { path = "src/sys_stat" }
|
||||
sys_time = { path = "src/sys_time" }
|
||||
sys_times = { path = "src/sys_times" }
|
||||
sys_un = { path = "src/sys_un" }
|
||||
sys_utsname = { path = "src/sys_utsname" }
|
||||
sys_wait = { path = "src/sys_wait" }
|
||||
termios = { path = "src/termios" }
|
||||
time = { path = "src/time" }
|
||||
unistd = { path = "src/unistd" }
|
||||
utime = { path = "src/utime" }
|
||||
wchar = { path = "src/wchar" }
|
||||
wctype = { path = "src/wctype" }
|
||||
lazy_static = { version = "*", features = ["nightly", "spin_no_std"] }
|
||||
rand = { version = "0.5.2", default-features = false }
|
||||
va_list = { path = "va_list", features = ["no_std"] }
|
||||
|
||||
[dependencies.compiler_builtins]
|
||||
git = "https://github.com/rust-lang-nursery/compiler-builtins.git"
|
||||
default-features = false
|
||||
features = ["no-lang-items", "mangled-names"]
|
||||
|
||||
[dependencies.ralloc]
|
||||
path = "ralloc"
|
||||
default-features = false
|
||||
optional = true
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
sc = "0.2"
|
||||
|
||||
[target.'cfg(target_os = "redox")'.dependencies]
|
||||
redox_syscall = { git = "https://gitlab.redox-os.org/redox-os/syscall.git", branch = "relibc" }
|
||||
spin = "0.4"
|
||||
|
||||
[profile.dev]
|
||||
panic = "abort"
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ SRC=\
|
||||
src/*/*/* \
|
||||
src/*/*/*/*
|
||||
|
||||
.PHONY: all clean fmt install libc libm test
|
||||
.PHONY: all clean fmt include install libc libm test
|
||||
|
||||
all: | libc libm
|
||||
|
||||
@@ -28,6 +28,9 @@ clean:
|
||||
cargo clean
|
||||
make -C tests clean
|
||||
|
||||
check:
|
||||
cargo check
|
||||
|
||||
fmt:
|
||||
./fmt.sh
|
||||
|
||||
@@ -35,14 +38,14 @@ install: all
|
||||
mkdir -pv "$(DESTDIR)/lib"
|
||||
mkdir -pv "$(DESTDIR)/include"
|
||||
cp -rv "include"/* "$(DESTDIR)/include"
|
||||
cp -rv "target/include"/* "$(DESTDIR)/include"
|
||||
cp -rv "$(BUILD)/include"/* "$(DESTDIR)/include"
|
||||
cp -v "$(BUILD)/release/libc.a" "$(DESTDIR)/lib"
|
||||
cp -v "$(BUILD)/release/crt0.o" "$(DESTDIR)/lib"
|
||||
cp -rv "openlibm/include"/* "$(DESTDIR)/include"
|
||||
cp -rv "openlibm/src"/*.h "$(DESTDIR)/include"
|
||||
cp -v "$(BUILD)/openlibm/libopenlibm.a" "$(DESTDIR)/lib/libm.a"
|
||||
|
||||
libc: $(BUILD)/release/libc.a $(BUILD)/release/crt0.o
|
||||
libc: $(BUILD)/release/libc.a $(BUILD)/release/crt0.o $(BUILD)/include
|
||||
|
||||
libm: $(BUILD)/openlibm/libopenlibm.a
|
||||
|
||||
@@ -65,6 +68,12 @@ $(BUILD)/release/crt0.o: $(SRC)
|
||||
CARGO_INCREMENTAL=0 cargo rustc --release --manifest-path src/crt0/Cargo.toml $(CARGOFLAGS) -- --emit obj=$@
|
||||
touch $@
|
||||
|
||||
$(BUILD)/include: $(SRC)
|
||||
rm -rf $@ $@.partial
|
||||
mkdir -p $@.partial
|
||||
./include.sh $@.partial
|
||||
mv $@.partial $@
|
||||
|
||||
$(BUILD)/openlibm: openlibm
|
||||
rm -rf $@ $@.partial
|
||||
mkdir -p $(BUILD)
|
||||
@@ -72,5 +81,5 @@ $(BUILD)/openlibm: openlibm
|
||||
mv $@.partial $@
|
||||
touch $@
|
||||
|
||||
$(BUILD)/openlibm/libopenlibm.a: $(BUILD)/openlibm
|
||||
make CC=$(CC) CPPFLAGS="-fno-stack-protector -I$(shell pwd)/include -I $(shell pwd)/target/include" -C $< libopenlibm.a
|
||||
$(BUILD)/openlibm/libopenlibm.a: $(BUILD)/openlibm $(BUILD)/include
|
||||
make CC=$(CC) CPPFLAGS="-fno-stack-protector -I$(shell pwd)/include -I $(shell pwd)/$(BUILD)/include" -C $< libopenlibm.a
|
||||
|
||||
@@ -11,6 +11,7 @@ fn main() {
|
||||
.flag("-I")
|
||||
.flag(&format!("{}/include", crate_dir))
|
||||
.flag("-fno-stack-protector")
|
||||
.flag("-Wno-expansion-to-defined")
|
||||
.file("src/c/dlmalloc.c")
|
||||
.file("src/c/fcntl.c")
|
||||
.file("src/c/stack_chk.c")
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
ARGS=()
|
||||
|
||||
for crate in relibc $(find src -name Cargo.toml | cut -d '/' -f2 | grep -v template)
|
||||
do
|
||||
ARGS+=("--package" "$crate")
|
||||
done
|
||||
|
||||
cargo fmt "${ARGS[@]}" "$@"
|
||||
cargo fmt --package relibc --package crt0 "$@"
|
||||
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
include="$(realpath "$1")"
|
||||
cbindgen="$(realpath cbindgen)"
|
||||
|
||||
for config in src/header/*/cbindgen.toml
|
||||
do
|
||||
dir="$(dirname "$config")"
|
||||
name="$(basename "$dir")"
|
||||
if [ "${name:0:1}" != "_" ]
|
||||
then
|
||||
header="$include/${name/_/\/}.h"
|
||||
pushd "$dir"
|
||||
cargo run --release --manifest-path "$cbindgen/Cargo.toml" -- \
|
||||
-c cbindgen.toml -o "$header" mod.rs
|
||||
popd
|
||||
fi
|
||||
done
|
||||
@@ -1,14 +0,0 @@
|
||||
[package]
|
||||
name = "arpainet"
|
||||
version = "0.1.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
build = "build.rs"
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = { path = "../../cbindgen" }
|
||||
|
||||
[dependencies]
|
||||
platform = { path = "../platform" }
|
||||
errno = { path = "../errno" }
|
||||
sys_socket = { path = "../sys_socket" }
|
||||
netinet = { path = "../netinet" }
|
||||
@@ -1,11 +0,0 @@
|
||||
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/arpa/inet.h");
|
||||
}
|
||||
+1255
File diff suppressed because it is too large
Load Diff
+1
-2
@@ -8,5 +8,4 @@ name = "crt0"
|
||||
crate-type = ["staticlib"]
|
||||
|
||||
[dependencies]
|
||||
platform = { path = "../platform" }
|
||||
stdio = { path = "../stdio" }
|
||||
relibc = { path = "../.." }
|
||||
|
||||
+8
-100
@@ -1,20 +1,11 @@
|
||||
//! crt0
|
||||
|
||||
#![no_std]
|
||||
#![feature(alloc)]
|
||||
#![feature(asm)]
|
||||
#![feature(lang_items)]
|
||||
#![feature(linkage)]
|
||||
#![feature(naked_functions)]
|
||||
#![feature(panic_implementation)]
|
||||
#![feature(lang_items)]
|
||||
|
||||
extern crate alloc;
|
||||
extern crate platform;
|
||||
extern crate stdio;
|
||||
|
||||
use alloc::Vec;
|
||||
use core::ptr;
|
||||
use platform::types::*;
|
||||
|
||||
#[no_mangle]
|
||||
#[naked]
|
||||
@@ -22,7 +13,7 @@ pub unsafe extern "C" fn _start() {
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
asm!("mov rdi, rsp
|
||||
and rsp, 0xFFFFFFFFFFFFFFF0
|
||||
call _start_rust"
|
||||
call relibc_start"
|
||||
:
|
||||
:
|
||||
:
|
||||
@@ -30,7 +21,7 @@ pub unsafe extern "C" fn _start() {
|
||||
);
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
asm!("mov x0, sp
|
||||
bl _start_rust"
|
||||
bl relibc_start"
|
||||
:
|
||||
:
|
||||
:
|
||||
@@ -38,96 +29,13 @@ pub unsafe extern "C" fn _start() {
|
||||
);
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct Stack {
|
||||
argc: isize,
|
||||
argv0: *const c_char,
|
||||
}
|
||||
|
||||
impl Stack {
|
||||
fn argc(&self) -> isize {
|
||||
self.argc
|
||||
}
|
||||
|
||||
fn argv(&self) -> *const *const c_char {
|
||||
&self.argv0 as *const _
|
||||
}
|
||||
|
||||
fn envp(&self) -> *const *const c_char {
|
||||
unsafe { self.argv().offset(self.argc() + 1) }
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn _start_rust(sp: &'static Stack) -> ! {
|
||||
extern "C" {
|
||||
fn main(argc: isize, argv: *const *const c_char, envp: *const *const c_char) -> c_int;
|
||||
}
|
||||
|
||||
let argc = sp.argc();
|
||||
let argv = sp.argv();
|
||||
|
||||
let envp = sp.envp();
|
||||
let mut len = 0;
|
||||
while *envp.offset(len) != ptr::null() {
|
||||
len += 1;
|
||||
}
|
||||
platform::inner_environ = Vec::with_capacity(len as usize + 1);
|
||||
for i in 0..len {
|
||||
let mut item = *envp.offset(i);
|
||||
let mut len = 0;
|
||||
while *item.offset(len) != 0 {
|
||||
len += 1;
|
||||
}
|
||||
|
||||
let buf = platform::alloc(len as usize + 1) as *mut c_char;
|
||||
for i in 0..=len {
|
||||
*buf.offset(i) = *item.offset(i);
|
||||
}
|
||||
platform::inner_environ.push(buf);
|
||||
}
|
||||
platform::inner_environ.push(ptr::null_mut());
|
||||
platform::environ = platform::inner_environ.as_mut_ptr();
|
||||
|
||||
// Initialize stdin/stdout/stderr, see https://github.com/rust-lang/rust/issues/51718
|
||||
stdio::stdin = stdio::default_stdin.get();
|
||||
stdio::stdout = stdio::default_stdout.get();
|
||||
stdio::stderr = stdio::default_stderr.get();
|
||||
|
||||
platform::exit(main(
|
||||
argc,
|
||||
argv,
|
||||
// not envp, because programs like bash try to modify this *const*
|
||||
// pointer :|
|
||||
platform::environ as *const *const c_char
|
||||
));
|
||||
}
|
||||
|
||||
#[panic_implementation]
|
||||
#[linkage = "weak"]
|
||||
#[no_mangle]
|
||||
pub extern "C" fn rust_begin_unwind(pi: &::core::panic::PanicInfo) -> ! {
|
||||
use core::fmt::Write;
|
||||
pub extern "C" fn rust_begin_unwind(_pi: &::core::panic::PanicInfo) -> ! {
|
||||
extern "C" {
|
||||
fn exit(status: i32) -> !;
|
||||
}
|
||||
|
||||
let mut w = platform::FileWriter(2);
|
||||
let _ = w.write_fmt(format_args!("RELIBC CRT0 PANIC: {}\n", pi));
|
||||
|
||||
platform::exit(1);
|
||||
}
|
||||
|
||||
#[lang = "oom"]
|
||||
#[linkage = "weak"]
|
||||
#[no_mangle]
|
||||
pub extern "C" fn rust_oom(layout: ::core::alloc::Layout) -> ! {
|
||||
use core::fmt::Write;
|
||||
|
||||
let mut w = platform::FileWriter(2);
|
||||
let _ = w.write_fmt(format_args!(
|
||||
"RELIBC OOM: {} bytes aligned to {} bytes\n",
|
||||
layout.size(),
|
||||
layout.align()
|
||||
));
|
||||
|
||||
platform::exit(1);
|
||||
unsafe { exit(1) }
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
[package]
|
||||
name = "ctype"
|
||||
version = "0.1.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
build = "build.rs"
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = { path = "../../cbindgen" }
|
||||
|
||||
[dependencies]
|
||||
platform = { path = "../platform" }
|
||||
@@ -1,11 +0,0 @@
|
||||
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/ctype.h");
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
[package]
|
||||
name = "dirent"
|
||||
version = "0.1.0"
|
||||
authors = ["jD91mZM2 <me@krake.one>"]
|
||||
build = "build.rs"
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = { path = "../../cbindgen" }
|
||||
|
||||
[dependencies]
|
||||
errno = { path = "../errno" }
|
||||
fcntl = { path = "../fcntl" }
|
||||
platform = { path = "../platform" }
|
||||
stdio = { path = "../stdio" }
|
||||
unistd = { path = "../unistd" }
|
||||
@@ -1,11 +0,0 @@
|
||||
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/dirent.h");
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
[package]
|
||||
name = "errno"
|
||||
version = "0.1.0"
|
||||
authors = ["Alex Lyon <arcterus@mail.com>"]
|
||||
build = "build.rs"
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = { path = "../../cbindgen" }
|
||||
|
||||
[dependencies]
|
||||
platform = { path = "../platform" }
|
||||
@@ -1,11 +0,0 @@
|
||||
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/errno.h");
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
[package]
|
||||
name = "fcntl"
|
||||
version = "0.1.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
build = "build.rs"
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = { path = "../../cbindgen" }
|
||||
|
||||
[dependencies]
|
||||
platform = { path = "../platform" }
|
||||
@@ -1,11 +0,0 @@
|
||||
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/fcntl.h");
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
use platform::types::*;
|
||||
|
||||
pub const O_RDONLY: c_int = 0x0000;
|
||||
pub const O_WRONLY: c_int = 0x0001;
|
||||
pub const O_RDWR: c_int = 0x0002;
|
||||
pub const O_CREAT: c_int = 0x0040;
|
||||
pub const O_TRUNC: c_int = 0x0200;
|
||||
pub const O_ACCMODE: c_int = O_RDONLY | O_WRONLY | O_RDWR;
|
||||
pub const O_APPEND: c_int = 0o2000;
|
||||
pub const O_CLOEXEC: c_int = 0o2_000_000;
|
||||
pub const O_DIRECTORY: c_int = 0o200_000;
|
||||
pub const O_EXCL: c_int = 0o200;
|
||||
pub const O_NONBLOCK: c_int = 0o4000;
|
||||
@@ -1,10 +0,0 @@
|
||||
[package]
|
||||
name = "fenv"
|
||||
version = "0.1.0"
|
||||
authors = ["Dan Robertson <danlrobertson89@gmail.com>"]
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = { path = "../../cbindgen" }
|
||||
|
||||
[dependencies]
|
||||
platform = { path = "../platform" }
|
||||
@@ -1,11 +0,0 @@
|
||||
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/fenv.h");
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
[package]
|
||||
name = "float"
|
||||
version = "0.1.0"
|
||||
authors = ["Dan Robertson <danlrobertson89@gmail.com>"]
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = { path = "../../cbindgen" }
|
||||
|
||||
[dependencies]
|
||||
platform = { path = "../platform" }
|
||||
fenv = { path = "../fenv" }
|
||||
@@ -1,11 +0,0 @@
|
||||
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/float.h");
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
[package]
|
||||
name = "fnmatch"
|
||||
version = "0.1.0"
|
||||
authors = ["jD91mZM2 <me@krake.one>"]
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = { path = "../../cbindgen" }
|
||||
|
||||
[dependencies]
|
||||
platform = { path = "../platform" }
|
||||
@@ -1,11 +0,0 @@
|
||||
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/fnmatch.h");
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
[package]
|
||||
name = "grp"
|
||||
version = "0.1.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
build = "build.rs"
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = { path = "../../cbindgen" }
|
||||
|
||||
[dependencies]
|
||||
platform = { path = "../platform" }
|
||||
@@ -1,11 +0,0 @@
|
||||
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/grp.h");
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
sys_includes = []
|
||||
include_guard = "_PTHREAD_H"
|
||||
language = "C"
|
||||
style = "Tag"
|
||||
|
||||
[enum]
|
||||
prefix_with_name = true
|
||||
@@ -1,13 +1,26 @@
|
||||
use platform::types::*;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy)]
|
||||
pub struct sched_param {
|
||||
pub _address: u8,
|
||||
}
|
||||
impl Clone for sched_param {
|
||||
fn clone(&self) -> Self {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_destroy(attr: *mut pthread_attr_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_attr_destroy(attr: *mut pthread_attr_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_getdetachstate(
|
||||
attr: *const pthread_attr_t,
|
||||
detachstate: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
detachstate: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -15,15 +28,15 @@ pub extern "C" fn pthread_attr_getdetachstate(
|
||||
pub extern "C" fn pthread_attr_getguardsize(
|
||||
attr: *const pthread_attr_t,
|
||||
guardsize: *mut usize,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_getinheritsched(
|
||||
attr: *const pthread_attr_t,
|
||||
inheritsched: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
inheritsched: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -31,31 +44,31 @@ pub extern "C" fn pthread_attr_getinheritsched(
|
||||
pub extern "C" fn pthread_attr_getschedparam(
|
||||
attr: *const pthread_attr_t,
|
||||
param: *mut sched_param,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_getschedpolicy(
|
||||
attr: *const pthread_attr_t,
|
||||
policy: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
policy: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_getscope(
|
||||
attr: *const pthread_attr_t,
|
||||
contentionscope: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
contentionscope: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_getstackaddr(
|
||||
attr: *const pthread_attr_t,
|
||||
stackaddr: *mut *mut libc::c_void,
|
||||
) -> libc::c_int {
|
||||
stackaddr: *mut *mut c_void,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -63,33 +76,33 @@ pub extern "C" fn pthread_attr_getstackaddr(
|
||||
pub extern "C" fn pthread_attr_getstacksize(
|
||||
attr: *const pthread_attr_t,
|
||||
stacksize: *mut usize,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_init(arg1: *mut pthread_attr_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_attr_init(arg1: *mut pthread_attr_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_setdetachstate(
|
||||
attr: *mut pthread_attr_t,
|
||||
detachstate: libc::c_int,
|
||||
) -> libc::c_int {
|
||||
detachstate: c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_setguardsize(arg1: *mut pthread_attr_t, arg2: usize) -> libc::c_int {
|
||||
pub extern "C" fn pthread_attr_setguardsize(arg1: *mut pthread_attr_t, arg2: usize) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_setinheritsched(
|
||||
attr: *mut pthread_attr_t,
|
||||
inheritsched: libc::c_int,
|
||||
) -> libc::c_int {
|
||||
inheritsched: c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -97,61 +110,61 @@ pub extern "C" fn pthread_attr_setinheritsched(
|
||||
pub extern "C" fn pthread_attr_setschedparam(
|
||||
attr: *mut pthread_attr_t,
|
||||
param: *mut sched_param,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_setschedpolicy(
|
||||
attr: *mut pthread_attr_t,
|
||||
policy: libc::c_int,
|
||||
) -> libc::c_int {
|
||||
policy: c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_setscope(
|
||||
attr: *mut pthread_attr_t,
|
||||
contentionscope: libc::c_int,
|
||||
) -> libc::c_int {
|
||||
contentionscope: c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_setstackaddr(
|
||||
attr: *mut pthread_attr_t,
|
||||
stackaddr: *mut libc::c_void,
|
||||
) -> libc::c_int {
|
||||
stackaddr: *mut c_void,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_attr_setstacksize(attr: *mut pthread_attr_t, stacksize: usize) -> libc::c_int {
|
||||
pub extern "C" fn pthread_attr_setstacksize(attr: *mut pthread_attr_t, stacksize: usize) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_cancel(thread: pthread_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_cancel(thread: pthread_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_cleanup_push(routine: *mut libc::c_void, arg: *mut libc::c_void) {
|
||||
pub extern "C" fn pthread_cleanup_push(routine: *mut c_void, arg: *mut c_void) {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_cleanup_pop(execute: libc::c_int) {
|
||||
pub extern "C" fn pthread_cleanup_pop(execute: c_int) {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -159,12 +172,12 @@ pub extern "C" fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> libc::c_int
|
||||
pub extern "C" fn pthread_cond_init(
|
||||
cond: *mut pthread_cond_t,
|
||||
attr: *const pthread_condattr_t,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_cond_signal(cond: *mut pthread_cond_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_cond_signal(cond: *mut pthread_cond_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -173,7 +186,7 @@ pub extern "C" fn pthread_cond_timedwait(
|
||||
cond: *mut pthread_cond_t,
|
||||
mutex: *mut pthread_mutex_t,
|
||||
abstime: *const timespec,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -181,33 +194,33 @@ pub extern "C" fn pthread_cond_timedwait(
|
||||
pub extern "C" fn pthread_cond_wait(
|
||||
cond: *mut pthread_cond_t,
|
||||
mutex: *mut pthread_mutex_t,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_condattr_getpshared(
|
||||
attr: *const pthread_condattr_t,
|
||||
pshared: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
pshared: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_condattr_setpshared(
|
||||
attr: *mut pthread_condattr_t,
|
||||
pshared: libc::c_int,
|
||||
) -> libc::c_int {
|
||||
pshared: c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -215,74 +228,74 @@ pub extern "C" fn pthread_condattr_setpshared(
|
||||
pub extern "C" fn pthread_create(
|
||||
thread: *mut pthread_t,
|
||||
attr: *const pthread_attr_t,
|
||||
start_routine: Option<unsafe extern "C" fn(arg1: *mut libc::c_void) -> *mut libc::c_void>,
|
||||
arg: *mut libc::c_void,
|
||||
) -> libc::c_int {
|
||||
start_routine: Option<unsafe extern "C" fn(arg1: *mut c_void) -> *mut c_void>,
|
||||
arg: *mut c_void,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_detach(thread: pthread_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_detach(thread: pthread_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_equal(t1: pthread_t, t2: pthread_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_equal(t1: pthread_t, t2: pthread_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_exit(value_ptr: *mut libc::c_void) {
|
||||
pub extern "C" fn pthread_exit(value_ptr: *mut c_void) {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_getconcurrency() -> libc::c_int {
|
||||
pub extern "C" fn pthread_getconcurrency() -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_getschedparam(
|
||||
thread: pthread_t,
|
||||
policy: *mut libc::c_int,
|
||||
policy: *mut c_int,
|
||||
param: *mut sched_param,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_getspecific(key: pthread_key_t) -> *mut libc::c_void {
|
||||
pub extern "C" fn pthread_getspecific(key: pthread_key_t) -> *mut c_void {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_join(thread: pthread_t, value_ptr: *mut *mut libc::c_void) -> libc::c_int {
|
||||
pub extern "C" fn pthread_join(thread: pthread_t, value_ptr: *mut *mut c_void) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_key_create(
|
||||
key: *mut pthread_key_t,
|
||||
destructor: Option<unsafe extern "C" fn(arg1: *mut libc::c_void)>,
|
||||
) -> libc::c_int {
|
||||
destructor: Option<unsafe extern "C" fn(arg1: *mut c_void)>,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_key_delete(key: pthread_key_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_key_delete(key: pthread_key_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutex_destroy(mutex: *mut pthread_mutex_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_mutex_destroy(mutex: *mut pthread_mutex_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutex_getprioceiling(
|
||||
mutex: *const pthread_mutex_t,
|
||||
prioceiling: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
prioceiling: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -290,105 +303,105 @@ pub extern "C" fn pthread_mutex_getprioceiling(
|
||||
pub extern "C" fn pthread_mutex_init(
|
||||
mutex: *mut pthread_mutex_t,
|
||||
attr: *const pthread_mutexattr_t,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutex_lock(mutex: *mut pthread_mutex_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_mutex_lock(mutex: *mut pthread_mutex_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutex_setprioceiling(
|
||||
mutex: *mut pthread_mutex_t,
|
||||
prioceiling: libc::c_int,
|
||||
old_ceiling: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
prioceiling: c_int,
|
||||
old_ceiling: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutex_trylock(mutex: *mut pthread_mutex_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_mutex_trylock(mutex: *mut pthread_mutex_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutex_unlock(mutex: *mut pthread_mutex_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_mutex_unlock(mutex: *mut pthread_mutex_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutexattr_getprioceiling(
|
||||
attr: *const pthread_mutexattr_t,
|
||||
prioceiling: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
prioceiling: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutexattr_getprotocol(
|
||||
attr: *const pthread_mutexattr_t,
|
||||
protocol: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
protocol: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutexattr_getpshared(
|
||||
attr: *const pthread_mutexattr_t,
|
||||
pshared: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
pshared: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutexattr_gettype(
|
||||
attr: *const pthread_mutexattr_t,
|
||||
type_: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
type_: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutexattr_setprioceiling(
|
||||
attr: *mut pthread_mutexattr_t,
|
||||
prioceiling: libc::c_int,
|
||||
) -> libc::c_int {
|
||||
prioceiling: c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutexattr_setprotocol(
|
||||
attr: *mut pthread_mutexattr_t,
|
||||
protocol: libc::c_int,
|
||||
) -> libc::c_int {
|
||||
protocol: c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutexattr_setpshared(
|
||||
attr: *mut pthread_mutexattr_t,
|
||||
pshared: libc::c_int,
|
||||
) -> libc::c_int {
|
||||
pshared: c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_mutexattr_settype(
|
||||
attr: *mut pthread_mutexattr_t,
|
||||
type_: libc::c_int,
|
||||
) -> libc::c_int {
|
||||
type_: c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -396,12 +409,12 @@ pub extern "C" fn pthread_mutexattr_settype(
|
||||
pub extern "C" fn pthread_once(
|
||||
once_control: *mut pthread_once_t,
|
||||
init_routine: Option<unsafe extern "C" fn()>,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_rwlock_destroy(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_rwlock_destroy(rwlock: *mut pthread_rwlock_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -409,58 +422,58 @@ pub extern "C" fn pthread_rwlock_destroy(rwlock: *mut pthread_rwlock_t) -> libc:
|
||||
pub extern "C" fn pthread_rwlock_init(
|
||||
rwlock: *mut pthread_rwlock_t,
|
||||
attr: *const pthread_rwlockattr_t,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_rwlock_rdlock(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_rwlock_rdlock(rwlock: *mut pthread_rwlock_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_rwlock_tryrdlock(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_rwlock_tryrdlock(rwlock: *mut pthread_rwlock_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_rwlock_trywrlock(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_rwlock_trywrlock(rwlock: *mut pthread_rwlock_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_rwlock_unlock(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_rwlock_unlock(rwlock: *mut pthread_rwlock_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_rwlock_wrlock(rwlock: *mut pthread_rwlock_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_rwlock_wrlock(rwlock: *mut pthread_rwlock_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_rwlockattr_destroy(rwlock: *mut pthread_rwlockattr_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_rwlockattr_destroy(rwlock: *mut pthread_rwlockattr_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_rwlockattr_getpshared(
|
||||
rwlock: *const pthread_rwlockattr_t,
|
||||
pshared: *mut libc::c_int,
|
||||
) -> libc::c_int {
|
||||
pshared: *mut c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_rwlockattr_init(rwlock: *mut pthread_rwlockattr_t) -> libc::c_int {
|
||||
pub extern "C" fn pthread_rwlockattr_init(rwlock: *mut pthread_rwlockattr_t) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_rwlockattr_setpshared(
|
||||
rwlock: *mut pthread_rwlockattr_t,
|
||||
pshared: libc::c_int,
|
||||
) -> libc::c_int {
|
||||
pshared: c_int,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -470,34 +483,34 @@ pub extern "C" fn pthread_self() -> pthread_t {
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_setcancelstate(state: libc::c_int, oldstate: *mut libc::c_int) -> libc::c_int {
|
||||
pub extern "C" fn pthread_setcancelstate(state: c_int, oldstate: *mut c_int) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_setcanceltype(type_: libc::c_int, oldtype: *mut libc::c_int) -> libc::c_int {
|
||||
pub extern "C" fn pthread_setcanceltype(type_: c_int, oldtype: *mut c_int) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_setconcurrency(new_level: libc::c_int) -> libc::c_int {
|
||||
pub extern "C" fn pthread_setconcurrency(new_level: c_int) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_setschedparam(
|
||||
thread: pthread_t,
|
||||
policy: libc::c_int,
|
||||
policy: c_int,
|
||||
param: *mut sched_param,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn pthread_setspecific(
|
||||
key: pthread_key_t,
|
||||
value: *const libc::c_void,
|
||||
) -> libc::c_int {
|
||||
value: *const c_void,
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -505,44 +518,3 @@ pub extern "C" fn pthread_setspecific(
|
||||
pub extern "C" fn pthread_testcancel() {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy)]
|
||||
pub struct sched_param {
|
||||
pub _address: u8,
|
||||
}
|
||||
impl Clone for sched_param {
|
||||
fn clone(&self) -> Self {
|
||||
*self
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy)]
|
||||
pub struct sched_param {
|
||||
pub _address: u8,
|
||||
}
|
||||
impl Clone for sched_param {
|
||||
fn clone(&self) -> Self {
|
||||
*self
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy)]
|
||||
pub struct sched_param {
|
||||
pub _address: u8,
|
||||
}
|
||||
impl Clone for sched_param {
|
||||
fn clone(&self) -> Self {
|
||||
*self
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy)]
|
||||
pub struct sched_param {
|
||||
pub _address: u8,
|
||||
}
|
||||
impl Clone for sched_param {
|
||||
fn clone(&self) -> Self {
|
||||
*self
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,5 @@
|
||||
//! template implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/template.h.html
|
||||
|
||||
#![no_std]
|
||||
|
||||
extern crate platform;
|
||||
|
||||
use platform::types::*;
|
||||
|
||||
/*
|
||||
@@ -0,0 +1,7 @@
|
||||
sys_includes = []
|
||||
include_guard = "_AIO_H"
|
||||
language = "C"
|
||||
style = "Tag"
|
||||
|
||||
[enum]
|
||||
prefix_with_name = true
|
||||
@@ -1,34 +1,37 @@
|
||||
use header::time::sigevent;
|
||||
use platform::types::*;
|
||||
|
||||
pub struct aiocb {
|
||||
pub aio_fildes: libc::c_int,
|
||||
pub aio_lio_opcode: libc::c_int,
|
||||
pub aio_reqprio: libc::c_int,
|
||||
pub aio_buf: *mut libc::c_void,
|
||||
pub aio_fildes: c_int,
|
||||
pub aio_lio_opcode: c_int,
|
||||
pub aio_reqprio: c_int,
|
||||
pub aio_buf: *mut c_void,
|
||||
pub aio_nbytes: usize,
|
||||
pub aio_sigevent: sigevent,
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn aio_read(aiocbp: *mut aiocb) -> libc::c_int {
|
||||
pub extern "C" fn aio_read(aiocbp: *mut aiocb) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn aio_write(aiocbp: *mut aiocb) -> libc::c_int {
|
||||
pub extern "C" fn aio_write(aiocbp: *mut aiocb) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn lio_listio(
|
||||
mode: libc::c_int,
|
||||
mode: c_int,
|
||||
list: *const *const aiocb,
|
||||
nent: libc::c_int,
|
||||
nent: c_int,
|
||||
sig: *mut sigevent,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn aio_error(aiocbp: *const aiocb) -> libc::c_int {
|
||||
pub extern "C" fn aio_error(aiocbp: *const aiocb) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
@@ -38,20 +41,20 @@ pub extern "C" fn aio_return(aiocbp: *mut aiocb) -> usize {
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn aio_cancel(fildes: libc::c_int, aiocbp: *mut aiocb) -> libc::c_int {
|
||||
pub extern "C" fn aio_cancel(fildes: c_int, aiocbp: *mut aiocb) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn aio_suspend(
|
||||
list: *const *const aiocb,
|
||||
nent: libc::c_int,
|
||||
nent: c_int,
|
||||
timeout: *const timespec,
|
||||
) -> libc::c_int {
|
||||
) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
// #[no_mangle]
|
||||
pub extern "C" fn aio_fsync(operation: libc::c_int, aiocbp: *mut aiocb) -> libc::c_int {
|
||||
pub extern "C" fn aio_fsync(operation: c_int, aiocbp: *mut aiocb) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
sys_includes = ["stddef.h", "sys/socket.h", "netinet/in.h"]
|
||||
include_guard = "_ARPAINET_H"
|
||||
include_guard = "_ARPA_INET_H"
|
||||
language = "C"
|
||||
style = "Tag"
|
||||
|
||||
@@ -1,20 +1,11 @@
|
||||
//! arpainet implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/arpainet.h.html
|
||||
|
||||
#![no_std]
|
||||
#![feature(alloc)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
|
||||
extern crate errno;
|
||||
extern crate netinet;
|
||||
extern crate platform;
|
||||
extern crate sys_socket;
|
||||
//! arpa/inet implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/arpainet.h.html
|
||||
|
||||
use core::str::FromStr;
|
||||
use core::{mem, ptr, slice, str};
|
||||
use errno::*;
|
||||
use netinet::in_h::in_addr;
|
||||
use core::{ptr, slice, str};
|
||||
|
||||
use header::errno::*;
|
||||
use header::netinet_in::in_addr;
|
||||
use platform;
|
||||
use platform::c_str;
|
||||
use platform::types::*;
|
||||
|
||||
@@ -38,8 +29,6 @@ pub extern "C" fn ntohs(netshort: u16) -> u16 {
|
||||
u16::from_be(netshort)
|
||||
}
|
||||
|
||||
static mut NTOA_ADDR: [c_char; 16] = [0; 16];
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn inet_aton(cp: *const c_char, inp: *mut in_addr) -> c_int {
|
||||
// TODO: octal/hex
|
||||
@@ -48,6 +37,8 @@ pub unsafe extern "C" fn inet_aton(cp: *const c_char, inp: *mut in_addr) -> c_in
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn inet_ntoa(addr: in_addr) -> *const c_char {
|
||||
static mut NTOA_ADDR: [c_char; 16] = [0; 16];
|
||||
|
||||
inet_ntop(
|
||||
AF_INET,
|
||||
&addr as *const in_addr as *const c_void,
|
||||
@@ -62,7 +53,7 @@ pub unsafe extern "C" fn inet_pton(domain: c_int, src: *const c_char, dest: *mut
|
||||
platform::errno = EAFNOSUPPORT;
|
||||
-1
|
||||
} else {
|
||||
let mut s_addr = slice::from_raw_parts_mut(
|
||||
let s_addr = slice::from_raw_parts_mut(
|
||||
&mut (*(dest as *mut in_addr)).s_addr as *mut _ as *mut u8,
|
||||
4,
|
||||
);
|
||||
@@ -106,27 +97,27 @@ pub unsafe extern "C" fn inet_ntop(
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
//#[no_mangle]
|
||||
pub extern "C" fn inet_addr(cp: *const c_char) -> in_addr_t {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
//#[no_mangle]
|
||||
pub extern "C" fn inet_lnaof(_in: in_addr) -> in_addr_t {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
//#[no_mangle]
|
||||
pub extern "C" fn inet_makeaddr(net: in_addr_t, lna: in_addr_t) -> in_addr {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
//#[no_mangle]
|
||||
pub extern "C" fn inet_netof(_in: in_addr) -> in_addr_t {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
//#[no_mangle]
|
||||
pub extern "C" fn inet_network(cp: *const c_char) -> in_addr_t {
|
||||
unimplemented!();
|
||||
}
|
||||
@@ -1,9 +1,5 @@
|
||||
//! ctype implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/ctype.h.html
|
||||
|
||||
#![no_std]
|
||||
|
||||
extern crate platform;
|
||||
|
||||
use platform::types::*;
|
||||
|
||||
#[no_mangle]
|
||||
@@ -1,18 +1,13 @@
|
||||
//! dirent implementation following http://pubs.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html
|
||||
|
||||
#![no_std]
|
||||
#![feature(alloc)]
|
||||
|
||||
extern crate alloc;
|
||||
extern crate errno;
|
||||
extern crate fcntl;
|
||||
extern crate platform;
|
||||
extern crate stdio;
|
||||
extern crate unistd;
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use core::{mem, ptr};
|
||||
|
||||
use c_str::CStr;
|
||||
use header::{errno, fcntl, unistd};
|
||||
use platform;
|
||||
use platform::types::*;
|
||||
use platform::{Pal, Sys};
|
||||
|
||||
const DIR_BUF_SIZE: usize = mem::size_of::<dirent>() * 3;
|
||||
|
||||
@@ -41,7 +36,8 @@ pub struct dirent {
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn opendir(path: *const c_char) -> *mut DIR {
|
||||
let fd = platform::open(
|
||||
let path = unsafe { CStr::from_ptr(path) };
|
||||
let fd = Sys::open(
|
||||
path,
|
||||
fcntl::O_RDONLY | fcntl::O_DIRECTORY | fcntl::O_CLOEXEC,
|
||||
0,
|
||||
@@ -62,7 +58,7 @@ pub extern "C" fn opendir(path: *const c_char) -> *mut DIR {
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn closedir(dir: *mut DIR) -> c_int {
|
||||
let ret = platform::close((*dir).fd);
|
||||
let ret = Sys::close((*dir).fd);
|
||||
Box::from_raw(dir);
|
||||
ret
|
||||
}
|
||||
@@ -70,7 +66,7 @@ pub unsafe extern "C" fn closedir(dir: *mut DIR) -> c_int {
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn readdir(dir: *mut DIR) -> *mut dirent {
|
||||
if (*dir).index >= (*dir).len {
|
||||
let read = platform::getdents(
|
||||
let read = Sys::getdents(
|
||||
(*dir).fd,
|
||||
(*dir).buf.as_mut_ptr() as *mut platform::types::dirent,
|
||||
(*dir).buf.len(),
|
||||
@@ -1,9 +1,6 @@
|
||||
//! errno implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/errno.h.html
|
||||
|
||||
#![no_std]
|
||||
|
||||
extern crate platform;
|
||||
|
||||
use platform;
|
||||
use platform::types::*;
|
||||
|
||||
#[no_mangle]
|
||||
@@ -0,0 +1,15 @@
|
||||
use platform::types::*;
|
||||
|
||||
pub const O_RDONLY: c_int = 0x0000;
|
||||
pub const O_WRONLY: c_int = 0x0001;
|
||||
pub const O_RDWR: c_int = 0x0002;
|
||||
pub const O_CREAT: c_int = 0x0040;
|
||||
pub const O_EXCL: c_int = 0x0080;
|
||||
pub const O_TRUNC: c_int = 0x0200;
|
||||
pub const O_APPEND: c_int = 0x0400;
|
||||
pub const O_NONBLOCK: c_int = 0x0800;
|
||||
pub const O_DIRECTORY: c_int = 0x1_0000;
|
||||
pub const O_NOFOLLOW: c_int = 0x2_0000;
|
||||
pub const O_CLOEXEC: c_int = 0x8_0000;
|
||||
pub const O_PATH: c_int = 0x20_0000;
|
||||
pub const O_ACCMODE: c_int = O_RDONLY | O_WRONLY | O_RDWR;
|
||||
@@ -1,12 +1,10 @@
|
||||
//! fcntl implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/fcntl.h.html
|
||||
|
||||
#![no_std]
|
||||
|
||||
extern crate platform;
|
||||
|
||||
use c_str::CStr;
|
||||
use platform::types::*;
|
||||
use platform::{Pal, Sys};
|
||||
|
||||
pub use sys::*;
|
||||
pub use self::sys::*;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[path = "linux.rs"]
|
||||
@@ -38,17 +36,11 @@ pub extern "C" fn creat(path: *const c_char, mode: mode_t) -> c_int {
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn sys_fcntl(fildes: c_int, cmd: c_int, arg: c_int) -> c_int {
|
||||
platform::fcntl(fildes, cmd, arg)
|
||||
Sys::fcntl(fildes, cmd, arg)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn sys_open(path: *const c_char, oflag: c_int, mode: mode_t) -> c_int {
|
||||
platform::open(path, oflag, mode)
|
||||
let path = unsafe { CStr::from_ptr(path) };
|
||||
Sys::open(path, oflag, mode)
|
||||
}
|
||||
|
||||
/*
|
||||
#[no_mangle]
|
||||
pub extern "C" fn func(args) -> c_int {
|
||||
unimplemented!();
|
||||
}
|
||||
*/
|
||||
@@ -14,7 +14,7 @@ pub const O_CREAT: c_int = 0x0200_0000;
|
||||
pub const O_TRUNC: c_int = 0x0400_0000;
|
||||
pub const O_EXCL: c_int = 0x0800_0000;
|
||||
pub const O_DIRECTORY: c_int = 0x1000_0000;
|
||||
pub const O_STAT: c_int = 0x2000_0000;
|
||||
pub const O_PATH: c_int = 0x2000_0000;
|
||||
pub const O_SYMLINK: c_int = 0x4000_0000;
|
||||
pub const O_NOFOLLOW: c_int = 0x8000_0000;
|
||||
pub const O_ACCMODE: c_int = O_RDONLY | O_WRONLY | O_RDWR;
|
||||
@@ -1,10 +1,6 @@
|
||||
//! fenv.h implementation for Redox, following
|
||||
//! http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fenv.h.html
|
||||
|
||||
#![no_std]
|
||||
|
||||
extern crate platform;
|
||||
|
||||
use platform::types::*;
|
||||
|
||||
pub const FE_ALL_EXCEPT: c_int = 0;
|
||||
@@ -1,12 +1,7 @@
|
||||
//! float.h implementation for Redox, following
|
||||
//! http://pubs.opengroup.org/onlinepubs/7908799/xsh/float.h.html
|
||||
|
||||
#![no_std]
|
||||
|
||||
extern crate fenv;
|
||||
extern crate platform;
|
||||
|
||||
use fenv::{fegetround, FE_TONEAREST};
|
||||
use header::fenv::{fegetround, FE_TONEAREST};
|
||||
use platform::types::*;
|
||||
|
||||
pub const FLT_RADIX: c_int = 2;
|
||||
@@ -1,18 +1,14 @@
|
||||
//! fnmatch implementation
|
||||
#![no_std]
|
||||
#![feature(alloc)]
|
||||
|
||||
extern crate alloc;
|
||||
extern crate platform;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use platform::types::*;
|
||||
|
||||
pub const FNM_NOMATCH: c_int = 1;
|
||||
|
||||
pub const FNM_NOESCAPE: c_int = 1;
|
||||
pub const FNM_PATHNAME: c_int = 2;
|
||||
pub const FNM_PERIOD: c_int = 4;
|
||||
pub const FNM_PERIOD: c_int = 4;
|
||||
pub const FNM_CASEFOLD: c_int = 8;
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -43,7 +39,7 @@ unsafe fn next_token(pattern: &mut *const c_char, flags: c_int) -> Option<Token>
|
||||
}
|
||||
*pattern = pattern.offset(1);
|
||||
Token::Char(c)
|
||||
},
|
||||
}
|
||||
b'?' => Token::Any,
|
||||
b'*' => Token::Wildcard,
|
||||
b'[' => {
|
||||
@@ -51,7 +47,9 @@ unsafe fn next_token(pattern: &mut *const c_char, flags: c_int) -> Option<Token>
|
||||
let invert = if **pattern as u8 == b'!' {
|
||||
*pattern = pattern.offset(1);
|
||||
true
|
||||
} else { false };
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
||||
loop {
|
||||
let mut c = **pattern as u8;
|
||||
@@ -68,8 +66,8 @@ unsafe fn next_token(pattern: &mut *const c_char, flags: c_int) -> Option<Token>
|
||||
// Trailing backslash. Maybe error?
|
||||
break;
|
||||
}
|
||||
},
|
||||
_ => ()
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
if matches.len() >= 2 && matches[matches.len() - 1] == b'-' {
|
||||
let len = matches.len();
|
||||
@@ -85,13 +83,17 @@ unsafe fn next_token(pattern: &mut *const c_char, flags: c_int) -> Option<Token>
|
||||
// Otherwise, there was no closing ]. Maybe error?
|
||||
|
||||
Token::Match(invert, matches)
|
||||
},
|
||||
c => Token::Char(c)
|
||||
}
|
||||
c => Token::Char(c),
|
||||
})
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn fnmatch(mut pattern: *const c_char, mut input: *const c_char, flags: c_int) -> c_int {
|
||||
pub unsafe extern "C" fn fnmatch(
|
||||
mut pattern: *const c_char,
|
||||
mut input: *const c_char,
|
||||
flags: c_int,
|
||||
) -> c_int {
|
||||
let pathname = flags & FNM_PATHNAME == FNM_PATHNAME;
|
||||
let casefold = flags & FNM_CASEFOLD == FNM_CASEFOLD;
|
||||
|
||||
@@ -113,7 +115,7 @@ pub unsafe extern "C" fn fnmatch(mut pattern: *const c_char, mut input: *const c
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
input = input.offset(1);
|
||||
},
|
||||
}
|
||||
Some(Token::Char(c)) => {
|
||||
let mut a = *input as u8;
|
||||
if casefold && a >= b'a' && a <= b'z' {
|
||||
@@ -130,14 +132,15 @@ pub unsafe extern "C" fn fnmatch(mut pattern: *const c_char, mut input: *const c
|
||||
leading = true;
|
||||
}
|
||||
input = input.offset(1);
|
||||
},
|
||||
}
|
||||
Some(Token::Match(invert, matches)) => {
|
||||
if (pathname && *input as u8 == b'/') || matches.contains(&(*input as u8)) == invert {
|
||||
if (pathname && *input as u8 == b'/') || matches.contains(&(*input as u8)) == invert
|
||||
{
|
||||
// Found it, but it's inverted! Or vise versa.
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
input = input.offset(1);
|
||||
},
|
||||
}
|
||||
Some(Token::Wildcard) => {
|
||||
loop {
|
||||
let c = *input as u8;
|
||||
@@ -158,9 +161,8 @@ pub unsafe extern "C" fn fnmatch(mut pattern: *const c_char, mut input: *const c
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
}
|
||||
unreachable!("nothing should be able to break out of the loop");
|
||||
},
|
||||
None => return FNM_NOMATCH // Pattern ended but there's still some input
|
||||
}
|
||||
None => return FNM_NOMATCH, // Pattern ended but there's still some input
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,5 @@
|
||||
//! grp implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/grp.h.html
|
||||
|
||||
#![no_std]
|
||||
|
||||
extern crate platform;
|
||||
|
||||
use platform::types::*;
|
||||
|
||||
#[repr(C)]
|
||||
@@ -1,12 +1,7 @@
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate stdlib;
|
||||
extern crate ctype;
|
||||
extern crate errno;
|
||||
extern crate platform;
|
||||
|
||||
use errno::*;
|
||||
use header::ctype;
|
||||
use header::errno::*;
|
||||
use header::stdlib::*;
|
||||
use platform;
|
||||
use platform::types::*;
|
||||
|
||||
#[no_mangle]
|
||||
@@ -35,7 +30,6 @@ pub unsafe extern "C" fn strtoimax(
|
||||
endptr: *mut *mut c_char,
|
||||
base: c_int,
|
||||
) -> intmax_t {
|
||||
use stdlib::*;
|
||||
strto_impl!(
|
||||
intmax_t,
|
||||
false,
|
||||
@@ -53,7 +47,6 @@ pub unsafe extern "C" fn strtoumax(
|
||||
endptr: *mut *mut c_char,
|
||||
base: c_int,
|
||||
) -> uintmax_t {
|
||||
use stdlib::*;
|
||||
strto_impl!(
|
||||
uintmax_t,
|
||||
false,
|
||||
@@ -1,11 +1,7 @@
|
||||
//! locale implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/locale.h.html
|
||||
|
||||
#![no_std]
|
||||
#![feature(alloc)]
|
||||
|
||||
extern crate platform;
|
||||
|
||||
use core::ptr;
|
||||
|
||||
use platform::types::*;
|
||||
|
||||
const EMPTY_PTR: *const c_char = "\0" as *const _ as *const c_char;
|
||||
@@ -0,0 +1,41 @@
|
||||
pub mod aio;
|
||||
pub mod arpa_inet;
|
||||
pub mod ctype;
|
||||
pub mod dirent;
|
||||
pub mod errno;
|
||||
pub mod fcntl;
|
||||
pub mod fenv;
|
||||
pub mod float;
|
||||
pub mod fnmatch;
|
||||
pub mod grp;
|
||||
pub mod inttypes;
|
||||
pub mod locale;
|
||||
pub mod netinet_in;
|
||||
//pub mod pthread;
|
||||
pub mod pwd;
|
||||
pub mod semaphore;
|
||||
pub mod setjmp;
|
||||
pub mod sgtty;
|
||||
pub mod signal;
|
||||
pub mod stdio;
|
||||
pub mod stdlib;
|
||||
pub mod string;
|
||||
pub mod strings;
|
||||
pub mod sys_file;
|
||||
pub mod sys_ioctl;
|
||||
pub mod sys_mman;
|
||||
pub mod sys_resource;
|
||||
pub mod sys_select;
|
||||
pub mod sys_socket;
|
||||
pub mod sys_stat;
|
||||
pub mod sys_time;
|
||||
pub mod sys_times;
|
||||
pub mod sys_un;
|
||||
pub mod sys_utsname;
|
||||
pub mod sys_wait;
|
||||
pub mod termios;
|
||||
pub mod time;
|
||||
pub mod unistd;
|
||||
pub mod utime;
|
||||
pub mod wchar;
|
||||
pub mod wctype;
|
||||
@@ -1,12 +1,7 @@
|
||||
#![no_std]
|
||||
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
extern crate platform;
|
||||
extern crate sys_socket;
|
||||
|
||||
use header::sys_socket::sa_family_t;
|
||||
use platform::types::*;
|
||||
use sys_socket::{sa_family_t, sockaddr};
|
||||
|
||||
pub type in_addr_t = u32;
|
||||
pub type in_port_t = u16;
|
||||
@@ -14,19 +9,19 @@ pub type in_port_t = u16;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct in_addr {
|
||||
pub s_addr: in_addr_t
|
||||
pub s_addr: in_addr_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct in6_addr {
|
||||
pub s6_addr: [u8; 16]
|
||||
pub s6_addr: [u8; 16],
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct sockaddr_in {
|
||||
pub sin_family: sa_family_t,
|
||||
pub sin_port: in_port_t,
|
||||
pub sin_addr: in_addr
|
||||
pub sin_addr: in_addr,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
@@ -35,7 +30,7 @@ pub struct sockaddr_in6 {
|
||||
pub sin6_port: in_port_t,
|
||||
pub sin6_flowinfo: u32,
|
||||
pub sin6_addr: in6_addr,
|
||||
pub sin6_scope_id: u32
|
||||
pub sin6_scope_id: u32,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
@@ -1,17 +1,14 @@
|
||||
//! pwd implementation for relibc
|
||||
|
||||
#![no_std]
|
||||
#![feature(alloc)]
|
||||
|
||||
extern crate alloc;
|
||||
extern crate errno;
|
||||
extern crate fcntl;
|
||||
extern crate platform;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use core::ptr;
|
||||
|
||||
use c_str::CStr;
|
||||
use header::{errno, fcntl};
|
||||
use platform;
|
||||
use platform::types::*;
|
||||
use platform::RawFile;
|
||||
use platform::{Pal, Sys};
|
||||
|
||||
#[repr(C)]
|
||||
pub struct passwd {
|
||||
@@ -51,7 +48,7 @@ where
|
||||
F: FnMut(&[&[u8]]) -> bool,
|
||||
{
|
||||
let file = match RawFile::open(
|
||||
"/etc/passwd\0".as_ptr() as *const c_char,
|
||||
unsafe { CStr::from_bytes_with_nul_unchecked(b"/etc/passwd\0") },
|
||||
fcntl::O_RDONLY,
|
||||
0,
|
||||
) {
|
||||
@@ -90,7 +87,7 @@ where
|
||||
buf.set_len(capacity);
|
||||
}
|
||||
|
||||
let read = platform::read(*file, &mut buf[len..]);
|
||||
let read = Sys::read(*file, &mut buf[len..]);
|
||||
|
||||
unsafe {
|
||||
buf.set_len(len + read as usize);
|
||||
@@ -1,7 +1,3 @@
|
||||
#![no_std]
|
||||
|
||||
extern crate platform;
|
||||
|
||||
use platform::types::*;
|
||||
|
||||
#[repr(C)]
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user