We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7771290 commit 8bed308Copy full SHA for 8bed308
fcntl/fcntl.py
@@ -1,4 +1,5 @@
1
import ffi
2
+import os
3
import _libc
4
5
@@ -12,13 +13,25 @@
12
13
14
def fcntl(fd, op, arg=0):
15
if type(arg) is int:
- return fcntl_l(fd, op, arg)
16
+ r = fcntl_l(fd, op, arg)
17
+ os.check_error(r)
18
+ return r
19
else:
- return fcntl_s(fd, op, arg)
20
+ r = fcntl_s(fd, op, arg)
21
22
+ # TODO: Not compliant. CPython says that arg should be immutable,
23
+ # and possibly mutated buffer is returned.
24
25
26
-def ioctl(fd, op, arg=0):
27
+def ioctl(fd, op, arg=0, mut=False):
28
- return ioctl_l(fd, op, arg)
29
+ r = ioctl_l(fd, op, arg)
30
31
32
- return ioctl_s(fd, op, arg)
33
+ # TODO
34
+ assert mut
35
+ r = ioctl_s(fd, op, arg)
36
37
0 commit comments