X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/ec4ff182252b6d7b3cb81f4fa783c5348a6c30fd..084eac3d5fa7deeab2296cf20653f4f7b3f75cd0:/lunaix-os/scripts/gen-syscall-header diff --git a/lunaix-os/scripts/gen-syscall-header b/lunaix-os/scripts/gen-syscall-header new file mode 100755 index 0000000..b32a52d --- /dev/null +++ b/lunaix-os/scripts/gen-syscall-header @@ -0,0 +1,22 @@ +#!/bin/bash + +outfile="$1" + +read -d '' payload < +EOF + +body=$(echo "$payload" \ + | gcc $CFLAGS -x none -E - -o- -nostdlib -P \ + | sed -e 's/^__NR__/#define __NR__/' \ + | sed -e '/#define/!d') + +cat < "$outfile" +#ifndef __LUNAIX_SYSCALL_H +#define __LUNAIX_SYSCALL_H + +$body + +#endif +EOF \ No newline at end of file