Created
September 19, 2014 16:30
-
-
Save markrwilliams/86d882b61a616c761191 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
libc = ctypes.CDLL('libc.so.6') | |
def libc_version(): | |
# 2 appears to be _CS_GNU_LIBC_VERSION | |
length = libc.confstr(2, None, 0) | |
version = ctypes.create_string_buffer(length) | |
assert length == libc.confstr(2, ctypes.byref(version), length) | |
return version.value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment