[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
basic system call question
I implemented a basic system call "test" in kernel 2.2.18 that just
returns a*b for two integers a and b, and then compiled a user land
program to call "test" with arguments of 5 and 6. Upon executing the
program "systest" the number 30 is returned. Fine, so the system is
working. Now upon executing "strace ./systest" the following appeared the
output:
getrlimit(0x5, 0x6, 0x4010d098, 0x4000ae60, 0xbffffae4) = 30
fstat64(0x1, 0xbffff2e0) = -1 ENOSYS (Function not implemented)
Why is getrlimit being called, and why is fstat returning ENOSYS? Also,
it does not appear that my system call "test" is not being called anywhere
(except that getrlimit is returning the correct value of 30). Why?
$ cat systest.c
#include <stdio.h>
#include <linux/unistd.h>
static inline _syscall2(int, test, int,a,int,b)
void main()
{
printf("Return value: %d\n", test(5,6));
}
--Mike
Michael B. Rash
http://www.cipherdyne.com
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.kernelnewbies.org/