Subject: Re: syscall() system call stub
To: None <port-amd64@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: port-amd64
Date: 11/04/2007 21:58:39
On Sat, Nov 03, 2007 at 11:28:11AM +0000, David Laight wrote:
> The amd64 stub for syscall() is:
>
> ENTRY(syscall)
> movl %edi,%eax
> syscall
>
> (from libc/arch/x86_64/sys/syscall.S)
>
> This looks completely wrong to me.
> I think it needs to be:
> mov $0,%eax
> mov %rcx,%r10
> syscall
>
> probably generated by RSYSCALL(syscall)
Certainly the current libc code doesn't DTRT:
syscall(6, 10);
generates close(6) not close(10)
David
--
David Laight: david@l8s.co.uk