LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Calling a system call from a system call? (https://www.linuxquestions.org/questions/programming-9/calling-a-system-call-from-a-system-call-484155/)

Loc_8 09-16-2006 04:21 PM

Calling a system call from a system call?
 
Is it legal to call a newly defined system call from within another system call (say, vfs_read in /fs/read_write.c for example)?

If so, what do I need to include in read_write.c? A test program in user-space defined the following:

Quote:

#include <ctype.h>
#include <errno.h>
#include "linux-2.6.16/include/asm-i386/unistd.h" // < modified

_syscall2(int, testCall, int, arg01, int, arg02)
...and I was able to use testCall. However, modifying read_write.c with the above lines added complains about "kernel_errno" being undeclared.

(btw, I'm just playing around with the kernel here; I don't expect to be messing with the system calls in a real program)

Any help is greatly appreciated, thanks.


All times are GMT -5. The time now is 03:54 AM.