@@ -20,24 +20,12 @@ module fcntl
20
20
[clinic start generated code]*/
21
21
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=124b58387c158179]*/
22
22
23
- static int
24
- conv_descriptor (PyObject * object , int * target )
25
- {
26
- int fd = PyObject_AsFileDescriptor (object );
27
-
28
- if (fd < 0 )
29
- return 0 ;
30
- * target = fd ;
31
- return 1 ;
32
- }
33
-
34
- /* Must come after conv_descriptor definition. */
35
23
#include "clinic/fcntlmodule.c.h"
36
24
37
25
/*[clinic input]
38
26
fcntl.fcntl
39
27
40
- fd: object(type='int', converter='conv_descriptor')
28
+ fd: fildes
41
29
cmd as code: int
42
30
arg: object(c_default='NULL') = 0
43
31
/
@@ -57,7 +45,7 @@ corresponding to the return value of the fcntl call in the C code.
57
45
58
46
static PyObject *
59
47
fcntl_fcntl_impl (PyObject * module , int fd , int code , PyObject * arg )
60
- /*[clinic end generated code: output=888fc93b51c295bd input=8cefbe59b29efbe2 ]*/
48
+ /*[clinic end generated code: output=888fc93b51c295bd input=7955340198e5f334 ]*/
61
49
{
62
50
unsigned int int_arg = 0 ;
63
51
int ret ;
@@ -116,7 +104,7 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg)
116
104
/*[clinic input]
117
105
fcntl.ioctl
118
106
119
- fd: object(type='int', converter='conv_descriptor')
107
+ fd: fildes
120
108
request as code: unsigned_int(bitwise=True)
121
109
arg as ob_arg: object(c_default='NULL') = 0
122
110
mutate_flag as mutate_arg: bool = True
@@ -155,7 +143,7 @@ code.
155
143
static PyObject *
156
144
fcntl_ioctl_impl (PyObject * module , int fd , unsigned int code ,
157
145
PyObject * ob_arg , int mutate_arg )
158
- /*[clinic end generated code: output=7f7f5840c65991be input=ede70c433cccbbb2 ]*/
146
+ /*[clinic end generated code: output=7f7f5840c65991be input=967b4a4cbeceb0a8 ]*/
159
147
{
160
148
#define IOCTL_BUFSZ 1024
161
149
/* We use the unsigned non-checked 'I' format for the 'code' parameter
@@ -280,7 +268,7 @@ fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
280
268
/*[clinic input]
281
269
fcntl.flock
282
270
283
- fd: object(type='int', converter='conv_descriptor')
271
+ fd: fildes
284
272
operation as code: int
285
273
/
286
274
@@ -292,7 +280,7 @@ function is emulated using fcntl()).
292
280
293
281
static PyObject *
294
282
fcntl_flock_impl (PyObject * module , int fd , int code )
295
- /*[clinic end generated code: output=84059e2b37d2fc64 input=b70a0a41ca22a8a0 ]*/
283
+ /*[clinic end generated code: output=84059e2b37d2fc64 input=0bfc00f795953452 ]*/
296
284
{
297
285
int ret ;
298
286
int async_err = 0 ;
@@ -346,7 +334,7 @@ fcntl_flock_impl(PyObject *module, int fd, int code)
346
334
/*[clinic input]
347
335
fcntl.lockf
348
336
349
- fd: object(type='int', converter='conv_descriptor')
337
+ fd: fildes
350
338
cmd as code: int
351
339
len as lenobj: object(c_default='NULL') = 0
352
340
start as startobj: object(c_default='NULL') = 0
@@ -380,7 +368,7 @@ starts. `whence` is as with fileobj.seek(), specifically:
380
368
static PyObject *
381
369
fcntl_lockf_impl (PyObject * module , int fd , int code , PyObject * lenobj ,
382
370
PyObject * startobj , int whence )
383
- /*[clinic end generated code: output=4985e7a172e7461a input=3a5dc01b04371f1a ]*/
371
+ /*[clinic end generated code: output=4985e7a172e7461a input=5480479fc63a04b8 ]*/
384
372
{
385
373
int ret ;
386
374
int async_err = 0 ;
0 commit comments