def find_elf_h_constants(cc): """Returns a dictionary of relevant constants from <elf.h>.""" return glibcextract.compute_macro_consts( source_text='#include <elf.h>', cc=cc, macro_re='|'.join(prefix + '.*' for prefix in expected_constant_prefixes))
def kernel_constants(cc): """Return a dictionary with the kernel-defined system call numbers. This comes from <asm/unistd.h>. """ return {extract_system_call_name(name) : int(value) for name, value in glibcextract.compute_macro_consts( '#include <asm/unistd.h>\n' # Regularlize the kernel definitions if necessary. '#include <fixup-asm-unistd.h>', cc, macro_re=RE_SYSCALL, exclude_re=RE_PSEUDO_SYSCALL) .items()}