My intention is to create a tfgets function. tfgets is similar to fget except that it has a time out of 1 sec. If no input is received in 1 sec, then the program returns NULL. Otherwise, it returns whatever fgets returns.
How can I create a good design for tfgets?
NOTE: for those of you who will ask "what did you try?". Here is my first attempt using kill. But it apparently brings some strange system instability in ubuntu 14.04. Why can't the signal handler in the child process be triggered?