도와주세요 ㅠㅠ

qurinel의 이미지

리눅스 시스템 콜 구현하고 있는데요
timeval로 분명 선언했는데 timespec이 tv_usec 을 가지지 않는다고 에러가 뜨네요;;
그리고 ctime은 왜 사용을 하지 못하는 걸까요 ??
time.h 선언하면 해당 파일이나 디렉토리를 찾을 수 없다고 하네요
그래서 혹시나해서 do_gettimeofday 써봤는데 역시 에러가... ㅠㅠ
소스랑 에러코드 첨부합니다 도와주세요 ㅠㅠ

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

asmlinkage int sys_pedagogictime(int flag, struct timeval *thetime){
int write_failed;

struct timeval *temp;

/*verify we can write to user space*/
write_failed = access_ok(VERIFY_WRITE, thetime, sizeof(thetime));

if(!write_failed){
printk("skelcall : Cannot write into user space");

return 0;

}

local_irq_disable(); //disable interrupts

//write into user space the values in xtime

copy_to_user(&thetime->tv_sec, &xtime.tv_sec, sizeof(xtime.tv_sec));
copy_to_user(&thetime->tv_usec, &xtime.tv_usec, sizeof(xtime.tv_usec));
local_irq_enable(); //enable interrupts

//verify we can read from user space

write_failed = access_ok(VERIFY_READ, thetime, sizeof(thetime));
if(!write_failed){
printk("skelcall: Cannot read freom user space");

return 0;
}

//copy back from user space into temporary variable for printing

temp = NULL;
copy_from_user(&temp->tv_sec, &thetime->tv_sec, sizeof(thetime->tv_sec));

copy_from_user(&temp->tv_usec, &thetime->tv_usec, sizeof(thetime->tv_usec));

//printf time if flag is true
if(flag)

printk("%s", ctime(temp->tv_sec));

return(!(write_failed));

}

File attachments: 
첨부파일 크기
Image icon error.png44.14 KB