1#!/bin/sh23#4# This job is very easy because app and kernel ABI are identical5# until the 4th parameter, so we only have to set the syscall6# number in rax78sed -n "9 s/[ ]*#.*//10 /$1/p" syscall.lst |11while read num name nargs12do13cat <<EOF > $name.s14 .file "$name.s"1516 .globl $name17$name:18 `case $nargs in 4|5|6)19 echo "movq %rcx,%r10"20 ;;21 esac`22 movq \$$num,%rax231: syscall24 jb 2f25 retq26272: movq %rax,(errno)28 movq \$-1,%rax29 retq3031 .section .openbsd.syscalls, "a", @progbits32 .long 1b33 .long $num34EOF35done