It could be simply that it's more resource consuming to turn the pixel to black. It seems to me that in night mode Kobo is a bit more slow.
Anyway, what does exaclt this piece of code?
Code:
while(1)
{
int err = epoll_wait(epollFD, &readEvent, 1, -1);
if(err > 0)
{
int bytesRead = read(fd, &input, sizeof(input));
if(bytesRead == 0) //writing application left the pipe -> reopen
{
close(fd);
fd = open(ctlPipe, O_NONBLOCK);
readEvent.data.fd = fd;
epoll_ctl(epollFD, EPOLL_CTL_ADD, fd, &readEvent);
continue;
}