From 9ef3a9f8b2704693496af12120ea3ab40389bf7b Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 24 Oct 2016 02:15:36 +0000 Subject: Add the alarm library, first draft. --- src/sysdeps/tryitimer.c | 10 ++++++++++ src/sysdeps/trytimer.c | 12 ++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/sysdeps/tryitimer.c create mode 100644 src/sysdeps/trytimer.c (limited to 'src/sysdeps') diff --git a/src/sysdeps/tryitimer.c b/src/sysdeps/tryitimer.c new file mode 100644 index 0000000..4fd3454 --- /dev/null +++ b/src/sysdeps/tryitimer.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include + +int main (void) +{ + struct itimerval blah ; + if (getitimer(ITIMER_REAL, &blah) < 0) return 111 ; + return 0 ; +} diff --git a/src/sysdeps/trytimer.c b/src/sysdeps/trytimer.c new file mode 100644 index 0000000..84cea0d --- /dev/null +++ b/src/sysdeps/trytimer.c @@ -0,0 +1,12 @@ +/* ISC license. */ + +#include +#include +#include + +int main (void) +{ + timer_t blah ; + if (timer_create(CLOCK_REALTIME, 0, &blah) < 0) return 111 ; + return 0 ; +} -- cgit v1.2.3