]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/makesyscalls.sh
xnu-6153.11.26.tar.gz
[apple/xnu.git] / bsd / kern / makesyscalls.sh
index 411d5ce6183a2e8c8b452b70eff22f8f82260a91..ffdacf957769351a6efd2f3cd3aed1a6d73c9d38 100755 (executable)
@@ -409,6 +409,9 @@ s/\$//g
                current_field++
                funcname = $current_field
                argalias = funcname "_args"
+               if (substr(argalias, 1, 4) == "sys_") {
+                       argalias = substr(argalias, 5)
+               }
                current_field++ # bump past function name
 
                if ($current_field != "(")
@@ -681,6 +684,9 @@ s/\$//g
                # output to syscalls.c
                if (add_sysnames_entry == 1) {
                        tempname = funcname
+                       if (substr(tempname, 1, 4) == "sys_") {
+                               tempname = substr(tempname, 5)
+                       }
                        if (funcname == "nosys" || funcname == "enosys") {
                                if (syscall_num == 0)
                                        tempname = "syscall"
@@ -701,6 +707,9 @@ s/\$//g
                # output to syscalls.h
                if (add_sysheader_entry == 1) {
                        tempname = funcname
+                       if (substr(tempname, 1, 4) == "sys_") {
+                               tempname = substr(tempname, 5)
+                       }
                        if (syscall_num == 0) {
                                tempname = "syscall"
                        }
@@ -762,7 +771,7 @@ s/\$//g
                printf("\n#endif /* !%s */\n", sysproto_h) > sysprotoend
 
                printf("};\n") > sysent
-               printf("unsigned int    nsysent = sizeof(sysent) / sizeof(sysent[0]);\n") > sysent
+               printf("const unsigned int      nsysent = sizeof(sysent) / sizeof(sysent[0]);\n") > sysent
 
                printf("};\n") > syscallnamestempfile
                printf("#define\t%sMAXSYSCALL\t%d\n", syscallprefix, syscall_num) \