]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gnu: add binding for flock(2) and its constants
authorReuben Thomas <rrt@sc3d.org>
Sat, 6 Apr 2024 13:01:27 +0000 (15:01 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 19 Apr 2024 10:23:43 +0000 (12:23 +0200)
vapi/gnu.vapi

index 5da463e36ce5e70ec1778851bb5992fc847024ae..beaa228cf51bc0034e0df2c4c384a9a4af01bd27 100644 (file)
@@ -1,6 +1,6 @@
 /* gnu.vapi
  *
- * Copyright (C) 2020 Reuben Thomas
+ * Copyright (C) 2020, 2024 Reuben Thomas
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -56,6 +56,18 @@ namespace Gnu {
        [PrintfFormat]
        public void error (int status, int errnum, string format, ...);
 
+       /**
+        * Provides the values for the 'operation' argument of 'flock'.
+        */
+       [CCode (cname = "int", cprefix = "LOCK_", cheader_filename = "sys/file.h", has_type_id = false)]
+       public enum FlockOperation {
+               SH,
+               EX,
+               UN
+       }
+       [CCode (cheader_filename = "sys/file.h")]
+       public int flock (int fd, FlockOperation operation);
+
        [CCode (cheader_filename = "quote.h")]
        public string quote (string arg);
 }