Re: big problems (fwd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change it to:

9 /*  unsigned long time; */
10   struct timeval time;
11   do_gettimeofday (&time);
12 /*  time = time.tv_sec; */
13   printk ("%i", (int)time.tv_sec);

Eugene

<quote sender="Zwane Mwaikambo">
> Please keep him on Cc
> 
> ---------- Forwarded message ----------
> Date: Mon, 07 Jul 2003 16:22:35 +0300
> From: r2 <r2@aucegypt.edu>
> To: sherif@aucegypt.edu, thunder7@aucegypt.edu, zealos@nl.linux.org
> Subject: big problems
> 
> ----------module.c-----------
> #define __KERNEL__
> #define MODULE
> #include <linux/module.h>
> #include <linux/sched.h>
> #include <linux/time.h>
> #define MODVERSIONS
> 
> int init_module () {
>   unsigned long time;
>   do_gettimeofday (&xtime);
>   time = time.tv_sec;
>   printk ("%u" + time);
>   return (0);
> }
> 
> void cleanup_module () {
> }
> ----------module.c-----------
> 
> the above code gives me segmentation fault...any idea why?
> 
> r2
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 

-- 
Eugene TEO @ Linux Users Group, Singapore <eugeneteo@lugs.org.sg>
GPG FP: D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5 
main(i){putchar(182623909>>(i-1)*5&31|!!(i<7)<<6)&&main(++i);}

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux