Reboot the system

The following code can be used to actively restart the system machine.

  • Required header files
      #include<unistd.h>
      #include<sys/reboot.h>
    
  • Code
      //Synchronize data and save cached data to prevent data loss
      sync();
      reboot(RB_AUTOBOOT);
    
powered by Gitbooklast modified: 2021-05-28 12:00:31

results matching ""

    No results matching ""