aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/index.html15
-rw-r--r--doc/libstddjb/djbunix.html62
-rw-r--r--doc/license.html2
-rw-r--r--doc/upgrade.html6
4 files changed, 47 insertions, 38 deletions
diff --git a/doc/index.html b/doc/index.html
index 4980b35..1da38d9 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -61,8 +61,8 @@ with a standard C development environment </li>
<h3> Download </h3>
<ul>
- <li> The current released version of skalibs is <a href="skalibs-2.15.2.0.tar.gz">2.15.2.0</a>.
-You can access its checksum <a href="skalibs-2.15.2.0.tar.gz.sha256">here</a>. </li>
+ <li> The current released version of skalibs is <a href="skalibs-2.16.0.0.tar.gz">2.16.0.0</a>.
+You can access its checksum <a href="skalibs-2.16.0.0.tar.gz.sha256">here</a>. </li>
<li> Alternatively, you can checkout a copy of the
<a href="//git.skarnet.org/cgit/skalibs/">skalibs
git repository</a>:
@@ -138,5 +138,16 @@ includes libraries for Scheme programming </li>
<a href="//skarnet.org/lists/#skaware">skaware</a> mailing-list. </li>
</ul>
+<h2> Support this work </h2>
+
+<p>
+ If you like this skarnet.org project, you can donate to the author via Liberapay,
+by clicking the following button:
+<script src="https://liberapay.com/skarnet/widgets/button.js"></script>
+<noscript>
+<a href="https://liberapay.com/skarnet/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>
+</noscript>
+</p>
+
</body>
</html>
diff --git a/doc/libstddjb/djbunix.html b/doc/libstddjb/djbunix.html
index ba9e692..0850dd6 100644
--- a/doc/libstddjb/djbunix.html
+++ b/doc/libstddjb/djbunix.html
@@ -364,6 +364,8 @@ The <tt>child_spawn</tt> family of functions has been moved to the
<h3> Waiting for children </h3>
+<h4> Including bastards (children a process doesn't know it has) </h4>
+
<p>
<code> unsigned int wait_reap () </code> <br />
Instantly reaps all the pending zombies, without blocking, without a look at
@@ -372,36 +374,6 @@ Returns the number of reaped zombies.
</p>
<p>
-<code> int waitn (pid_t *pids, unsigned int n) </code> <br />
-Waits until all processes whose PIDs are stored in the
-<em>pids</em> array, of size <em>n</em>, have died.
-Returns 1 if it succeeds, and 0 (and sets errno) if it fails. The
-<em>pid</em> array is not guaranteed to be unchanged.
-</p>
-
-<p>
-<code> int waitn_posix (pid_t *pids, unsigned int n, int *wstat) </code> <br />
-Like <tt>waitn</tt>, but stores into <em>*wstat</em> the status
-of the last process in the <em>pids</em> array (i.e. <tt>pids[n-1]</tt>).
-</p>
-
-<p>
-<code> int waitn_reap (pid_t *pids, unsigned int n) </code> <br />
-Instantly reaps all zombies whose PIDs are stored in the
-<em>pids</em> array, of size <em>n</em>.
-Returns -1 (and sets errno) if it fails, and the number of reaped
-zombies if it succeeds. The <em>pid</em> array is not guaranteed to
-be unchanged.
-</p>
-
-<p>
-<code> int waitn_reap_posix (pid_t *pids, unsigned int n, int *wstat) </code> <br />
-Like <tt>waitn_reap</tt>, but stores into <em>*wstat</em> the status
-of the last process in the <em>pids</em> array (i.e. <tt>pids[n-1]</tt>),
-if applicable; otherwise <em>*wstat</em> is unchanged.
-</p>
-
-<p>
<code> pid_t wait_nohang (int *wstat) </code> <br />
Instantly reaps one zombie, and stores the status information into
*<em>wstat</em>.
@@ -448,15 +420,39 @@ function over the basic Unix APIs. This allows a program to:
</p>
<ul>
- <li> Automatically and silently take care of children it does not know
-it has. This situation can happen when a process forks and the parent
+ <li> Automatically and silently take care of bastards (children it does not know
+it has). This situation can happen when a process forks and the parent
execs. When the child dies, the new parent process has to drag the
-"zombie bastard" along, which is ugly; <tt>wait_pids_nohang()</tt>
+zombie bastard along, which is ugly; <tt>wait_pids_nohang()</tt>
prevents this. </li>
<li> Still take appropriate care of its legitimate children, in
any order. </li>
</ul>
+<h4> Excluding bastards </h4>
+
+<p>
+<code> size_t waitpids (pid_t const *pids, size_t n, int *wstat) </code> <br />
+Blockingly waits until it has reapt all the pids in array <em>pids</em> of
+size <em>n</em>, or an error occurs; does not reap any zombie that is not
+listed in <em>pids</em>. On success, it returns <em>n</em>.
+On error, it returns an integer <em>i</em> lesser than <em>n</em>, which
+is the position of the error in array <em>pids</em>, and sets errno.
+All the pids before
+<tt><em>pids</em>[<em>i</em>]</tt> have been properly reapt, and *<em>wstat</em>
+contains the status for the last reapt process, <tt><em>pids</em>[<em>i</em>-1]</tt>.
+</p>
+
+<p>
+<code> int waitpids_nohang (pid_t const *pids, size_t n, int *wstat, size_t *i) </code> <br />
+Instantly reaps one zombie among the pids listed in array <em>pids</em> of
+size <em>n</em>. If an error occurs, returns -1, sets errno, and writes the
+index (in the <em>pids</em> array) of the incriminated process in *<em>i</em>.
+If it finds a zombie, it writes the index of the found and reapt process
+in *<em>i</em> and returns 1. If no zombie is found in the list, it
+returns 0. Any zombie not listed remains untouched.
+</p>
+
<h3> Reading and writing whole files </h3>
<p>
diff --git a/doc/license.html b/doc/license.html
index e92da26..62cee6f 100644
--- a/doc/license.html
+++ b/doc/license.html
@@ -75,7 +75,7 @@ color, or different text font. </li>
<p>
<em>I am aware that the previous restrictions sound completely
ridiculous while the official skalibs documentation is incomplete.
-As of 2.15.2.0, I'm not going to enforce those restrictions, but if you're
+As of 2.16.0.0, I'm not going to enforce those restrictions, but if you're
going to provide documentation for skalibs, don't keep it to yourself,
please send it to me instead. :-) </em>
</p>
diff --git a/doc/upgrade.html b/doc/upgrade.html
index 74e9776..3a429da 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -17,10 +17,12 @@
<a href="//skarnet.org/">skarnet.org</a>
</p>
-<h2> in 2.15.2.0 </h2>
+<h2> in 2.16.0.0 </h2>
<ul>
- <li> New functions: pthread_create_flat, waitpid_nohang, waitpids_nohang </li>
+ <li> New functions: pthread_create_flat, waitpid_nohang, waitpids_nohang, openslurpnclose_at </li>
+ <li> <tt>openslurpclose_at()</tt> is now a macro. </li>
+ <li> The waitn* functions have been removed. </li>
</ul>
<h2> in 2.15.1.0 </h2>