]> git.proxmox.com Git - cargo.git/blobdiff - vendor/libc/src/unix/linux_like/android/b32/arm.rs
New upstream version 0.52.0
[cargo.git] / vendor / libc / src / unix / linux_like / android / b32 / arm.rs
index aa9beb765288c1db78a15eaa811c3dd3dbeb0ffb..8a53e5399413478272076211d824a7b320e57185 100644 (file)
@@ -521,3 +521,19 @@ pub const REG_R14: ::c_int = 14;
 pub const REG_R15: ::c_int = 15;
 
 pub const NGREG: ::c_int = 18;
+
+f! {
+    // Sadly, Android before 5.0 (API level 21), the accept4 syscall is not
+    // exposed by the libc. As work-around, we implement it through `syscall`
+    // directly. This workaround can be removed if the minimum version of
+    // Android is bumped. When the workaround is removed, `accept4` can be
+    // moved back to `linux_like/mod.rs`
+    pub fn accept4(
+        fd: ::c_int,
+        addr: *mut ::sockaddr,
+        len: *mut ::socklen_t,
+        flg: ::c_int
+    ) -> ::c_int {
+        ::syscall(SYS_accept4, fd, addr, len, flg) as ::c_int
+    }
+}