Mattise IPC Specification

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

if you want to report error codes from the kernel, you should use a kernel-specific function.
So I should use another syscall when I don't need one? I don't want to! :P

pcmattman: You assume that I am using linux's syscall protocol. I'm not! I'm using syscall/sysret. I don't have to provide a system for assembler programs to work. I don't even need to!

And if the programmer didn't link in system libraries then crt0.c wouldn't be linked and as such some syscall initialisation wouldn't happen and some syscalls wouldn't work anyway!
As I said before, errno is part of the C library, NOT of the kernel.
The line is blurred, as far as I'm concerned. POSIX states that after certain function calls (some of which become syscalls) the variable 'errno' is set with the appropriate error code.

As far as the kernel is concerned, it gets passed a pointer into which it should place a code describing an error in a syscall. It doesn't know or care if it's a pointer to 'errno', it could be anything. It just so happens that it does point to errno. And, if I should follow your thinking and have a seperate function to retrieve the error code, not only would I have to call 2 syscalls on error, but I would also have to store that error code in the process table/somewhere else in kernel-space. How is duplicating the same data in the name of abstraction helping things? ;)

JamesM
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

JamesM wrote:pcmattman: You assume that I am using linux's syscall protocol. I'm not! I'm using syscall/sysret. I don't have to provide a system for assembler programs to work. I don't even need to!
I think you are confusing a system call with its relevant userland function call... A userland programmer calls a userland function to do something, then the libc (which you have programmed) calls the needed system calls to get the job done, gets any error codes, and then (if needed) sets errno and returns.

IMHO it really is up to you, it's not my kernel so I can't make decisions on it...

<OT>
Like my avatar?
</OT>
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

pcmattman: I think possibly you took that quote out of context - I was referring to your asm snippet which called a syscall directly. I was merely stating that because I use syscall/sysret, I implicitly don't support that mechanism anyway.

<OT>
Rofl, yes, but what is it?! looks like something from sesame street :P
</OT>
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

JamesM wrote:pcmattman: I think possibly you took that quote out of context - I was referring to your asm snippet which called a syscall directly. I was merely stating that because I use syscall/sysret, I implicitly don't support that mechanism anyway.
Ah, okay, I think I know understand where you are coming from.
<OT>
Rofl, yes, but what is it?! looks like something from sesame street :P
</OT>
It's a Domokun...
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Domo lives in an underground cave with Mr. Usaji ... Mr. Usaji is a wise old rabbit who loves to watch TV and drink astringent tea.
Rofl, how did you find him?!
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Rofl, how did you find him?!
Through a friend of a friend of mine...
Post Reply