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 rax78awk 'BEGIN {n = 33554432}9 {gsub(/ *#./, "")}10 /'$1'/ {printf("0x%x\t%s\t%s\n", n + $1, $2, $3)}' 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,%rax23 syscall24 jb 1f25 retq26271: movq %rax,_errno(%rip)28 movq \$-1,%rax29 retq30EOF31done