File: ctypes_libc.py

package info (click to toggle)
python-ptrace 0.7-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 680 kB
  • ctags: 1,002
  • sloc: python: 6,659; ansic: 263; 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)