syscall: td_retval and zero return value

Andriy Gapon avg at icyb.net.ua
Wed Nov 10 05:08:52 PST 2004


I have very little assembler/x86 knowledge.
Could anyone please help me understand what it means to assign a
non-zero value to td_retval in a system call when return value of the
call is zero/success?

I see in syscall() in src/sys/i386/i386/trap.c (btw is this the right
place?) that in such circumstances value from td_retval[] is put into
EAX and EDX registers and PSL_C (carry bit) is cleared in status/flags
register in a stack frame of a calling process. But I don't understand
what it practically means for the calling process.

Thank you in advance.

-- 
Andriy Gapon


More information about the freebsd-hackers mailing list