Q18. How To Create A Child Process In Linux?
Prototype of the function used to create a child process is pid_t fork(void); •Fork is the system call that is used to create a child process. It takes no arguments and returns a value of type pid_t. •If the function succeeds it returns the pid of the child process created to its parent and child receives a zero value indicating its successful creation. •On failure, a -1 will be returned in the parent’s context, no child process will be created, and errno will be set. •The child process normally performs all its operations in its parents context but each process independently of one nother and also inherits some of the important attributes from it such as UID, current directory, root directory and so on. Significance of watchdog timer in Embedded Systems. •Watchdog timer is basically a timing device that is set for predefined time interval and some event should occur during that time interval else the device generates a time out signal. •One application where it is most widely used is when the mobile phone hangs and no activity takes place, in those cases watchdog timer performs a restart of the system and comes to the rescue of the users. •It is used to reset to the original state whenever some inappropriate events take place such as too many commands being given at the same time or other activities that result in malfunctioning of the GUI. It is usually operated by counter devices.