diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2015-01-03 13:58:15 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2015-01-03 13:58:15 +0100 |
commit | 4aca87515a5083ae0e31ce3177189fd43b6d05ac (patch) | |
tree | 7b1d9a31393ca090757dc6f0d3859b4fcd93f271 /release/src/router/busybox/tests/tst-syslogd.c | |
parent | 008d0be72b2f160382c6e880765e96b64a050c65 (diff) | |
download | tomato-4aca87515a5083ae0e31ce3177189fd43b6d05ac.tar.gz tomato-4aca87515a5083ae0e31ce3177189fd43b6d05ac.tar.bz2 |
patch to Vanilla Tomato 1.28
Diffstat (limited to 'release/src/router/busybox/tests/tst-syslogd.c')
-rw-r--r-- | release/src/router/busybox/tests/tst-syslogd.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/release/src/router/busybox/tests/tst-syslogd.c b/release/src/router/busybox/tests/tst-syslogd.c deleted file mode 100644 index bae10afd..00000000 --- a/release/src/router/busybox/tests/tst-syslogd.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * tst-syslogd.c - tests concurrent threads calling syslog - * - * build with: gcc -Wall tst-syslogd.c -lpthread - */ - -#include <stdio.h> -#include <pthread.h> -#include <syslog.h> -#include <unistd.h> - -void *log_func(void *arg) -{ - int i; - int thrid = (int)arg; - - openlog(NULL, LOG_PERROR | LOG_PID, LOG_USER); - for (i = 0; i < 10; i++) { - syslog(LOG_DEBUG, "thread %i iter %i\n", thrid, i); - sleep(thrid); /* this mixes things up a bit */ - } - closelog(); - - return NULL; -} - -int main(int argc, char **argv) -{ - pthread_t thr1, thr2, thr3; - int id1 = 1; - int id2 = 2; - int id3 = 3; - - pthread_create(&thr1, NULL, log_func, (void *)id1); - pthread_create(&thr2, NULL, log_func, (void *)id2); - pthread_create(&thr3, NULL, log_func, (void *)id3); - - pthread_join(thr1, NULL); - pthread_join(thr2, NULL); - pthread_join(thr3, NULL); - - return 0; -} - |