aboutsummaryrefslogtreecommitdiff
path: root/src/pth.h
diff options
context:
space:
mode:
authorDavid Timber <mieabby@gmail.com>2020-09-08 19:46:44 +0930
committerDavid Timber <mieabby@gmail.com>2020-09-08 20:10:57 +0930
commit0e512e6ae3146fcf3ce2427c8c36937d708d149b (patch)
tree40a6ad8c64b419e2f8d0bcc289e9608852ff76ae /src/pth.h
parent550d2eec27a42254b26139208765022fffe7c775 (diff)
* Fix bug in pth_poll: wrong use of FD_SET()
causing undefined behaviour * Fix bug in proone: loading ns pool from dvault for resolv * Fix bug in htbt: improper handling of stream in htbt_relay_child() * Switch back to _POSIX_C_SOURCE=200112L
Diffstat (limited to 'src/pth.h')
-rw-r--r--src/pth.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pth.h b/src/pth.h
index 3b0d708..0ede191 100644
--- a/src/pth.h
+++ b/src/pth.h
@@ -25,5 +25,16 @@ void prne_init_worker (prne_worker_t *w);
void prne_free_worker (prne_worker_t *w);
void prne_fin_worker (prne_worker_t *w);
+/* Workaround for bug in GNU Pth
+* Calling pth_poll() with pollfd element whose fd is negative value results in
+* undefined behaviour as stated in POSIX(FD_SET() with invalid value is
+* undefined). GNU Pth uses FD_SET() with invalid values on purpose to achieve
+* something.
+*/
+int prne_pth_poll (
+ struct pollfd *pfd,
+ const nfds_t nfs,
+ const int timeout,
+ pth_event_t ev);
void prne_pth_cv_notify (pth_mutex_t *lock, pth_cond_t *cond, bool broadcast);
pth_time_t prne_pth_tstimeout (const struct timespec ts);