I have been running into a very strange problem in minix lately with regards to a system call I wrote. Basically the code runs fine from within a main() function, and the call does what it should. However, if I put the code in a function and call that function from within main(), it fails. Here is an example:
void do_foo()
{
message m;
_syscall(FS_PROC_NR, FOO, &m);
}
int main(int argc, char* argv[])
{
/* works */
message m;
_syscall(FS_PROC_NR, FOO, &m);
/* does not work */
do_foo();
}
It seems that if you call a function from your code, it should do the same thing as if you just wrote the code in the main function. What am I missing here??