micropython-lib/fcntl/fcntl.py

25 wiersze
476 B
Python
Czysty Zwykły widok Historia

import ffi
2014-06-21 11:52:03 +00:00
import _libc
2014-06-21 11:52:03 +00:00
libc = _libc.get()
fcntl_l = libc.func("i", "fcntl", "iil")
fcntl_s = libc.func("i", "fcntl", "iip")
ioctl_l = libc.func("i", "ioctl", "iil")
ioctl_s = libc.func("i", "ioctl", "iip")
def fcntl(fd, op, arg):
if type(arg) is int:
return fcntl_l(fd, op, arg)
else:
return fcntl_s(fd, op, arg)
def ioctl(fd, op, arg):
if type(arg) is int:
return ioctl_l(fd, op, arg)
else:
return ioctl_s(fd, op, arg)