aboutsummaryrefslogtreecommitdiffstats
path: root/select.c
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2011-10-24 01:30:23 +0100
committerJonathan McCrohan <jmccrohan@gmail.com>2011-10-24 01:30:23 +0100
commit8adfff8b2419a0f79e85ba6884e507e787a313da (patch)
tree3e360dd9b0c2d238520b16718218045df4872bf6 /select.c
parent2643a5dc67dc6945ce8e0a3962818b16a240f0b5 (diff)
downloadverteco-8adfff8b2419a0f79e85ba6884e507e787a313da.tar.gz
Timer working. MAC address in string variable.
Diffstat (limited to 'select.c')
-rw-r--r--select.c25
1 files changed, 25 insertions, 0 deletions
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 <errno.h>
+#include <stdio.h>
+#include <sys/select.h>
+
+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);
+ }
+}
+