summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-07-17 14:25:31 +0200
committerwm4 <wm4@nowhere>2020-07-20 21:02:17 +0200
commitd5959df2be17f6ccc47abb6f5b440e3bbcef246a (patch)
tree9c7c02d8f8cd27ca8ca5add57ea172136ee79f0b
parent0a796e98405c2252b58e6ac06b4d395aded568a9 (diff)
downloadmpv-d5959df2be17f6ccc47abb6f5b440e3bbcef246a.tar.bz2
mpv-d5959df2be17f6ccc47abb6f5b440e3bbcef246a.tar.xz
client API: comment about signal handlers
Sharing a process sure is hard in POSIX. The rationale is that you'd have to handle EINTR on every single blocking syscall. stream_file.c does not seem to handle it on read() calls. It appears that on most modern systems, this can happen only if you call sigaction(), and incompetently forget to add SA_RESTART. signal() usually adds it.
-rw-r--r--libmpv/client.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libmpv/client.h b/libmpv/client.h
index 339cee138b..a7c2d6694e 100644
--- a/libmpv/client.h
+++ b/libmpv/client.h
@@ -147,6 +147,8 @@ extern "C" {
* - mpv may start sub processes, so overriding SIGCHLD, or waiting on all PIDs
* (such as calling wait()) by the parent process or any other library within
* the process must be avoided. libmpv itself only waits for its own PIDs.
+ * - If anything in the process registers signal handlers, they must set the
+ * SA_RESTART flag. Otherwise you WILL get random failures on signals.
*
* Encoding of filenames
* ---------------------