How to access pre-defined constant value from python with ctypes?
I have tried get a value, for example SIGTERM (it is clear that value be 15 in my environment x64 linux.) with ctypes.
Following is code that I wrote, but it raise a ValueError (Undefined Symbol).
Why this error caused?
Note that I using Ubuntu 19.10, x64, Python 3.7.5
code:
from ctypes import *
from ctypes.util import *
libc_path = find_library("c")
libc = CDLL(libc_path)
sigterm_value = c_int.in_dll(libc, "SIGTERM")