• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Syscalls

Reel

Diamond Member
I had a project that I just completed where our assignment was to take a OpenBSD image that our professor gave us and add a syscall to the kernel, recompile, and test it. I completed the assignment and now have some questions which might be more appropriate for the professor but I thought I'd give them a shot here.

I don't know about syscalls in other OSes so any information about how they are implemented would be great but my specific question lies in why the code for them is implemented the way it is.

The function in my .c file is:
int countOccurances( struct proc *p, void *v, register_t *retval )

In the syscalls.master file, I put what I normally would have put in the .c:
countOccurances(const char *str, char c )

To return a value, I didn't type:
return count;

I used:
*retval = count;

I am curious about why the syscalls have to be implemented in this way.
 
Back
Top