I have a particular hardware driver which requires me to call _write(fd, 0, 0) on its file descriptor in order to trigger some particular behaviour.
I’d like to be able to do this from Python – please can anyone suggest a way of achieving this?
EDIT (should’ve put this in at the beginning, sorry!):
Things that have been tried and don’t work:
f.write("")
os.write(fd, "")
os.fdsync(fd)
If you really need to have a null pointer (what a terrible driver design – a ioctl would have been by far better), you’ll have to go via
ctypes.At least,
seems to work.