From d5959df2be17f6ccc47abb6f5b440e3bbcef246a Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 17 Jul 2020 14:25:31 +0200 Subject: 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. --- libmpv/client.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libmpv') 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 * --------------------- -- cgit v1.2.3