]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
linux: Add memfd_create(2)
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 23 Oct 2019 20:50:22 +0000 (22:50 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 7 Nov 2019 11:11:48 +0000 (12:11 +0100)
vapi/linux.vapi

index 29838e876dd87f598dfbee538cd0833406d43bd8..344f6246379ce1fbb11d76db25bb1491e2eaf60c 100644 (file)
@@ -1280,6 +1280,17 @@ namespace Linux {
     [CCode (cheader_filename = "sys/mman.h")]
     public void *mremap (void *old_address, size_t old_size, size_t new_size, MremapFlags flags);
 
+    // memfd_create(2)
+    [CCode (cname = "unsigned int", cheader_filename = "linux/memfd.h", cprefix = "MFD_", has_type_id = false)]
+    public enum MemfdFlags {
+        CLOEXEC,
+        ALLOW_SEALING,
+        HUGETLB
+    }
+
+    [CCode (cheader_filename = "sys/mman.h", feature_test_macro = "_GNU_SOURCE")]
+    public int memfd_create (string name, MemfdFlags flags);
+
     /*
      * Network
      */