blob: 670af6a3d8de6cccc30405331c839e1c6813e01c [file] [log] [blame]
Tal Einat6dc57e22018-06-30 23:02:48 +03001/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5PyDoc_STRVAR(select_select__doc__,
6"select($module, rlist, wlist, xlist, timeout=None, /)\n"
7"--\n"
8"\n"
9"Wait until one or more file descriptors are ready for some kind of I/O.\n"
10"\n"
11"The first three arguments are sequences of file descriptors to be waited for:\n"
12"rlist -- wait until ready for reading\n"
13"wlist -- wait until ready for writing\n"
14"xlist -- wait for an \"exceptional condition\"\n"
15"If only one kind of condition is required, pass [] for the other lists.\n"
16"\n"
17"A file descriptor is either a socket or file object, or a small integer\n"
18"gotten from a fileno() method call on one of those.\n"
19"\n"
20"The optional 4th argument specifies a timeout in seconds; it may be\n"
21"a floating point number to specify fractions of seconds. If it is absent\n"
22"or None, the call will never time out.\n"
23"\n"
24"The return value is a tuple of three lists corresponding to the first three\n"
25"arguments; each contains the subset of the corresponding file descriptors\n"
26"that are ready.\n"
27"\n"
28"*** IMPORTANT NOTICE ***\n"
29"On Windows, only sockets are supported; on Unix, all file\n"
30"descriptors can be used.");
31
32#define SELECT_SELECT_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +020033 {"select", (PyCFunction)(void(*)(void))select_select, METH_FASTCALL, select_select__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +030034
35static PyObject *
36select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist,
37 PyObject *xlist, PyObject *timeout_obj);
38
39static PyObject *
40select_select(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
41{
42 PyObject *return_value = NULL;
43 PyObject *rlist;
44 PyObject *wlist;
45 PyObject *xlist;
46 PyObject *timeout_obj = Py_None;
47
Serhiy Storchaka2a39d252019-01-11 18:01:42 +020048 if (!_PyArg_CheckPositional("select", nargs, 3, 4)) {
Tal Einat6dc57e22018-06-30 23:02:48 +030049 goto exit;
50 }
Serhiy Storchaka2a39d252019-01-11 18:01:42 +020051 rlist = args[0];
52 wlist = args[1];
53 xlist = args[2];
54 if (nargs < 4) {
55 goto skip_optional;
56 }
57 timeout_obj = args[3];
58skip_optional:
Tal Einat6dc57e22018-06-30 23:02:48 +030059 return_value = select_select_impl(module, rlist, wlist, xlist, timeout_obj);
60
61exit:
62 return return_value;
63}
64
65#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL))
66
67PyDoc_STRVAR(select_poll_register__doc__,
68"register($self, fd, eventmask=POLLIN | POLLPRI | POLLOUT, /)\n"
69"--\n"
70"\n"
71"Register a file descriptor with the polling object.\n"
72"\n"
73" fd\n"
74" either an integer, or an object with a fileno() method returning an int\n"
75" eventmask\n"
76" an optional bitmask describing the type of events to check for");
77
78#define SELECT_POLL_REGISTER_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +020079 {"register", (PyCFunction)(void(*)(void))select_poll_register, METH_FASTCALL, select_poll_register__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +030080
81static PyObject *
82select_poll_register_impl(pollObject *self, int fd, unsigned short eventmask);
83
84static PyObject *
85select_poll_register(pollObject *self, PyObject *const *args, Py_ssize_t nargs)
86{
87 PyObject *return_value = NULL;
88 int fd;
89 unsigned short eventmask = POLLIN | POLLPRI | POLLOUT;
90
Serhiy Storchaka4fa95912019-01-11 16:01:14 +020091 if (!_PyArg_CheckPositional("register", nargs, 1, 2)) {
Tal Einat6dc57e22018-06-30 23:02:48 +030092 goto exit;
93 }
Serhiy Storchaka4fa95912019-01-11 16:01:14 +020094 if (!fildes_converter(args[0], &fd)) {
95 goto exit;
96 }
97 if (nargs < 2) {
98 goto skip_optional;
99 }
100 if (!_PyLong_UnsignedShort_Converter(args[1], &eventmask)) {
101 goto exit;
102 }
103skip_optional:
Tal Einat6dc57e22018-06-30 23:02:48 +0300104 return_value = select_poll_register_impl(self, fd, eventmask);
105
106exit:
107 return return_value;
108}
109
110#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) */
111
112#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL))
113
114PyDoc_STRVAR(select_poll_modify__doc__,
115"modify($self, fd, eventmask, /)\n"
116"--\n"
117"\n"
118"Modify an already registered file descriptor.\n"
119"\n"
120" fd\n"
121" either an integer, or an object with a fileno() method returning\n"
122" an int\n"
123" eventmask\n"
124" a bitmask describing the type of events to check for");
125
126#define SELECT_POLL_MODIFY_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200127 {"modify", (PyCFunction)(void(*)(void))select_poll_modify, METH_FASTCALL, select_poll_modify__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +0300128
129static PyObject *
130select_poll_modify_impl(pollObject *self, int fd, unsigned short eventmask);
131
132static PyObject *
133select_poll_modify(pollObject *self, PyObject *const *args, Py_ssize_t nargs)
134{
135 PyObject *return_value = NULL;
136 int fd;
137 unsigned short eventmask;
138
Serhiy Storchaka4fa95912019-01-11 16:01:14 +0200139 if (!_PyArg_CheckPositional("modify", nargs, 2, 2)) {
140 goto exit;
141 }
142 if (!fildes_converter(args[0], &fd)) {
143 goto exit;
144 }
145 if (!_PyLong_UnsignedShort_Converter(args[1], &eventmask)) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300146 goto exit;
147 }
148 return_value = select_poll_modify_impl(self, fd, eventmask);
149
150exit:
151 return return_value;
152}
153
154#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) */
155
156#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL))
157
158PyDoc_STRVAR(select_poll_unregister__doc__,
159"unregister($self, fd, /)\n"
160"--\n"
161"\n"
162"Remove a file descriptor being tracked by the polling object.");
163
164#define SELECT_POLL_UNREGISTER_METHODDEF \
165 {"unregister", (PyCFunction)select_poll_unregister, METH_O, select_poll_unregister__doc__},
166
167static PyObject *
168select_poll_unregister_impl(pollObject *self, int fd);
169
170static PyObject *
171select_poll_unregister(pollObject *self, PyObject *arg)
172{
173 PyObject *return_value = NULL;
174 int fd;
175
Serhiy Storchaka32d96a22018-12-25 13:23:47 +0200176 if (!fildes_converter(arg, &fd)) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300177 goto exit;
178 }
179 return_value = select_poll_unregister_impl(self, fd);
180
181exit:
182 return return_value;
183}
184
185#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) */
186
187#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL))
188
189PyDoc_STRVAR(select_poll_poll__doc__,
190"poll($self, timeout=None, /)\n"
191"--\n"
192"\n"
193"Polls the set of registered file descriptors.\n"
194"\n"
195"Returns a list containing any descriptors that have events or errors to\n"
196"report, as a list of (fd, event) 2-tuples.");
197
198#define SELECT_POLL_POLL_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200199 {"poll", (PyCFunction)(void(*)(void))select_poll_poll, METH_FASTCALL, select_poll_poll__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +0300200
201static PyObject *
202select_poll_poll_impl(pollObject *self, PyObject *timeout_obj);
203
204static PyObject *
205select_poll_poll(pollObject *self, PyObject *const *args, Py_ssize_t nargs)
206{
207 PyObject *return_value = NULL;
208 PyObject *timeout_obj = Py_None;
209
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200210 if (!_PyArg_CheckPositional("poll", nargs, 0, 1)) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300211 goto exit;
212 }
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200213 if (nargs < 1) {
214 goto skip_optional;
215 }
216 timeout_obj = args[0];
217skip_optional:
Tal Einat6dc57e22018-06-30 23:02:48 +0300218 return_value = select_poll_poll_impl(self, timeout_obj);
219
220exit:
221 return return_value;
222}
223
224#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) */
225
226#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
227
228PyDoc_STRVAR(select_devpoll_register__doc__,
229"register($self, fd, eventmask=POLLIN | POLLPRI | POLLOUT, /)\n"
230"--\n"
231"\n"
232"Register a file descriptor with the polling object.\n"
233"\n"
234" fd\n"
235" either an integer, or an object with a fileno() method returning\n"
236" an int\n"
237" eventmask\n"
238" an optional bitmask describing the type of events to check for");
239
240#define SELECT_DEVPOLL_REGISTER_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200241 {"register", (PyCFunction)(void(*)(void))select_devpoll_register, METH_FASTCALL, select_devpoll_register__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +0300242
243static PyObject *
244select_devpoll_register_impl(devpollObject *self, int fd,
245 unsigned short eventmask);
246
247static PyObject *
248select_devpoll_register(devpollObject *self, PyObject *const *args, Py_ssize_t nargs)
249{
250 PyObject *return_value = NULL;
251 int fd;
252 unsigned short eventmask = POLLIN | POLLPRI | POLLOUT;
253
Serhiy Storchaka4fa95912019-01-11 16:01:14 +0200254 if (!_PyArg_CheckPositional("register", nargs, 1, 2)) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300255 goto exit;
256 }
Serhiy Storchaka4fa95912019-01-11 16:01:14 +0200257 if (!fildes_converter(args[0], &fd)) {
258 goto exit;
259 }
260 if (nargs < 2) {
261 goto skip_optional;
262 }
263 if (!_PyLong_UnsignedShort_Converter(args[1], &eventmask)) {
264 goto exit;
265 }
266skip_optional:
Tal Einat6dc57e22018-06-30 23:02:48 +0300267 return_value = select_devpoll_register_impl(self, fd, eventmask);
268
269exit:
270 return return_value;
271}
272
273#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
274
275#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
276
277PyDoc_STRVAR(select_devpoll_modify__doc__,
278"modify($self, fd, eventmask=POLLIN | POLLPRI | POLLOUT, /)\n"
279"--\n"
280"\n"
281"Modify a possible already registered file descriptor.\n"
282"\n"
283" fd\n"
284" either an integer, or an object with a fileno() method returning\n"
285" an int\n"
286" eventmask\n"
287" an optional bitmask describing the type of events to check for");
288
289#define SELECT_DEVPOLL_MODIFY_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200290 {"modify", (PyCFunction)(void(*)(void))select_devpoll_modify, METH_FASTCALL, select_devpoll_modify__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +0300291
292static PyObject *
293select_devpoll_modify_impl(devpollObject *self, int fd,
294 unsigned short eventmask);
295
296static PyObject *
297select_devpoll_modify(devpollObject *self, PyObject *const *args, Py_ssize_t nargs)
298{
299 PyObject *return_value = NULL;
300 int fd;
301 unsigned short eventmask = POLLIN | POLLPRI | POLLOUT;
302
Serhiy Storchaka4fa95912019-01-11 16:01:14 +0200303 if (!_PyArg_CheckPositional("modify", nargs, 1, 2)) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300304 goto exit;
305 }
Serhiy Storchaka4fa95912019-01-11 16:01:14 +0200306 if (!fildes_converter(args[0], &fd)) {
307 goto exit;
308 }
309 if (nargs < 2) {
310 goto skip_optional;
311 }
312 if (!_PyLong_UnsignedShort_Converter(args[1], &eventmask)) {
313 goto exit;
314 }
315skip_optional:
Tal Einat6dc57e22018-06-30 23:02:48 +0300316 return_value = select_devpoll_modify_impl(self, fd, eventmask);
317
318exit:
319 return return_value;
320}
321
322#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
323
324#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
325
326PyDoc_STRVAR(select_devpoll_unregister__doc__,
327"unregister($self, fd, /)\n"
328"--\n"
329"\n"
330"Remove a file descriptor being tracked by the polling object.");
331
332#define SELECT_DEVPOLL_UNREGISTER_METHODDEF \
333 {"unregister", (PyCFunction)select_devpoll_unregister, METH_O, select_devpoll_unregister__doc__},
334
335static PyObject *
336select_devpoll_unregister_impl(devpollObject *self, int fd);
337
338static PyObject *
339select_devpoll_unregister(devpollObject *self, PyObject *arg)
340{
341 PyObject *return_value = NULL;
342 int fd;
343
Serhiy Storchaka32d96a22018-12-25 13:23:47 +0200344 if (!fildes_converter(arg, &fd)) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300345 goto exit;
346 }
347 return_value = select_devpoll_unregister_impl(self, fd);
348
349exit:
350 return return_value;
351}
352
353#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
354
355#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
356
357PyDoc_STRVAR(select_devpoll_poll__doc__,
358"poll($self, timeout=None, /)\n"
359"--\n"
360"\n"
361"Polls the set of registered file descriptors.\n"
362"\n"
363"Returns a list containing any descriptors that have events or errors to\n"
364"report, as a list of (fd, event) 2-tuples.");
365
366#define SELECT_DEVPOLL_POLL_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200367 {"poll", (PyCFunction)(void(*)(void))select_devpoll_poll, METH_FASTCALL, select_devpoll_poll__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +0300368
369static PyObject *
370select_devpoll_poll_impl(devpollObject *self, PyObject *timeout_obj);
371
372static PyObject *
373select_devpoll_poll(devpollObject *self, PyObject *const *args, Py_ssize_t nargs)
374{
375 PyObject *return_value = NULL;
376 PyObject *timeout_obj = Py_None;
377
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200378 if (!_PyArg_CheckPositional("poll", nargs, 0, 1)) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300379 goto exit;
380 }
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200381 if (nargs < 1) {
382 goto skip_optional;
383 }
384 timeout_obj = args[0];
385skip_optional:
Tal Einat6dc57e22018-06-30 23:02:48 +0300386 return_value = select_devpoll_poll_impl(self, timeout_obj);
387
388exit:
389 return return_value;
390}
391
392#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
393
394#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
395
396PyDoc_STRVAR(select_devpoll_close__doc__,
397"close($self, /)\n"
398"--\n"
399"\n"
400"Close the devpoll file descriptor.\n"
401"\n"
402"Further operations on the devpoll object will raise an exception.");
403
404#define SELECT_DEVPOLL_CLOSE_METHODDEF \
405 {"close", (PyCFunction)select_devpoll_close, METH_NOARGS, select_devpoll_close__doc__},
406
407static PyObject *
408select_devpoll_close_impl(devpollObject *self);
409
410static PyObject *
411select_devpoll_close(devpollObject *self, PyObject *Py_UNUSED(ignored))
412{
413 return select_devpoll_close_impl(self);
414}
415
416#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
417
418#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
419
420PyDoc_STRVAR(select_devpoll_fileno__doc__,
421"fileno($self, /)\n"
422"--\n"
423"\n"
424"Return the file descriptor.");
425
426#define SELECT_DEVPOLL_FILENO_METHODDEF \
427 {"fileno", (PyCFunction)select_devpoll_fileno, METH_NOARGS, select_devpoll_fileno__doc__},
428
429static PyObject *
430select_devpoll_fileno_impl(devpollObject *self);
431
432static PyObject *
433select_devpoll_fileno(devpollObject *self, PyObject *Py_UNUSED(ignored))
434{
435 return select_devpoll_fileno_impl(self);
436}
437
438#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
439
440#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL))
441
442PyDoc_STRVAR(select_poll__doc__,
443"poll($module, /)\n"
444"--\n"
445"\n"
446"Returns a polling object.\n"
447"\n"
448"This object supports registering and unregistering file descriptors, and then\n"
449"polling them for I/O events.");
450
451#define SELECT_POLL_METHODDEF \
452 {"poll", (PyCFunction)select_poll, METH_NOARGS, select_poll__doc__},
453
454static PyObject *
455select_poll_impl(PyObject *module);
456
457static PyObject *
458select_poll(PyObject *module, PyObject *Py_UNUSED(ignored))
459{
460 return select_poll_impl(module);
461}
462
463#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) */
464
465#if (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H)
466
467PyDoc_STRVAR(select_devpoll__doc__,
468"devpoll($module, /)\n"
469"--\n"
470"\n"
471"Returns a polling object.\n"
472"\n"
473"This object supports registering and unregistering file descriptors, and then\n"
474"polling them for I/O events.");
475
476#define SELECT_DEVPOLL_METHODDEF \
477 {"devpoll", (PyCFunction)select_devpoll, METH_NOARGS, select_devpoll__doc__},
478
479static PyObject *
480select_devpoll_impl(PyObject *module);
481
482static PyObject *
483select_devpoll(PyObject *module, PyObject *Py_UNUSED(ignored))
484{
485 return select_devpoll_impl(module);
486}
487
488#endif /* (defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)) && defined(HAVE_SYS_DEVPOLL_H) */
489
490#if defined(HAVE_EPOLL)
491
492PyDoc_STRVAR(select_epoll__doc__,
493"epoll(sizehint=-1, flags=0)\n"
494"--\n"
495"\n"
496"Returns an epolling object.\n"
497"\n"
498" sizehint\n"
499" The expected number of events to be registered. It must be positive,\n"
500" or -1 to use the default. It is only used on older systems where\n"
501" epoll_create1() is not available; otherwise it has no effect (though its\n"
502" value is still checked).\n"
503" flags\n"
504" Deprecated and completely ignored. However, when supplied, its value\n"
505" must be 0 or select.EPOLL_CLOEXEC, otherwise OSError is raised.");
506
507static PyObject *
508select_epoll_impl(PyTypeObject *type, int sizehint, int flags);
509
510static PyObject *
511select_epoll(PyTypeObject *type, PyObject *args, PyObject *kwargs)
512{
513 PyObject *return_value = NULL;
514 static const char * const _keywords[] = {"sizehint", "flags", NULL};
Serhiy Storchaka31913912019-03-14 10:32:22 +0200515 static _PyArg_Parser _parser = {NULL, _keywords, "epoll", 0};
516 PyObject *argsbuf[2];
517 PyObject * const *fastargs;
518 Py_ssize_t nargs = PyTuple_GET_SIZE(args);
519 Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
Tal Einat6dc57e22018-06-30 23:02:48 +0300520 int sizehint = -1;
521 int flags = 0;
522
Serhiy Storchaka31913912019-03-14 10:32:22 +0200523 fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 2, 0, argsbuf);
524 if (!fastargs) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300525 goto exit;
526 }
Serhiy Storchaka31913912019-03-14 10:32:22 +0200527 if (!noptargs) {
528 goto skip_optional_pos;
529 }
530 if (fastargs[0]) {
531 if (PyFloat_Check(fastargs[0])) {
532 PyErr_SetString(PyExc_TypeError,
533 "integer argument expected, got float" );
534 goto exit;
535 }
536 sizehint = _PyLong_AsInt(fastargs[0]);
537 if (sizehint == -1 && PyErr_Occurred()) {
538 goto exit;
539 }
540 if (!--noptargs) {
541 goto skip_optional_pos;
542 }
543 }
544 if (PyFloat_Check(fastargs[1])) {
545 PyErr_SetString(PyExc_TypeError,
546 "integer argument expected, got float" );
547 goto exit;
548 }
549 flags = _PyLong_AsInt(fastargs[1]);
550 if (flags == -1 && PyErr_Occurred()) {
551 goto exit;
552 }
553skip_optional_pos:
Tal Einat6dc57e22018-06-30 23:02:48 +0300554 return_value = select_epoll_impl(type, sizehint, flags);
555
556exit:
557 return return_value;
558}
559
560#endif /* defined(HAVE_EPOLL) */
561
562#if defined(HAVE_EPOLL)
563
564PyDoc_STRVAR(select_epoll_close__doc__,
565"close($self, /)\n"
566"--\n"
567"\n"
568"Close the epoll control file descriptor.\n"
569"\n"
570"Further operations on the epoll object will raise an exception.");
571
572#define SELECT_EPOLL_CLOSE_METHODDEF \
573 {"close", (PyCFunction)select_epoll_close, METH_NOARGS, select_epoll_close__doc__},
574
575static PyObject *
576select_epoll_close_impl(pyEpoll_Object *self);
577
578static PyObject *
579select_epoll_close(pyEpoll_Object *self, PyObject *Py_UNUSED(ignored))
580{
581 return select_epoll_close_impl(self);
582}
583
584#endif /* defined(HAVE_EPOLL) */
585
586#if defined(HAVE_EPOLL)
587
588PyDoc_STRVAR(select_epoll_fileno__doc__,
589"fileno($self, /)\n"
590"--\n"
591"\n"
592"Return the epoll control file descriptor.");
593
594#define SELECT_EPOLL_FILENO_METHODDEF \
595 {"fileno", (PyCFunction)select_epoll_fileno, METH_NOARGS, select_epoll_fileno__doc__},
596
597static PyObject *
598select_epoll_fileno_impl(pyEpoll_Object *self);
599
600static PyObject *
601select_epoll_fileno(pyEpoll_Object *self, PyObject *Py_UNUSED(ignored))
602{
603 return select_epoll_fileno_impl(self);
604}
605
606#endif /* defined(HAVE_EPOLL) */
607
608#if defined(HAVE_EPOLL)
609
610PyDoc_STRVAR(select_epoll_fromfd__doc__,
611"fromfd($type, fd, /)\n"
612"--\n"
613"\n"
614"Create an epoll object from a given control fd.");
615
616#define SELECT_EPOLL_FROMFD_METHODDEF \
617 {"fromfd", (PyCFunction)select_epoll_fromfd, METH_O|METH_CLASS, select_epoll_fromfd__doc__},
618
619static PyObject *
620select_epoll_fromfd_impl(PyTypeObject *type, int fd);
621
622static PyObject *
623select_epoll_fromfd(PyTypeObject *type, PyObject *arg)
624{
625 PyObject *return_value = NULL;
626 int fd;
627
Serhiy Storchaka32d96a22018-12-25 13:23:47 +0200628 if (PyFloat_Check(arg)) {
629 PyErr_SetString(PyExc_TypeError,
630 "integer argument expected, got float" );
631 goto exit;
632 }
633 fd = _PyLong_AsInt(arg);
634 if (fd == -1 && PyErr_Occurred()) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300635 goto exit;
636 }
637 return_value = select_epoll_fromfd_impl(type, fd);
638
639exit:
640 return return_value;
641}
642
643#endif /* defined(HAVE_EPOLL) */
644
645#if defined(HAVE_EPOLL)
646
647PyDoc_STRVAR(select_epoll_register__doc__,
648"register($self, /, fd, eventmask=EPOLLIN | EPOLLPRI | EPOLLOUT)\n"
649"--\n"
650"\n"
651"Registers a new fd or raises an OSError if the fd is already registered.\n"
652"\n"
653" fd\n"
654" the target file descriptor of the operation\n"
655" eventmask\n"
656" a bit set composed of the various EPOLL constants\n"
657"\n"
658"The epoll interface supports all file descriptors that support poll.");
659
660#define SELECT_EPOLL_REGISTER_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200661 {"register", (PyCFunction)(void(*)(void))select_epoll_register, METH_FASTCALL|METH_KEYWORDS, select_epoll_register__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +0300662
663static PyObject *
664select_epoll_register_impl(pyEpoll_Object *self, int fd,
665 unsigned int eventmask);
666
667static PyObject *
668select_epoll_register(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
669{
670 PyObject *return_value = NULL;
671 static const char * const _keywords[] = {"fd", "eventmask", NULL};
Serhiy Storchaka31913912019-03-14 10:32:22 +0200672 static _PyArg_Parser _parser = {NULL, _keywords, "register", 0};
673 PyObject *argsbuf[2];
674 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
Tal Einat6dc57e22018-06-30 23:02:48 +0300675 int fd;
676 unsigned int eventmask = EPOLLIN | EPOLLPRI | EPOLLOUT;
677
Serhiy Storchaka31913912019-03-14 10:32:22 +0200678 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
679 if (!args) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300680 goto exit;
681 }
Serhiy Storchaka31913912019-03-14 10:32:22 +0200682 if (!fildes_converter(args[0], &fd)) {
683 goto exit;
684 }
685 if (!noptargs) {
686 goto skip_optional_pos;
687 }
688 if (PyFloat_Check(args[1])) {
689 PyErr_SetString(PyExc_TypeError,
690 "integer argument expected, got float" );
691 goto exit;
692 }
693 eventmask = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
694 if (eventmask == (unsigned int)-1 && PyErr_Occurred()) {
695 goto exit;
696 }
697skip_optional_pos:
Tal Einat6dc57e22018-06-30 23:02:48 +0300698 return_value = select_epoll_register_impl(self, fd, eventmask);
699
700exit:
701 return return_value;
702}
703
704#endif /* defined(HAVE_EPOLL) */
705
706#if defined(HAVE_EPOLL)
707
708PyDoc_STRVAR(select_epoll_modify__doc__,
709"modify($self, /, fd, eventmask)\n"
710"--\n"
711"\n"
712"Modify event mask for a registered file descriptor.\n"
713"\n"
714" fd\n"
715" the target file descriptor of the operation\n"
716" eventmask\n"
717" a bit set composed of the various EPOLL constants");
718
719#define SELECT_EPOLL_MODIFY_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200720 {"modify", (PyCFunction)(void(*)(void))select_epoll_modify, METH_FASTCALL|METH_KEYWORDS, select_epoll_modify__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +0300721
722static PyObject *
723select_epoll_modify_impl(pyEpoll_Object *self, int fd,
724 unsigned int eventmask);
725
726static PyObject *
727select_epoll_modify(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
728{
729 PyObject *return_value = NULL;
730 static const char * const _keywords[] = {"fd", "eventmask", NULL};
Serhiy Storchaka31913912019-03-14 10:32:22 +0200731 static _PyArg_Parser _parser = {NULL, _keywords, "modify", 0};
732 PyObject *argsbuf[2];
Tal Einat6dc57e22018-06-30 23:02:48 +0300733 int fd;
734 unsigned int eventmask;
735
Serhiy Storchaka31913912019-03-14 10:32:22 +0200736 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
737 if (!args) {
738 goto exit;
739 }
740 if (!fildes_converter(args[0], &fd)) {
741 goto exit;
742 }
743 if (PyFloat_Check(args[1])) {
744 PyErr_SetString(PyExc_TypeError,
745 "integer argument expected, got float" );
746 goto exit;
747 }
748 eventmask = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
749 if (eventmask == (unsigned int)-1 && PyErr_Occurred()) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300750 goto exit;
751 }
752 return_value = select_epoll_modify_impl(self, fd, eventmask);
753
754exit:
755 return return_value;
756}
757
758#endif /* defined(HAVE_EPOLL) */
759
760#if defined(HAVE_EPOLL)
761
762PyDoc_STRVAR(select_epoll_unregister__doc__,
763"unregister($self, /, fd)\n"
764"--\n"
765"\n"
766"Remove a registered file descriptor from the epoll object.\n"
767"\n"
768" fd\n"
769" the target file descriptor of the operation");
770
771#define SELECT_EPOLL_UNREGISTER_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200772 {"unregister", (PyCFunction)(void(*)(void))select_epoll_unregister, METH_FASTCALL|METH_KEYWORDS, select_epoll_unregister__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +0300773
774static PyObject *
775select_epoll_unregister_impl(pyEpoll_Object *self, int fd);
776
777static PyObject *
778select_epoll_unregister(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
779{
780 PyObject *return_value = NULL;
781 static const char * const _keywords[] = {"fd", NULL};
Serhiy Storchaka31913912019-03-14 10:32:22 +0200782 static _PyArg_Parser _parser = {NULL, _keywords, "unregister", 0};
783 PyObject *argsbuf[1];
Tal Einat6dc57e22018-06-30 23:02:48 +0300784 int fd;
785
Serhiy Storchaka31913912019-03-14 10:32:22 +0200786 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
787 if (!args) {
788 goto exit;
789 }
790 if (!fildes_converter(args[0], &fd)) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300791 goto exit;
792 }
793 return_value = select_epoll_unregister_impl(self, fd);
794
795exit:
796 return return_value;
797}
798
799#endif /* defined(HAVE_EPOLL) */
800
801#if defined(HAVE_EPOLL)
802
803PyDoc_STRVAR(select_epoll_poll__doc__,
804"poll($self, /, timeout=None, maxevents=-1)\n"
805"--\n"
806"\n"
807"Wait for events on the epoll file descriptor.\n"
808"\n"
809" timeout\n"
810" the maximum time to wait in seconds (as float);\n"
811" a timeout of None or -1 makes poll wait indefinitely\n"
812" maxevents\n"
813" the maximum number of events returned; -1 means no limit\n"
814"\n"
815"Returns a list containing any descriptors that have events to report,\n"
816"as a list of (fd, events) 2-tuples.");
817
818#define SELECT_EPOLL_POLL_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200819 {"poll", (PyCFunction)(void(*)(void))select_epoll_poll, METH_FASTCALL|METH_KEYWORDS, select_epoll_poll__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +0300820
821static PyObject *
822select_epoll_poll_impl(pyEpoll_Object *self, PyObject *timeout_obj,
823 int maxevents);
824
825static PyObject *
826select_epoll_poll(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
827{
828 PyObject *return_value = NULL;
829 static const char * const _keywords[] = {"timeout", "maxevents", NULL};
Serhiy Storchaka31913912019-03-14 10:32:22 +0200830 static _PyArg_Parser _parser = {NULL, _keywords, "poll", 0};
831 PyObject *argsbuf[2];
832 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
Tal Einat6dc57e22018-06-30 23:02:48 +0300833 PyObject *timeout_obj = Py_None;
834 int maxevents = -1;
835
Serhiy Storchaka31913912019-03-14 10:32:22 +0200836 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 2, 0, argsbuf);
837 if (!args) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300838 goto exit;
839 }
Serhiy Storchaka31913912019-03-14 10:32:22 +0200840 if (!noptargs) {
841 goto skip_optional_pos;
842 }
843 if (args[0]) {
844 timeout_obj = args[0];
845 if (!--noptargs) {
846 goto skip_optional_pos;
847 }
848 }
849 if (PyFloat_Check(args[1])) {
850 PyErr_SetString(PyExc_TypeError,
851 "integer argument expected, got float" );
852 goto exit;
853 }
854 maxevents = _PyLong_AsInt(args[1]);
855 if (maxevents == -1 && PyErr_Occurred()) {
856 goto exit;
857 }
858skip_optional_pos:
Tal Einat6dc57e22018-06-30 23:02:48 +0300859 return_value = select_epoll_poll_impl(self, timeout_obj, maxevents);
860
861exit:
862 return return_value;
863}
864
865#endif /* defined(HAVE_EPOLL) */
866
867#if defined(HAVE_EPOLL)
868
869PyDoc_STRVAR(select_epoll___enter____doc__,
870"__enter__($self, /)\n"
871"--\n"
872"\n");
873
874#define SELECT_EPOLL___ENTER___METHODDEF \
875 {"__enter__", (PyCFunction)select_epoll___enter__, METH_NOARGS, select_epoll___enter____doc__},
876
877static PyObject *
878select_epoll___enter___impl(pyEpoll_Object *self);
879
880static PyObject *
881select_epoll___enter__(pyEpoll_Object *self, PyObject *Py_UNUSED(ignored))
882{
883 return select_epoll___enter___impl(self);
884}
885
886#endif /* defined(HAVE_EPOLL) */
887
888#if defined(HAVE_EPOLL)
889
890PyDoc_STRVAR(select_epoll___exit____doc__,
891"__exit__($self, exc_type=None, exc_value=None, exc_tb=None, /)\n"
892"--\n"
893"\n");
894
895#define SELECT_EPOLL___EXIT___METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200896 {"__exit__", (PyCFunction)(void(*)(void))select_epoll___exit__, METH_FASTCALL, select_epoll___exit____doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +0300897
898static PyObject *
899select_epoll___exit___impl(pyEpoll_Object *self, PyObject *exc_type,
900 PyObject *exc_value, PyObject *exc_tb);
901
902static PyObject *
903select_epoll___exit__(pyEpoll_Object *self, PyObject *const *args, Py_ssize_t nargs)
904{
905 PyObject *return_value = NULL;
906 PyObject *exc_type = Py_None;
907 PyObject *exc_value = Py_None;
908 PyObject *exc_tb = Py_None;
909
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200910 if (!_PyArg_CheckPositional("__exit__", nargs, 0, 3)) {
Tal Einat6dc57e22018-06-30 23:02:48 +0300911 goto exit;
912 }
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200913 if (nargs < 1) {
914 goto skip_optional;
915 }
916 exc_type = args[0];
917 if (nargs < 2) {
918 goto skip_optional;
919 }
920 exc_value = args[1];
921 if (nargs < 3) {
922 goto skip_optional;
923 }
924 exc_tb = args[2];
925skip_optional:
Tal Einat6dc57e22018-06-30 23:02:48 +0300926 return_value = select_epoll___exit___impl(self, exc_type, exc_value, exc_tb);
927
928exit:
929 return return_value;
930}
931
932#endif /* defined(HAVE_EPOLL) */
933
934#if defined(HAVE_KQUEUE)
935
936PyDoc_STRVAR(select_kqueue__doc__,
937"kqueue()\n"
938"--\n"
939"\n"
940"Kqueue syscall wrapper.\n"
941"\n"
942"For example, to start watching a socket for input:\n"
943">>> kq = kqueue()\n"
944">>> sock = socket()\n"
945">>> sock.connect((host, port))\n"
946">>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_ADD)], 0)\n"
947"\n"
948"To wait one second for it to become writeable:\n"
949">>> kq.control(None, 1, 1000)\n"
950"\n"
951"To stop listening:\n"
952">>> kq.control([kevent(sock, KQ_FILTER_WRITE, KQ_EV_DELETE)], 0)");
953
954static PyObject *
955select_kqueue_impl(PyTypeObject *type);
956
957static PyObject *
958select_kqueue(PyTypeObject *type, PyObject *args, PyObject *kwargs)
959{
960 PyObject *return_value = NULL;
961
Dino Viehlandf9190542019-09-14 15:20:27 +0100962 if ((type == _selectstate_global->kqueue_queue_Type) &&
Tal Einat6dc57e22018-06-30 23:02:48 +0300963 !_PyArg_NoPositional("kqueue", args)) {
964 goto exit;
965 }
Dino Viehlandf9190542019-09-14 15:20:27 +0100966 if ((type == _selectstate_global->kqueue_queue_Type) &&
Tal Einat6dc57e22018-06-30 23:02:48 +0300967 !_PyArg_NoKeywords("kqueue", kwargs)) {
968 goto exit;
969 }
970 return_value = select_kqueue_impl(type);
971
972exit:
973 return return_value;
974}
975
976#endif /* defined(HAVE_KQUEUE) */
977
978#if defined(HAVE_KQUEUE)
979
980PyDoc_STRVAR(select_kqueue_close__doc__,
981"close($self, /)\n"
982"--\n"
983"\n"
984"Close the kqueue control file descriptor.\n"
985"\n"
986"Further operations on the kqueue object will raise an exception.");
987
988#define SELECT_KQUEUE_CLOSE_METHODDEF \
989 {"close", (PyCFunction)select_kqueue_close, METH_NOARGS, select_kqueue_close__doc__},
990
991static PyObject *
992select_kqueue_close_impl(kqueue_queue_Object *self);
993
994static PyObject *
995select_kqueue_close(kqueue_queue_Object *self, PyObject *Py_UNUSED(ignored))
996{
997 return select_kqueue_close_impl(self);
998}
999
1000#endif /* defined(HAVE_KQUEUE) */
1001
1002#if defined(HAVE_KQUEUE)
1003
1004PyDoc_STRVAR(select_kqueue_fileno__doc__,
1005"fileno($self, /)\n"
1006"--\n"
1007"\n"
1008"Return the kqueue control file descriptor.");
1009
1010#define SELECT_KQUEUE_FILENO_METHODDEF \
1011 {"fileno", (PyCFunction)select_kqueue_fileno, METH_NOARGS, select_kqueue_fileno__doc__},
1012
1013static PyObject *
1014select_kqueue_fileno_impl(kqueue_queue_Object *self);
1015
1016static PyObject *
1017select_kqueue_fileno(kqueue_queue_Object *self, PyObject *Py_UNUSED(ignored))
1018{
1019 return select_kqueue_fileno_impl(self);
1020}
1021
1022#endif /* defined(HAVE_KQUEUE) */
1023
1024#if defined(HAVE_KQUEUE)
1025
1026PyDoc_STRVAR(select_kqueue_fromfd__doc__,
1027"fromfd($type, fd, /)\n"
1028"--\n"
1029"\n"
1030"Create a kqueue object from a given control fd.");
1031
1032#define SELECT_KQUEUE_FROMFD_METHODDEF \
1033 {"fromfd", (PyCFunction)select_kqueue_fromfd, METH_O|METH_CLASS, select_kqueue_fromfd__doc__},
1034
1035static PyObject *
1036select_kqueue_fromfd_impl(PyTypeObject *type, int fd);
1037
1038static PyObject *
1039select_kqueue_fromfd(PyTypeObject *type, PyObject *arg)
1040{
1041 PyObject *return_value = NULL;
1042 int fd;
1043
Serhiy Storchaka32d96a22018-12-25 13:23:47 +02001044 if (PyFloat_Check(arg)) {
1045 PyErr_SetString(PyExc_TypeError,
1046 "integer argument expected, got float" );
1047 goto exit;
1048 }
1049 fd = _PyLong_AsInt(arg);
1050 if (fd == -1 && PyErr_Occurred()) {
Tal Einat6dc57e22018-06-30 23:02:48 +03001051 goto exit;
1052 }
1053 return_value = select_kqueue_fromfd_impl(type, fd);
1054
1055exit:
1056 return return_value;
1057}
1058
1059#endif /* defined(HAVE_KQUEUE) */
1060
1061#if defined(HAVE_KQUEUE)
1062
1063PyDoc_STRVAR(select_kqueue_control__doc__,
1064"control($self, changelist, maxevents, timeout=None, /)\n"
1065"--\n"
1066"\n"
1067"Calls the kernel kevent function.\n"
1068"\n"
1069" changelist\n"
1070" Must be an iterable of kevent objects describing the changes to be made\n"
1071" to the kernel\'s watch list or None.\n"
1072" maxevents\n"
1073" The maximum number of events that the kernel will return.\n"
1074" timeout\n"
1075" The maximum time to wait in seconds, or else None to wait forever.\n"
1076" This accepts floats for smaller timeouts, too.");
1077
1078#define SELECT_KQUEUE_CONTROL_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +02001079 {"control", (PyCFunction)(void(*)(void))select_kqueue_control, METH_FASTCALL, select_kqueue_control__doc__},
Tal Einat6dc57e22018-06-30 23:02:48 +03001080
1081static PyObject *
1082select_kqueue_control_impl(kqueue_queue_Object *self, PyObject *changelist,
1083 int maxevents, PyObject *otimeout);
1084
1085static PyObject *
1086select_kqueue_control(kqueue_queue_Object *self, PyObject *const *args, Py_ssize_t nargs)
1087{
1088 PyObject *return_value = NULL;
1089 PyObject *changelist;
1090 int maxevents;
1091 PyObject *otimeout = Py_None;
1092
Serhiy Storchaka4fa95912019-01-11 16:01:14 +02001093 if (!_PyArg_CheckPositional("control", nargs, 2, 3)) {
Tal Einat6dc57e22018-06-30 23:02:48 +03001094 goto exit;
1095 }
Serhiy Storchaka4fa95912019-01-11 16:01:14 +02001096 changelist = args[0];
1097 if (PyFloat_Check(args[1])) {
1098 PyErr_SetString(PyExc_TypeError,
1099 "integer argument expected, got float" );
1100 goto exit;
1101 }
1102 maxevents = _PyLong_AsInt(args[1]);
1103 if (maxevents == -1 && PyErr_Occurred()) {
1104 goto exit;
1105 }
1106 if (nargs < 3) {
1107 goto skip_optional;
1108 }
1109 otimeout = args[2];
1110skip_optional:
Tal Einat6dc57e22018-06-30 23:02:48 +03001111 return_value = select_kqueue_control_impl(self, changelist, maxevents, otimeout);
1112
1113exit:
1114 return return_value;
1115}
1116
1117#endif /* defined(HAVE_KQUEUE) */
1118
1119#ifndef SELECT_POLL_REGISTER_METHODDEF
1120 #define SELECT_POLL_REGISTER_METHODDEF
1121#endif /* !defined(SELECT_POLL_REGISTER_METHODDEF) */
1122
1123#ifndef SELECT_POLL_MODIFY_METHODDEF
1124 #define SELECT_POLL_MODIFY_METHODDEF
1125#endif /* !defined(SELECT_POLL_MODIFY_METHODDEF) */
1126
1127#ifndef SELECT_POLL_UNREGISTER_METHODDEF
1128 #define SELECT_POLL_UNREGISTER_METHODDEF
1129#endif /* !defined(SELECT_POLL_UNREGISTER_METHODDEF) */
1130
1131#ifndef SELECT_POLL_POLL_METHODDEF
1132 #define SELECT_POLL_POLL_METHODDEF
1133#endif /* !defined(SELECT_POLL_POLL_METHODDEF) */
1134
1135#ifndef SELECT_DEVPOLL_REGISTER_METHODDEF
1136 #define SELECT_DEVPOLL_REGISTER_METHODDEF
1137#endif /* !defined(SELECT_DEVPOLL_REGISTER_METHODDEF) */
1138
1139#ifndef SELECT_DEVPOLL_MODIFY_METHODDEF
1140 #define SELECT_DEVPOLL_MODIFY_METHODDEF
1141#endif /* !defined(SELECT_DEVPOLL_MODIFY_METHODDEF) */
1142
1143#ifndef SELECT_DEVPOLL_UNREGISTER_METHODDEF
1144 #define SELECT_DEVPOLL_UNREGISTER_METHODDEF
1145#endif /* !defined(SELECT_DEVPOLL_UNREGISTER_METHODDEF) */
1146
1147#ifndef SELECT_DEVPOLL_POLL_METHODDEF
1148 #define SELECT_DEVPOLL_POLL_METHODDEF
1149#endif /* !defined(SELECT_DEVPOLL_POLL_METHODDEF) */
1150
1151#ifndef SELECT_DEVPOLL_CLOSE_METHODDEF
1152 #define SELECT_DEVPOLL_CLOSE_METHODDEF
1153#endif /* !defined(SELECT_DEVPOLL_CLOSE_METHODDEF) */
1154
1155#ifndef SELECT_DEVPOLL_FILENO_METHODDEF
1156 #define SELECT_DEVPOLL_FILENO_METHODDEF
1157#endif /* !defined(SELECT_DEVPOLL_FILENO_METHODDEF) */
1158
1159#ifndef SELECT_POLL_METHODDEF
1160 #define SELECT_POLL_METHODDEF
1161#endif /* !defined(SELECT_POLL_METHODDEF) */
1162
1163#ifndef SELECT_DEVPOLL_METHODDEF
1164 #define SELECT_DEVPOLL_METHODDEF
1165#endif /* !defined(SELECT_DEVPOLL_METHODDEF) */
1166
1167#ifndef SELECT_EPOLL_CLOSE_METHODDEF
1168 #define SELECT_EPOLL_CLOSE_METHODDEF
1169#endif /* !defined(SELECT_EPOLL_CLOSE_METHODDEF) */
1170
1171#ifndef SELECT_EPOLL_FILENO_METHODDEF
1172 #define SELECT_EPOLL_FILENO_METHODDEF
1173#endif /* !defined(SELECT_EPOLL_FILENO_METHODDEF) */
1174
1175#ifndef SELECT_EPOLL_FROMFD_METHODDEF
1176 #define SELECT_EPOLL_FROMFD_METHODDEF
1177#endif /* !defined(SELECT_EPOLL_FROMFD_METHODDEF) */
1178
1179#ifndef SELECT_EPOLL_REGISTER_METHODDEF
1180 #define SELECT_EPOLL_REGISTER_METHODDEF
1181#endif /* !defined(SELECT_EPOLL_REGISTER_METHODDEF) */
1182
1183#ifndef SELECT_EPOLL_MODIFY_METHODDEF
1184 #define SELECT_EPOLL_MODIFY_METHODDEF
1185#endif /* !defined(SELECT_EPOLL_MODIFY_METHODDEF) */
1186
1187#ifndef SELECT_EPOLL_UNREGISTER_METHODDEF
1188 #define SELECT_EPOLL_UNREGISTER_METHODDEF
1189#endif /* !defined(SELECT_EPOLL_UNREGISTER_METHODDEF) */
1190
1191#ifndef SELECT_EPOLL_POLL_METHODDEF
1192 #define SELECT_EPOLL_POLL_METHODDEF
1193#endif /* !defined(SELECT_EPOLL_POLL_METHODDEF) */
1194
1195#ifndef SELECT_EPOLL___ENTER___METHODDEF
1196 #define SELECT_EPOLL___ENTER___METHODDEF
1197#endif /* !defined(SELECT_EPOLL___ENTER___METHODDEF) */
1198
1199#ifndef SELECT_EPOLL___EXIT___METHODDEF
1200 #define SELECT_EPOLL___EXIT___METHODDEF
1201#endif /* !defined(SELECT_EPOLL___EXIT___METHODDEF) */
1202
1203#ifndef SELECT_KQUEUE_CLOSE_METHODDEF
1204 #define SELECT_KQUEUE_CLOSE_METHODDEF
1205#endif /* !defined(SELECT_KQUEUE_CLOSE_METHODDEF) */
1206
1207#ifndef SELECT_KQUEUE_FILENO_METHODDEF
1208 #define SELECT_KQUEUE_FILENO_METHODDEF
1209#endif /* !defined(SELECT_KQUEUE_FILENO_METHODDEF) */
1210
1211#ifndef SELECT_KQUEUE_FROMFD_METHODDEF
1212 #define SELECT_KQUEUE_FROMFD_METHODDEF
1213#endif /* !defined(SELECT_KQUEUE_FROMFD_METHODDEF) */
1214
1215#ifndef SELECT_KQUEUE_CONTROL_METHODDEF
1216 #define SELECT_KQUEUE_CONTROL_METHODDEF
1217#endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */
Dino Viehlandf9190542019-09-14 15:20:27 +01001218/*[clinic end generated code: output=26bb05e5fba2bfd1 input=a9049054013a1b77]*/