aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-07-28 15:50:26 +0200
committerdec05eba <dec05eba@protonmail.com>2021-07-28 15:50:26 +0200
commit60f22a9cba69a8443ed1442c5294a0102ed6f1a3 (patch)
treee78736a46c878002ce266042731b085c9987435d /src/Utils.cpp
parentb8e40694b539e74f1778b380087764bb76213fc5 (diff)
4chan: add timeout for posting without pass, handle noop captcha challenge
Diffstat (limited to 'src/Utils.cpp')
-rw-r--r--src/Utils.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp
index c73932b..3032f22 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -126,4 +126,13 @@ namespace QuickMedia {
strftime(time_str, sizeof(time_str) - 1, "%Y %b %d, %a %H:%M", &time_tm);
return time_str;
}
+
+ int64_t get_unix_time_monotonic() {
+ struct timespec t;
+ if(clock_gettime(CLOCK_MONOTONIC, &t) == -1) {
+ fprintf(stderr, "This kernel version doesn't support CLOCK_MONOTONIC\n");
+ abort();
+ }
+ return t.tv_sec;
+ }
} \ No newline at end of file