questions about reference to "jiffies"
sorry I am a linux newbie ,
I want to reference the extern variable "jiffies" value updated by kernel
in my programming code , but I found error message at compiled time , I don't know which header files should be included correctly, or maybe some where goes wrong . Can someone teach me how to reference the "jiffies" anywhere in my code !!
help would be greatly appreciated.
Thank you in advance
my test.c file
----------------
#include <stdio.h>
#include <linux/timer.h>
#include <linux/times.h>
#include <linux/timex.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <asm/uaccess.h>
extern unsigned long volatile jiffies;
int gett(void);
main ()
{
int result;
result = gett();
printf("result is %d\n", result);
printf("jiffies %.3lg \n", jiffies);
}
int gett(void){
int mult[2];
puts("puts multi a & b");
scanf("%d", &mult[0]);
scanf("%d", &mult[1]);
return mult[0]*mult[1];
}
--------------------
my makefile
---------------
INCLUDE = /usr/src/linux/include/
TARGET = test
CC = gcc
SRC = test.c
all:$(TARGET)
$(TARGET):$(SRC)
$(CC) -I$(INCLUDE) -o $(TARGET) $(SRC)
---------------------
|