|
From: Jeremy F. <je...@go...> - 2005-02-20 07:33:56
|
Greg Parker wrote:
>Mac OS X definitely doesn't do it this way. The VG_(is_kerror)() model
>doesn't work at all. Returning two values would work. However, I've
>found it easier to use VG_(do_syscall) only for syscalls on Valgrind's
>behalf, and write a different dispatcher for client syscalls.
>
>
That's also true on the x86-linux port. Client syscalls need to be done
very carefully to make sure signals are dealt with properly;
VG_(do_syscall) should never be used for client syscalls (well, except
indirectly for special syscalls).
>The PowerPC's syscall instruction always returns a result in register
>r3. The difference between success and error is the instruction at
>which execution resumes after the syscall: (syscall+4) means error,
>and (syscall+8) means success. For native libc, the success case
>simply returns, and the error case branches to some code that moves
>the syscall result to errno and returns -1.
>
>
Yeah, its obvious that combining normal returns and error returns is a
bit Linux-specific.
J
|