ref: 9bd7deeee3fa7b5c36fca2bb45349fe38847f8ab
parent: 6f55ccbfe4eca08f1fa81f7cd19935ff53ac3e11
author: Ori Bernstein <ori@eigenstate.org>
date: Sun May 8 15:34:45 EDT 2016
Removed syscall stub from the wrong file.
--- a/lib/sys/syscall+freebsd-x64.s
+++ b/lib/sys/syscall+freebsd-x64.s
@@ -22,3 +22,22 @@
.success:
ret
+
+/*
+ * pipe() syscall returns the pipes created in eax:edx, and
+ * needs to copy them to the destination locations manually.
+ */
+.globl sys$__freebsd_pipe
+sys$__freebsd_pipe:
+ movq $0x2a,%rax
+ syscall
+
+ jae .pipesuccess
+ negq %rax
+
+.pipesuccess:
+ movl %eax,(%rdi)
+ movl %edx,4(%rdi)
+ xorq %rax,%rax
+ ret
+