notes
notes copied to clipboard
Fix calling convention and return value
System Call calling convention on System V x86-64 parameter is r10 while the usespace function calling convention is rcx.
Actually, Linux system call is return 128 bit (x86-64), 64 bit (i386) value. RDX as upper bits and EDX as upper bits. They're not changed if the value if rax / eax is enough to hold the return value.