Program To Shut Down Linux Using C. Can You Help?

1 Answers

Suresh R Profile
Suresh R answered
#include<stdlib.h>
#include<stdio.h>
#include<memory.h>
#include<time.h>
#include<ctype.h>
#include<unistd.h>
#include<linux/reboot.h>
int restart(int delay);
int main(void);
int shut(int delay)
{
sleep(delay);   
  return shut(LINUX_REBOOT_CMD_POWER_OFF);
}
int main(void)

    int I=0; 
    printf("shutdowning...");   
  fflush(stdout);     
     
shut(0);   
   

return 0;
}

Answer Question

Anonymous