@@ -9,6 +9,16 @@ mod fcntl {
9
9
PyResult , VirtualMachine ,
10
10
} ;
11
11
12
+ // TODO: supply these from <asm-generic/fnctl.h> (please file an issue/PR upstream):
13
+ // LOCK_MAND, LOCK_READ, LOCK_WRITE, LOCK_RW, F_GETSIG, F_SETSIG, F_GETLK64, F_SETLK64,
14
+ // F_SETLKW64, FASYNC, F_EXLCK, F_SHLCK, DN_ACCESS, DN_MODIFY, DN_CREATE, DN_DELETE,
15
+ // DN_RENAME, DN_ATTRIB, DN_MULTISHOT
16
+ // NOTE: these are/were from <stropts.h>, which may not be present on systems nowadays:
17
+ // I_PUSH, I_POP, I_LOOK, I_FLUSH, I_FLUSHBAND, I_SETSIG, I_GETSIG, I_FIND, I_PEEK,
18
+ // I_SRDOPT, I_GRDOPT, I_NREAD, I_FDINSERT, I_STR, I_SWROPT, I_GWROPT, I_SENDFD,
19
+ // I_RECVFD, I_LIST, I_ATMARK, I_CKBAND, I_GETBAND, I_CANPUT, I_SETCLTIME, I_GETCLTIME,
20
+ // I_LINK, I_UNLINK, I_PLINK, I_PUNLINK
21
+
12
22
#[ pyattr]
13
23
use libc:: { FD_CLOEXEC , F_GETFD , F_GETFL , F_SETFD , F_SETFL } ;
14
24
@@ -22,12 +32,27 @@ mod fcntl {
22
32
23
33
#[ cfg( target_vendor = "apple" ) ]
24
34
#[ pyattr]
25
- use libc:: F_NOCACHE ;
35
+ use libc:: { F_FULLFSYNC , F_NOCACHE } ;
26
36
27
37
#[ cfg( target_os = "freebsd" ) ]
28
38
#[ pyattr]
29
39
use libc:: { F_DUP2FD , F_DUP2FD_CLOEXEC } ;
30
40
41
+ #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
42
+ #[ pyattr]
43
+ use libc:: { F_OFD_GETLK , F_OFD_SETLK , F_OFD_SETLKW } ;
44
+
45
+ #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
46
+ #[ pyattr]
47
+ use libc:: {
48
+ F_ADD_SEALS , F_GETLEASE , F_GETPIPE_SZ , F_GET_SEALS , F_NOTIFY , F_SEAL_GROW , F_SEAL_SEAL ,
49
+ F_SEAL_SHRINK , F_SEAL_WRITE , F_SETLEASE , F_SETPIPE_SZ ,
50
+ } ;
51
+
52
+ #[ cfg( any( target_os = "dragonfly" , target_os = "netbsd" , target_vendor = "apple" ) ) ]
53
+ #[ pyattr]
54
+ use libc:: F_GETPATH ;
55
+
31
56
#[ pyfunction]
32
57
fn fcntl (
33
58
io:: Fildes ( fd) : io:: Fildes ,
0 commit comments