Reimplemented WatchDog to use direct function calls intead of system calls.