kdrive: add SIGIO input code

The keyboard input driver that will be added to kdrive
only works with old SIGIO code, and doesn't work with
the new threaded input that kdrive uses.

All the code is behind #if's that are never satisfied,
so this commit has no functional changes.

In preparation for adding the Xfbdev X11 kdrive server.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
stefan11111
2025-07-06 16:52:45 +03:00
committed by Enrico Weigelt
parent 18e544e399
commit c85ef2a6b5

View File

@@ -116,6 +116,45 @@ static void KdSigio(int sig)
for (int i = 0; i < kdNumInputFds; i++)
(*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure);
}
static void KdBlockSigio(void)
{
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGIO);
sigprocmask(SIG_BLOCK, &set, 0);
}
static void KdUnblockSigio(void)
{
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGIO);
sigprocmask(SIG_UNBLOCK, &set, 0);
}
#undef VERIFY_SIGIO
#ifdef VERIFY_SIGIO
void KdAssertSigioBlocked(char *where)
{
sigset_t set, old;
sigemptyset(&set);
sigprocmask(SIG_BLOCK, &set, &old);
if (!sigismember(&old, SIGIO))
ErrorF("SIGIO not blocked at %s\n", where);
}
#else
#define KdAssertSigioBlocked(s)
#endif
static int kdnFds;
#endif
#ifdef FNONBLOCK