From: brarcher Date: Mon, 23 Sep 2013 15:17:54 +0000 (+0000) Subject: Use clockid_t in prototype for clock_gettime X-Git-Tag: 0.10.0~428 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7daccb9b19c106c15adc909f6ebaa163341e037;p=check Use clockid_t in prototype for clock_gettime The clockid_t type will be needed in a future commit. In preparation, providing the type now in libcompat.h. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@786 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- diff --git a/lib/clock_gettime.c b/lib/clock_gettime.c index 9d26ce5..759fff6 100644 --- a/lib/clock_gettime.c +++ b/lib/clock_gettime.c @@ -15,7 +15,7 @@ -int clock_gettime(int clk_id CK_ATTRIBUTE_UNUSED, struct timespec *ts) +int clock_gettime(clockid_t clk_id CK_ATTRIBUTE_UNUSED, struct timespec *ts) { #ifdef __MACH__ diff --git a/lib/libcompat.h b/lib/libcompat.h index b65bdda..12b4a0f 100644 --- a/lib/libcompat.h +++ b/lib/libcompat.h @@ -144,6 +144,12 @@ struct itimerspec */ typedef int timer_t; +/* + * As the functions which use clockid_t are not defined on the system, + * the clockid_t type probably also is not defined. + */ +typedef int clockid_t; + /* * Do a simple forward declaration in case the struct is not defined. * In the versions of timer_create in libcompat, sigevent is never @@ -151,7 +157,7 @@ typedef int timer_t; */ struct sigevent; -int clock_gettime(int clk_id, struct timespec *ts); +int clock_gettime(clockid_t clk_id, struct timespec *ts); int timer_create(int clockid, struct sigevent *sevp, timer_t *timerid); int timer_settime(timer_t timerid, int flags, const struct itimerspec *new_value, struct itimerspec * old_value); int timer_delete(timer_t timerid);