File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 1
1
import ffi
2
+ import os
2
3
import _libc
3
4
4
5
12
13
13
14
def fcntl (fd , op , arg = 0 ):
14
15
if type (arg ) is int :
15
- return fcntl_l (fd , op , arg )
16
+ r = fcntl_l (fd , op , arg )
17
+ os .check_error (r )
18
+ return r
16
19
else :
17
- return fcntl_s (fd , op , arg )
20
+ r = fcntl_s (fd , op , arg )
21
+ os .check_error (r )
22
+ # TODO: Not compliant. CPython says that arg should be immutable,
23
+ # and possibly mutated buffer is returned.
24
+ return r
18
25
19
26
20
- def ioctl (fd , op , arg = 0 ):
27
+ def ioctl (fd , op , arg = 0 , mut = False ):
21
28
if type (arg ) is int :
22
- return ioctl_l (fd , op , arg )
29
+ r = ioctl_l (fd , op , arg )
30
+ os .check_error (r )
31
+ return r
23
32
else :
24
- return ioctl_s (fd , op , arg )
33
+ # TODO
34
+ assert mut
35
+ r = ioctl_s (fd , op , arg )
36
+ os .check_error (r )
37
+ return r
You can’t perform that action at this time.
0 commit comments