Skip to content

olavmrk/python-ioctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-ioctl

This Python module contains some simple helper functions for calling fcntl.ioctl().

Example

import ctypes
import os
import ioctl
import ioctl.linux

RNDGETENTCNT = ioctl.linux.IOR('R', 0x00, ctypes.c_int)
rndgetentcnt = ioctl.ioctl_fn_ptr_r(RNDGETENTCNT, ctypes.c_int)

fd = os.open('/dev/random', os.O_RDONLY)
entropy_avail = rndgetentcnt(fd)
print('entropy_avail:', entropy_avail)

About

ioctl helper functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published