Get out of the business of hard-coding a list of uapi unistd.h files.
If we were being clever here (say, excluding the irrelevant x32 or
arm-oabi files) there might be some reason to keep this, but since we're
literally just dragging in "all the things", including the ones we don't
support, let's just let python find them all.
This does actually remove a tiny amount of unwanted cruft from the
generated header as an additional bonus.
Test: ran manually, looked at output
Change-Id: Ie2b349c42d566f3bbe138834febaa0ef2de1c87d
diff --git a/libc/kernel/tools/update_all.py b/libc/kernel/tools/update_all.py
index 9e5ed42..331a957 100755
--- a/libc/kernel/tools/update_all.py
+++ b/libc/kernel/tools/update_all.py
@@ -88,16 +88,8 @@
# Collect the set of all syscalls for all architectures.
syscalls = set()
pattern = re.compile(r'^\s*#\s*define\s*__NR_([a-z_]\S+)')
- for unistd_h in ['kernel/uapi/asm-generic/unistd.h',
- 'kernel/uapi/asm-arm/asm/unistd.h',
- 'kernel/uapi/asm-arm/asm/unistd-eabi.h',
- 'kernel/uapi/asm-arm/asm/unistd-oabi.h',
- 'kernel/uapi/asm-riscv/asm/unistd_32.h',
- 'kernel/uapi/asm-riscv/asm/unistd_64.h',
- 'kernel/uapi/asm-x86/asm/unistd_32.h',
- 'kernel/uapi/asm-x86/asm/unistd_64.h',
- 'kernel/uapi/asm-x86/asm/unistd_x32.h']:
- for line in open(os.path.join(libc_root, unistd_h)):
+ for unistd_h in glob.glob('%s/kernel/uapi/asm-*/asm/unistd*.h' % libc_root):
+ for line in open(unistd_h):
m = re.search(pattern, line)
if m:
nr_name = m.group(1)