Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Custom reboot system call


    Guys can u please convert the psuedo code here to proper linux/C/kernel syntax. Ive finally managed to invoke the custom syscall in my codes but I require it to do more than just print to screen

    #include <linux/linkage.h>
    #include <linux/kernel.h>
    #include <unistd.h>
    #include <linux/reboot.h>
    #include <linux/timer.h>
    #include <sys/reboot.h> 
    asmlinkage long sys_customreboot ( int delay)
    printk("<1>You have successfully called a custom syscall");
    // value= get current time  + delay (seconds);
    // while ( current time != value)   /*after factor seconds*/
    // {};           /* wait here*/
    // reboot();
    return 1;

  2. #2
    So you just want to run a command (i.e., /sbin/reboot)? Tried the system func? Or do you mean something else?

  3. #3

    SystemCall *(reboot the system, only disk flush!!!)

    #include <stdio.h>
    #include <sys/reboot.h>

    main (int argc, char **argv)
    if (reboot (RB_AUTOBOOT) < 0) {
    fprintf (stderr, "%s: call to reboot() system call failed.\n",

    return 0;

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts