File: ctypes_libc.py

package info (click to toggle)
python-ptrace 0.6.4-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 620 kB
  • sloc: python: 6,213; ansic: 241; makefile: 13; sh: 1
file content (12 lines) | stat: -rw-r--r-- 256 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
"""
Load the system C library. Variables:
 - LIBC_FILENAME: the C library filename
 - libc: the loaded library
"""

from ctypes import CDLL
from ctypes.util import find_library

LIBC_FILENAME = find_library('c')
libc = CDLL(LIBC_FILENAME, use_errno=True)