diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-06-14 04:09:00 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-06-14 04:09:00 +0000 |
commit | 0445f2a3590f67441602a05fe3924ab677c79ff0 (patch) | |
tree | 1a011697fbd92ca53468efe019c8c93c364ad6a8 /doc/libs6/ftrigr.html | |
parent | f287ac765101f21b530f1a9886e06976c165c922 (diff) | |
download | s6-0445f2a3590f67441602a05fe3924ab677c79ff0.tar.gz s6-0445f2a3590f67441602a05fe3924ab677c79ff0.tar.xz s6-0445f2a3590f67441602a05fe3924ab677c79ff0.zip |
Add ftrigr_checksa(), rewrite s6_svlisten_loop() around it
- Fixes the race condition hit by permanent failure, i.e. two ftrig events close to each other - Requires storing the sequence of events client-side, so an additional stralloc, bleh - The visible struct ftrigr_s changes, so a major bump is needed -> prepare for 2.6.0.0 - ftrigr_check() is now a trivial wrapper around ftrigr_checksa()
Diffstat (limited to 'doc/libs6/ftrigr.html')
-rw-r--r-- | doc/libs6/ftrigr.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/libs6/ftrigr.html b/doc/libs6/ftrigr.html index 3a32c7e..cc9e37a 100644 --- a/doc/libs6/ftrigr.html +++ b/doc/libs6/ftrigr.html @@ -266,5 +266,26 @@ times that an event happened to this identifier since the last call to <tt>ftrigr_check()</tt>. </li> </ul> +<pre> +int ftrigr_checksa (ftrigr_t *a, uint16_t id, stralloc *what) +</pre> + +<p> + Checks whether an event happened to <em>id</em>. Use after a +call to <tt>ftrigr_update()</tt>, as an alternative to <tt>ftrigr_check()</tt>. +</p> + +<ul> + <li> If an error occurred, returns -1 and sets errno. The error +number may have been transmitted from +<a href="s6-ftrigrd.html">s6-ftrigrd</a>. </li> + <li> If no notification happened yet, returns 0. </li> + <li> If something happened, appends one character to the end of the <em>what</em> +<a href="//skarnet.org/software/skalibs/libstddjb/stralloc.html">stralloc</a> +for every time a notification was triggered since the last call +to <tt>ftrigr_check()</tt>. Each character is the one that triggered +a notification. The function then returns 1. </li> +</ul> + </body> </html> |