]>
sourceware.org Git - glibc.git/blob - mach/shortcut.awk
1 # Icky intimate knowledge of MiG output.
3 BEGIN { print "/* This file is generated by shortcut.awk. */";
5 inproto=
0; proto=
""; arglist=
"";
8 $
1 ==
"LINTLIBRARY" { print "#include <mach.h>"; next }
10 # Copy the first line of the definition, but
11 # replace the function name (RPC) with CALL.
14 for (i =
1; i
< NF; ++i
) printf "%s ", $i
;
19 # Collect the lines of the prototype in PROTO, and extract the parameter
21 NF ==
1 && $
1 ==
")" { inproto=
0 }
22 inproto
{ proto = proto $
0;
24 gsub(/[^a
-zA
-Z0
-9_
,]/, "", arg
);
25 arglist = arglist arg
;
27 NF ==
1 && $
1 ==
"(" { inproto=
1 }
31 echo ==
1 { print $
0; }
33 /^
}$
/ && proto
!= "" \
36 print " kern_return_t err;";
37 print " extern kern_return_t " syscall
" (" proto
");";
38 print " extern kern_return_t " rpc
" (" proto
");";
39 print " err = " syscall
" (" arglist
");";
40 print " if (err == MACH_SEND_INTERRUPTED)";
41 print " err = " rpc
" (" arglist
");";
44 print "weak_alias (" call
", " alias
")";
45 # Declare RPC so the weak_alias that follows will work.
46 print "extern __typeof (" call
") " rpc
";";
This page took 0.03784 seconds and 5 git commands to generate.