summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schouten <ed@nuxi.nl>2017-12-27 18:55:48 +0100
committerEd Schouten <ed@nuxi.nl>2017-12-27 18:58:34 +0100
commit27a5a3b96710630fdbf7ca6b29214cb2753d6f93 (patch)
tree8be179eb1e3ca9d1e30d4050d9e212ea6560cc1c
parent2fa33ef8eb36f0ffe85b4f267e0eb4b73b6ffc56 (diff)
downloadrust-libc-27a5a3b96710630fdbf7ca6b29214cb2753d6f93.tar.gz
Fix style to appease CI.
-rw-r--r--src/cloudabi/mod.rs92
1 files changed, 55 insertions, 37 deletions
diff --git a/src/cloudabi/mod.rs b/src/cloudabi/mod.rs
index 6897e5c74b..1810e96fac 100644
--- a/src/cloudabi/mod.rs
+++ b/src/cloudabi/mod.rs
@@ -55,7 +55,36 @@ s! {
}
}
-extern "C" {
+pub const _SC_PAGESIZE: ::c_int = 54;
+
+pub const AF_INET: ::c_int = 1;
+pub const AF_INET6: ::c_int = 2;
+
+pub const EACCES: ::c_int = 2;
+pub const EADDRINUSE: ::c_int = 3;
+pub const EADDRNOTAVAIL: ::c_int = 4;
+pub const EAGAIN: ::c_int = 6;
+pub const ECONNABORTED: ::c_int = 13;
+pub const ECONNREFUSED: ::c_int = 14;
+pub const ECONNRESET: ::c_int = 15;
+pub const EEXIST: ::c_int = 20;
+pub const EINTR: ::c_int = 27;
+pub const EINVAL: ::c_int = 28;
+pub const ENOENT: ::c_int = 44;
+pub const ENOTCONN: ::c_int = 53;
+pub const EPERM: ::c_int = 63;
+pub const EPIPE: ::c_int = 64;
+pub const ETIMEDOUT: ::c_int = 73;
+pub const EWOULDBLOCK: ::c_int = EAGAIN;
+
+pub const EAI_SYSTEM: ::c_int = 9;
+
+pub const PTHREAD_STACK_MIN: ::size_t = 1024;
+
+pub const SOCK_DGRAM: ::c_int = 128;
+pub const SOCK_STREAM: ::c_int = 130;
+
+extern {
pub fn freeaddrinfo(res: *mut addrinfo);
pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
pub fn getaddrinfo(
@@ -71,58 +100,47 @@ extern "C" {
optval: *mut ::c_void,
optlen: *mut ::socklen_t,
) -> ::c_int;
- pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
+ pub fn posix_memalign(
+ memptr: *mut *mut ::c_void,
+ align: ::size_t,
+ size: ::size_t,
+ ) -> ::c_int;
pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
- pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int;
+ pub fn pthread_attr_setstacksize(
+ attr: *mut ::pthread_attr_t,
+ stack_size: ::size_t,
+ ) -> ::c_int;
pub fn pthread_create(
native: *mut ::pthread_t,
attr: *const ::pthread_attr_t,
- f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
+ f: extern fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void,
) -> ::c_int;
pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void;
- pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int;
+ pub fn pthread_join(
+ native: ::pthread_t,
+ value: *mut *mut ::c_void,
+ ) -> ::c_int;
pub fn pthread_key_create(
key: *mut pthread_key_t,
- dtor: Option<unsafe extern "C" fn(*mut ::c_void)>,
+ dtor: Option<unsafe extern fn(*mut ::c_void)>,
) -> ::c_int;
pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int;
- pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int;
- pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
+ pub fn pthread_setspecific(
+ key: pthread_key_t,
+ value: *const ::c_void,
+ ) -> ::c_int;
+ pub fn send(
+ socket: ::c_int,
+ buf: *const ::c_void,
+ len: ::size_t,
+ flags: ::c_int,
+ ) -> ::ssize_t;
pub fn sysconf(name: ::c_int) -> ::c_long;
}
-pub const _SC_PAGESIZE: ::c_int = 54;
-
-pub const AF_INET: ::c_int = 1;
-pub const AF_INET6: ::c_int = 2;
-
-pub const EACCES: ::c_int = 2;
-pub const EADDRINUSE: ::c_int = 3;
-pub const EADDRNOTAVAIL: ::c_int = 4;
-pub const EAGAIN: ::c_int = 6;
-pub const ECONNABORTED: ::c_int = 13;
-pub const ECONNREFUSED: ::c_int = 14;
-pub const ECONNRESET: ::c_int = 15;
-pub const EEXIST: ::c_int = 20;
-pub const EINTR: ::c_int = 27;
-pub const EINVAL: ::c_int = 28;
-pub const ENOENT: ::c_int = 44;
-pub const ENOTCONN: ::c_int = 53;
-pub const EPERM: ::c_int = 63;
-pub const EPIPE: ::c_int = 64;
-pub const ETIMEDOUT: ::c_int = 73;
-pub const EWOULDBLOCK: ::c_int = EAGAIN;
-
-pub const EAI_SYSTEM: ::c_int = 9;
-
-pub const PTHREAD_STACK_MIN: ::size_t = 1024;
-
-pub const SOCK_DGRAM: ::c_int = 128;
-pub const SOCK_STREAM: ::c_int = 130;
-
cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;