In article
<a2f0e04c-9a6c-49f7-afc1-20f8e69ef952@[EMAIL PROTECTED]
>,
Robert Spykerman <robert.spykerman@[EMAIL PROTECTED]
> wrote:
> On Apr 30, 4:58 pm, Ben Artin <mac...@[EMAIL PROTECTED]
> wrote:
>
> > That prototype is for the C library fork() call, not for the fork
syscall.
> > I am wondering whether you'd be better off calling the C library,
which has
> > a sane calling convention.
>
> Agreed, that is probably a good idea - I may well decide to rewrite
> everything to this extent. I have to say though, it irritates me
somewhat
> that I may have to add another intermediate layer between the code and
the
> kernel, but I can see how this would avoid future problems should
syscalls
> change.
That is particularly true on Mac OS X, where syscalls are not the
primitive way
for userland code to communicate with the kernel -- Mach IPC is, and
syscalls
are layered on top of Mach IPC. So, by using syscalls you are *already*
one
layer above the kernel. If you want to be as close to the kernel as
possible,
then you need to use Mach APIs directly; they tend to be painfully
complicated
to call if you've never seen them before. If you want to avoid the pain,
you
might as well use fork() in the C library, which I believe will not have
weird
calling conventions.
Ben
--
If this message helped you, consider buying an item
from my wish list: <http://artins.org/ben/wishlist>


|