aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2019-05-27 21:44:10 +0200
committerBjørn Mork <bjorn@mork.no>2019-05-27 21:44:10 +0200
commitb8853b4a5f3d360bab6be693b568d29d4fceb2b2 (patch)
tree4eb7d37b8160a22c5787547b1e9b2c58b7185639
parenta6ad199ab435be37c6e04b70e593bc23b110823d (diff)
move testing notes and code around
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r--random-notes.md (renamed from doc/README.md)0
-rw-r--r--tryme.c39
2 files changed, 0 insertions, 39 deletions
diff --git a/doc/README.md b/random-notes.md
index ad44bce..ad44bce 100644
--- a/doc/README.md
+++ b/random-notes.md
diff --git a/tryme.c b/tryme.c
deleted file mode 100644
index 97d29df..0000000
--- a/tryme.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <poll.h>
-
-#define TIMEOUT -1
-
-int main (void)
-{
- unsigned char buf[16];
- struct pollfd fds[1];
- int ret, rlen;
-
- /* watch stdin for input */
- fds[0].fd = STDIN_FILENO;
- fds[0].events = POLLIN;
-
- while (1) {
- ret = poll(fds, 1, TIMEOUT * 1000);
- if (ret == -1) {
- perror ("poll");
- return 1;
- }
- if (!ret) {
- fprintf(stderr, "%d seconds elapsed.\n", TIMEOUT);
- return 0;
- }
-
- if (fds[0].revents & POLLIN)
- fprintf(stderr, "stdin is readable\n");
-
- rlen = read(fds[0].fd, buf, sizeof(buf));
- if (!rlen)
- break;
- fprintf(stderr, "read %d bytes\n", rlen);
- }
- fprintf(stderr, "eof\n");
- return 0;
-
-}