News for hackers. Stuff that matters.
Re:Unix System Call Timeouts by sigil on Monday March 13, 2017 @03:20AM (#13855836)
Shouldn't this work?

- In the parent, open a pipe. Fork.

- Parent closes the write side. Child closes the read side, clears FD_CLOEXEC on it, and execs.

- Parent does a select(2) on the pipe's read side with the desired timeout. If the child exits before the timeout, the pipe becomes "EOF readable." Either way select(2) returns on or before the timeout.

I get that this trick won't work for imposing timeouts on other syscalls (the author points to mkdir(2)) but isn't that the purvey of an RTOS?

Re:Unix System Call Timeouts by AstralStorm on Monday March 13, 2017 @03:37AM (#13855897)
Poll and epoll also work.

RTOS should prefer asynchronous calls and lockfree queues instead.

Re:Unix System Call Timeouts by microcolonel on Monday March 13, 2017 @11:13AM (#13858448)
That sounds like a nightmare. I doubt many mortals could do hard realtime on a fully-asynchronous RTOS.