aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix/newlib
diff options
context:
space:
mode:
Diffstat (limited to 'libc/src/unix/newlib')
-rw-r--r--libc/src/unix/newlib/aarch64/mod.rs5
-rw-r--r--libc/src/unix/newlib/mod.rs32
2 files changed, 37 insertions, 0 deletions
diff --git a/libc/src/unix/newlib/aarch64/mod.rs b/libc/src/unix/newlib/aarch64/mod.rs
new file mode 100644
index 0000000..96f381a
--- /dev/null
+++ b/libc/src/unix/newlib/aarch64/mod.rs
@@ -0,0 +1,5 @@
+pub type c_char = u8;
+pub type wchar_t = u32;
+
+pub type c_long = i64;
+pub type c_ulong = u64;
diff --git a/libc/src/unix/newlib/mod.rs b/libc/src/unix/newlib/mod.rs
index aec3bca..6cf8633 100644
--- a/libc/src/unix/newlib/mod.rs
+++ b/libc/src/unix/newlib/mod.rs
@@ -435,6 +435,15 @@ pub const O_NONBLOCK: ::c_int = 16384;
pub const O_ACCMODE: ::c_int = 3;
pub const O_CLOEXEC: ::c_int = 0x80000;
+pub const POLLIN: ::c_short = 0x1;
+pub const POLLPRI: ::c_short = 0x2;
+pub const POLLOUT: ::c_short = 0x4;
+pub const POLLERR: ::c_short = 0x8;
+pub const POLLHUP: ::c_short = 0x10;
+pub const POLLNVAL: ::c_short = 0x20;
+
+pub const RTLD_LAZY: ::c_int = 0x1;
+
pub const STDIN_FILENO: ::c_int = 0;
pub const STDOUT_FILENO: ::c_int = 1;
pub const STDERR_FILENO: ::c_int = 2;
@@ -508,6 +517,26 @@ pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;
pub const INET_ADDRSTRLEN: ::c_int = 16;
+// https://github.
+// com/bminor/newlib/blob/master/newlib/libc/sys/linux/include/net/if.h#L121
+pub const IFF_UP: ::c_int = 0x1; // interface is up
+pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
+pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
+pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
+pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
+pub const IFF_NOTRAILERS: ::c_int = 0x20; // avoid use of trailers
+pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
+pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
+pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
+pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
+pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
+pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
+pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
+pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
+pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
+pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
+pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
+
pub const IPPROTO_IP: ::c_int = 0;
pub const IPPROTO_UDP: ::c_int = 17;
pub const IPPROTO_TCP: ::c_int = 6;
@@ -650,6 +679,9 @@ cfg_if! {
if #[cfg(target_arch = "arm")] {
mod arm;
pub use self::arm::*;
+ } else if #[cfg(target_arch = "aarch64")] {
+ mod aarch64;
+ pub use self::aarch64::*;
} else {
// Only tested on ARM so far. Other platforms might have different
// definitions for types and constants.