From 73643694b319fee932d3b5af965d28057a9c723e Mon Sep 17 00:00:00 2001
From: Tobias Klauser <tklauser@distanz.ch>
Date: Tue, 28 May 2019 10:02:51 +0200
Subject: [PATCH] Add F_SEAL_FUTURE_WRITE on Linux/Android

This was added in Linux 5.1 and will only show up in the next glibc
release, thus skip in tests.
---
 libc-test/build.rs           | 2 ++
 src/unix/notbsd/linux/mod.rs | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/libc-test/build.rs b/libc-test/build.rs
index bf6529d6..442b9817 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2266,6 +2266,8 @@ fn test_linux(target: &str) {
             // Require Linux kernel 5.x:
             | "MSG_COPY"
                if musl  => true,
+            // Require Linux kernel 5.1:
+            "F_SEAL_FUTURE_WRITE" => true,
 
             // The musl version 1.0.22 used in CI does not
             // contain these glibc constants yet:
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index f9f7a106..90909f21 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -1050,6 +1050,8 @@ pub const F_TEST: ::c_int = 3;
 pub const F_TLOCK: ::c_int = 2;
 pub const F_ULOCK: ::c_int = 0;
 
+pub const F_SEAL_FUTURE_WRITE: ::c_int = 0x0010;
+
 pub const IFF_LOWER_UP: ::c_int = 0x10000;
 pub const IFF_DORMANT: ::c_int = 0x20000;
 pub const IFF_ECHO: ::c_int = 0x40000;
-- 
GitLab