[vala] posix, linux: Add bindings for clockid_t and clock_gettime



commit 1222ec533e2b6117141d2cb078228a5e56d84b9d
Author: Vito Piserchia <johndoe metatype it>
Date:   Mon Aug 1 13:55:59 2011 +0200

    posix, linux: Add bindings for clockid_t and clock_gettime
    
    Fixes bug 652739.

 vapi/linux.vapi |    3 +++
 vapi/posix.vapi |   22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/vapi/linux.vapi b/vapi/linux.vapi
index 37bcb0d..627724d 100644
--- a/vapi/linux.vapi
+++ b/vapi/linux.vapi
@@ -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);
 
diff --git a/vapi/posix.vapi b/vapi/posix.vapi
index 9737101..0e89ca3 100644
--- a/vapi/posix.vapi
+++ b/vapi/posix.vapi
@@ -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")]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]