Restart 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: 2020-12-08 18:24:17

results matching ""

    No results matching ""