5 awk -F'\t' '$3 ~ /^p$/ {
7 }' data/musl.generic.decls |sort |uniq >/tmp/m.funcs
11 #define _FILE_OFFSET_BITS 64
14 awk -F'\t' '$3 ~ /^p$/ {print $2}' data/musl.generic.decls |sort |uniq |awk '
15 /^sys\/io\.h$/ {print "// #include <"$0">"; next}
17 w = $0 ~ /^(sys\/cachectl|threads)\.h$/
18 if(w) print "#ifndef __GLIBC__"
19 print "#include <" $0 ">"
24 #define T(x) void t_##x(__typeof(x)*p){}
28 #define sigsetjmp __sigsetjmp
35 # non-portable or ctags mistake
36 /^(iopl|ioperm|ElfW)$/ {
39 # polymorphic in glibc
40 /^(index|memchr|memrchr|rindex|strcasestr|strchr|strchrnul|strlcat|strlcpy|strpbrk|strrchr|strstr|wcschr|wcspbrk|wcsrchr|wcsstr|wcswcs|wmemchr)$/ ||
42 /^(__flt_rounds|__freadahead|__freadptr|__freadptrinc|__fseterr|_pthread_cleanup_pop|_pthread_cleanup_push|fgetln|getdents|gets|issetugid|posix_close)$/ ||
43 /^(_flush_cache|cachectl|cacheflush)$/ ||
44 /^(call_once|cnd_broadcast|cnd_destroy|cnd_init|cnd_signal|cnd_timedwait|cnd_wait|mtx_destroy|mtx_init|mtx_lock|mtx_timedlock|mtx_trylock|mtx_unlock|thrd_create|thrd_current|thrd_detach|thrd_equal|thrd_exit|thrd_join|thrd_sleep|thrd_yield|tss_create|tss_delete|tss_get|tss_set)$/ {
45 print "M(T(" $0 "))"; next
47 { print "T(" $0 ")" }' /tmp/m.funcs >>abi_func.cc