From 8adfff8b2419a0f79e85ba6884e507e787a313da Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Mon, 24 Oct 2011 01:30:23 +0100 Subject: Timer working. MAC address in string variable. --- select.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 select.c (limited to 'select.c') diff --git a/select.c b/select.c new file mode 100644 index 0000000..47351f9 --- /dev/null +++ b/select.c @@ -0,0 +1,25 @@ +#include +#include +#include + +volatile unsigned int variable = 0; + +int main() +{ + struct timeval tv; + int val; + + for (;;) + { + tv.tv_sec = 1; + tv.tv_usec = 0; + + do + { + val = select(0, NULL, NULL, NULL, &tv); + } while (val != 0 && errno == EINTR); + + printf("Variable = %u\n", ++variable); + } +} + -- cgit v1.2.3