problem with gettimeofday function

Discussion in 'Programming/Scripts' started by full_adder, Mar 11, 2007.

  1. full_adder

    full_adder New Member

    Hi

    undefined reference to `gettimeofday'

    the above error msg. appeared when I made : (make install) where I have changed in do_softirq function in softirq.c to compute the elapsed time, the main statements are:

    struct timeval t1, t2;
    ...
    gettimeofday(&t1, (void *)0); // alse gettimeofday(&t1, NULL) the same output
    ..

    may be the reason is that I omitted #include<sys/time.h> and <stdio.h>, but when I added them with the default include statements, it gave me another erorr:

    linux/stdio.h: No such file or directory
    sys/time.h: No such file or directory

    where that file contains the following include statements:

    #include <linux/module.h>
    #include <linux/kernel_stat.h>
    #include <linux/interrupt.h>
    #include <linux/init.h>
    #include <linux/mm.h>
    #include <linux/notifier.h>
    #include <linux/percpu.h>
    #include <linux/cpu.h>
    #include <linux/kthread.h>
    #include <linux/rcupdate.h>
    #include <asm/irq.h>


    thanks for any help.
     
  2. falko

    falko Super Moderator ISPConfig Developer

    If you're on Debian or Ubuntu, you can try to install the missing packages like this: http://www.howtoforge.com/apt_file_debian_ubuntu
     
  3. full_adder

    full_adder New Member

    I used do_gettimeofday() rathar than gettimeofday() like this:

    do_gettimeofday(&t1); //with one param.

    and it has worked well.
    thanks
     

Share This Page