1# AUTO-GENERATED FILE -- DO NOT EDIT 2 3""" This module performs file control and I/O control on file 4descriptors. It is an interface to the fcntl() and ioctl() Unix 5routines. File descriptors can be obtained with the fileno() method of 6a file or socket object. """ 7 8DN_ACCESS = 1 9DN_ATTRIB = 32 10DN_CREATE = 4 11DN_DELETE = 8 12DN_MODIFY = 2 13DN_MULTISHOT = 2147483648 14DN_RENAME = 16 15FASYNC = 8192 16FD_CLOEXEC = 1 17F_DUPFD = 0 18F_EXLCK = 4 19F_GETFD = 1 20F_GETFL = 3 21F_GETLEASE = 1025 22F_GETLK = 5 23F_GETLK64 = 5 24F_GETOWN = 9 25F_GETSIG = 11 26F_NOTIFY = 1026 27F_RDLCK = 0 28F_SETFD = 2 29F_SETFL = 4 30F_SETLEASE = 1024 31F_SETLK = 6 32F_SETLK64 = 6 33F_SETLKW = 7 34F_SETLKW64 = 7 35F_SETOWN = 8 36F_SETSIG = 10 37F_SHLCK = 8 38F_UNLCK = 2 39F_WRLCK = 1 40I_ATMARK = 21279 41I_CANPUT = 21282 42I_CKBAND = 21277 43I_FDINSERT = 21264 44I_FIND = 21259 45I_FLUSH = 21253 46I_FLUSHBAND = 21276 47I_GETBAND = 21278 48I_GETCLTIME = 21281 49I_GETSIG = 21258 50I_GRDOPT = 21255 51I_GWROPT = 21268 52I_LINK = 21260 53I_LIST = 21269 54I_LOOK = 21252 55I_NREAD = 21249 56I_PEEK = 21263 57I_PLINK = 21270 58I_POP = 21251 59I_PUNLINK = 21271 60I_PUSH = 21250 61I_RECVFD = 21262 62I_SENDFD = 21265 63I_SETCLTIME = 21280 64I_SETSIG = 21257 65I_SRDOPT = 21254 66I_STR = 21256 67I_SWROPT = 21267 68I_UNLINK = 21261 69LOCK_EX = 2 70LOCK_MAND = 32 71LOCK_NB = 4 72LOCK_READ = 64 73LOCK_RW = 192 74LOCK_SH = 1 75LOCK_UN = 8 76LOCK_WRITE = 128 77__package__ = None 78 79def fcntl(fd, opt, arg=None): 80 """ fcntl(fd, opt, [arg]) 81 82 Perform the requested operation on file descriptor fd. The operation 83 is defined by op and is operating system dependent. These constants are 84 available from the fcntl module. The argument arg is optional, and 85 defaults to 0; it may be an int or a string. If arg is given as a string, 86 the return value of fcntl is a string of that length, containing the 87 resulting value put in the arg buffer by the operating system. The length 88 of the arg string is not allowed to exceed 1024 bytes. If the arg given 89 is an integer or if none is specified, the result value is an integer 90 corresponding to the return value of the fcntl call in the C code. """ 91 pass 92 93def flock(fd, operation): 94 """ flock(fd, operation) 95 96 Perform the lock operation op on file descriptor fd. See the Unix 97 manual page for flock(3) for details. (On some systems, this function is 98 emulated using fcntl().) """ 99 pass 100 101def ioctl(fd, opt, arg=None, mutate_flag=None): 102 """ ioctl(fd, opt[, arg[, mutate_flag]]) 103 104 Perform the requested operation on file descriptor fd. The operation is 105 defined by opt and is operating system dependent. Typically these codes are 106 retrieved from the fcntl or termios library modules. 107 108 The argument arg is optional, and defaults to 0; it may be an int or a 109 buffer containing character data (most likely a string or an array). 110 111 If the argument is a mutable buffer (such as an array) and if the 112 mutate_flag argument (which is only allowed in this case) is true then the 113 buffer is (in effect) passed to the operating system and changes made by 114 the OS will be reflected in the contents of the buffer after the call has 115 returned. The return value is the integer returned by the ioctl system 116 call. 117 118 If the argument is a mutable buffer and the mutable_flag argument is not 119 passed or is false, the behavior is as if a string had been passed. This 120 behavior will change in future releases of Python. 121 122 If the argument is an immutable buffer (most likely a string) then a copy 123 of the buffer is passed to the operating system and the return value is a 124 string of the same length containing whatever the operating system put in 125 the buffer. The length of the arg buffer in this case is not allowed to 126 exceed 1024 bytes. 127 128 If the arg given is an integer or if none is specified, the result value is 129 an integer corresponding to the return value of the ioctl call in the C 130 code. """ 131 pass 132 133def lockf(): 134 """ lockf (fd, operation, length=0, start=0, whence=0) 135 136 This is essentially a wrapper around the fcntl() locking calls. fd is the 137 file descriptor of the file to lock or unlock, and operation is one of the 138 following values: 139 140 LOCK_UN - unlock 141 LOCK_SH - acquire a shared lock 142 LOCK_EX - acquire an exclusive lock 143 144 When operation is LOCK_SH or LOCK_EX, it can also be bitwise ORed with 145 LOCK_NB to avoid blocking on lock acquisition. If LOCK_NB is used and the 146 lock cannot be acquired, an IOError will be raised and the exception will 147 have an errno attribute set to EACCES or EAGAIN (depending on the operating 148 system -- for portability, check for either value). 149 150 length is the number of bytes to lock, with the default meaning to lock to 151 EOF. start is the byte offset, relative to whence, to that the lock 152 starts. whence is as with fileobj.seek(), specifically: 153 154 0 - relative to the start of the file (SEEK_SET) 155 1 - relative to the current buffer position (SEEK_CUR) 156 2 - relative to the end of the file (SEEK_END) """ 157 pass 158 159