aboutsummaryrefslogtreecommitdiff
path: root/ctru-sys/src
diff options
context:
space:
mode:
authorFenrir <[email protected]>2016-10-06 02:00:22 -0700
committerFenrir <[email protected]>2016-10-06 02:10:10 -0700
commitb1779396be7d072e89a3f3a8c95561ac92d3d133 (patch)
treed6fa7281d2ae9108e2d3edb4b102ea1104a49ed3 /ctru-sys/src
parentAdd memchr (diff)
downloadarchived-ctru-rs-b1779396be7d072e89a3f3a8c95561ac92d3d133.tar.xz
archived-ctru-rs-b1779396be7d072e89a3f3a8c95561ac92d3d133.zip
Add io module from libstd
Also includes CString and CStr modules
Diffstat (limited to 'ctru-sys/src')
-rw-r--r--ctru-sys/src/sys/libc.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/ctru-sys/src/sys/libc.rs b/ctru-sys/src/sys/libc.rs
index cbc7958..3d647fe 100644
--- a/ctru-sys/src/sys/libc.rs
+++ b/ctru-sys/src/sys/libc.rs
@@ -1,5 +1,24 @@
pub const STDOUT_FILENO: c_int = 1;
+pub const EPERM: c_int = 1;
+pub const ENOENT: c_int = 2;
+pub const EINTR: c_int = 4;
+pub const EAGAIN: c_int = 11;
+pub const EACCES: c_int = 13;
+pub const EEXIST: c_int = 17;
+pub const EINVAL: c_int = 22;
+pub const EPIPE: c_int = 32;
+pub const EWOULDBLOCK: c_int = EAGAIN;
+
+pub const EADDRINUSE: c_int = 98;
+pub const EADDRNOTAVAIL: c_int = 99;
+pub const ECONNABORTED: c_int = 103;
+pub const ECONNRESET: c_int = 104;
+pub const ENOTCONN: c_int = 107;
+pub const ETIMEDOUT: c_int = 110;
+pub const ECONNREFUSED: c_int = 111;
+pub const EHOSTDOWN: c_int = 112;
+
#[repr(u8)]
pub enum c_void {
__variant1,
@@ -25,5 +44,6 @@ extern "C" {
pub fn __errno() -> *const c_int;
pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
+ pub fn strlen(cs: *const c_char) -> size_t;
pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t;
}