简体   繁体   中英

Get syscall number at runtime in Python

I've got some code that needs to call the getrandom libc function, but if it's not available (as it isn't on glibc versions before 2.24), I need to fall back to invoking the syscall directly. Unfortunately, the syscall number for the getrandom syscall differs by kernel version and platform, and my code needs to run on multiple platforms.

Is there a way that I can get the number at runtime?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM