Hi:
I am trying to implement a system call. I used the syscalls.master already.
I know I have to modify libc, but this requires makeworld and all the
binaries must be compiled again. If I don't want to modify libc, I know I
have to use the SYSCALL macro or something like that. But I don't know how
to use it. Also, I tried the syscall() function but are not getting good
results.
I just try to add a simple system call for testing:
int my_call(int x, int y) {
return (x + y);
}
In my user program:
int main(int argc, char ** argv) {
int x = 3;
int y = 8;
int z = 0;
z = syscall(SYS_my_call, x, y);
printf("%i + %i = %i\n", x, y, z);
return 0;
}
But it prints:
3 + 8 = -1
Can you give me some idea what I did wrong and what I should do? Also, can
you tell me how to use the SYSCALL macro because I am not familiar with
macros at all? Thanks in advance.
Thanks.
Ray,
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message