Created
November 21, 2017 21:07
-
-
Save athoik/4d4bca6d952b66337cc21abd0950b26e to your computer and use it in GitHub Desktop.
test ci ioctl
This file contains 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 os | |
import ctypes | |
libc = ctypes.cdll.LoadLibrary('libc.so.6') | |
ioctl = libc.ioctl | |
buffer = ctypes.c_char_p("\0"*256) | |
fd = os.open("/dev/ci0", os.O_RDWR | os.O_NONBLOCK) | |
ioctl(fd, 1, buffer) | |
print "len=", len(buffer.value), "buffer=", buffer.value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment