shithub: mc

Download patch

ref: c67d39e69ed554efcd252af61179afa7a192ea1a
parent: 4792730ddf78a778496334c97709c1e0da06a61d
author: EC2 Default User <ec2-user@ip-172-31-17-35.ec2.internal>
date: Mon May 15 21:35:31 EDT 2017

Allow for a 7th syscall argument for mmap.

	....but there aren't any 9th ones, right?

--- a/lib/sys/syscall+openbsd-x64.s
+++ b/lib/sys/syscall+openbsd-x64.s
@@ -15,6 +15,15 @@
 	movq 40(%rsp),%r10
 	movq 48(%rsp),%r8
 	movq 56(%rsp),%r9
+	/*
+	if there syscalls are more than 6
+	args (eg, mmap), the remaining args
+	are on the stack, with 8 dummy bytes 
+	for a return address.
+	*/
+	movq 64(%rsp),%rbx
+	pushq %rbx
+	pushq %rbx
 
 	syscall
 	jae .success
@@ -21,6 +30,7 @@
 	negq %rax
 
 .success:
+	addq $16,%rsp
 	ret
 
 /* __tfork_thread(tfp : tforkparams#, sz : size, fn : void#, arg : void#-> tid) */