]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
posix, linux: Add bindings for clockid_t and clock_gettime
authorVito Piserchia <johndoe@metatype.it>
Mon, 1 Aug 2011 11:55:59 +0000 (13:55 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Mon, 1 Aug 2011 11:56:34 +0000 (13:56 +0200)
Fixes bug 652739.

vapi/linux.vapi
vapi/posix.vapi

index 37bcb0d565f78217ff68cf391aeb70f88b735b39..627724db05c21003e47d3c1160c75ff9b1fa6426 100644 (file)
@@ -1200,6 +1200,9 @@ namespace Linux {
     [CCode (cheader_filename = "time.h")]
     public time_t timegm (GLib.Time t);
 
+    [CCode (cheader_filename = "time.h")]
+    public const clockid_t CLOCK_MONOTONIC_RAW;
+
     [CCode (cheader_filename = "utmp.h")]
     public int login_tty (int fd);
 
index 9737101f8fe88e91c777964687ad69ff56f0bcf1..0e89ca36274e4e31c40c4f3b586d5f7dc2399af5 100644 (file)
@@ -1705,6 +1705,28 @@ namespace Posix {
                public long tv_nsec;
        }
 
+       [SimpleType]
+       [IntegerType]
+       [CCode (cheader_filename = "time.h")]
+       public struct clockid_t {
+       }
+
+       [CCode (cheader_filename = "time.h")]
+       public const clockid_t CLOCK_REALTIME;
+       [CCode (cheader_filename = "time.h")]
+       public const clockid_t CLOCK_MONOTONIC;
+       [CCode (cheader_filename = "time.h")]
+       public const clockid_t CLOCK_PROCESS_CPUTIME_ID;
+       [CCode (cheader_filename = "time.h")]
+       public const clockid_t CLOCK_THREAD_CPUTIME_ID;
+       [CCode (cheader_filename = "time.h")]
+       public const clockid_t CLOCK_REALTIME_COARSE;
+       [CCode (cheader_filename = "time.h")]
+       public const clockid_t CLOCK_MONOTONIC_COARSE;
+
+       [CCode (cheader_filename = "time.h")]
+       int clock_gettime (clockid_t clk_id, out timespec tp);
+
        [CCode (cheader_filename = "sys/time.h,sys/resource.h")]
        public int getpriority (int which, int who);
        [CCode (cheader_filename = "sys/time.h,sys/resource.h")]