Debian Codegraph @

Doc/library/select.rst

raw
1 :mod:`!select` --- Waiting for I/O completion
2 =============================================
3
4 .. module:: select
5 :synopsis: Wait for I/O completion on multiple streams.
6
7 --------------
8
9 This module provides access to the :c:func:`!select` and :c:func:`!poll` functions
10 available in most operating systems, :c:func:`!devpoll` available on
11 Solaris and derivatives, :c:func:`!epoll` available on Linux 2.5+ and
12 :c:func:`!kqueue` available on most BSD.
13 Note that on Windows, it only works for sockets; on other operating systems,
14 it also works for other file types (in particular, on Unix, it works on pipes).
15 It cannot be used on regular files to determine whether a file has grown since
16 it was last read.
17
18 .. note::
19
20 The :mod:`selectors` module allows high-level and efficient I/O
21 multiplexing, built upon the :mod:`select` module primitives. Users are
22 encouraged to use the :mod:`selectors` module instead, unless they want
23 precise control over the OS-level primitives used.
24
25 .. include:: ../includes/wasm-notavail.rst
26
27 The module defines the following:
28
29
30 .. exception:: error
31
32 A deprecated alias of :exc:`OSError`.
33
34 .. versionchanged:: 3.3
35 Following :pep:`3151`, this class was made an alias of :exc:`OSError`.
36
37
38 .. function:: devpoll()
39
40 (Only supported on Solaris and derivatives.) Returns a ``/dev/poll``
41 polling object; see section :ref:`devpoll-objects` below for the
42 methods supported by devpoll objects.
43
44 :c:func:`!devpoll` objects are linked to the number of file
45 descriptors allowed at the time of instantiation. If your program
46 reduces this value, :c:func:`!devpoll` will fail. If your program
47 increases this value, :c:func:`!devpoll` may return an
48 incomplete list of active file descriptors.
49
50 The new file descriptor is :ref:`non-inheritable <fd_inheritance>`.
51
52 .. versionadded:: 3.3
53
54 .. versionchanged:: 3.4
55 The new file descriptor is now non-inheritable.
56
57 .. function:: epoll(sizehint=-1, flags=0)
58
59 (Only supported on Linux 2.5.44 and newer.) Return an edge polling object,
60 which can be used as Edge or Level Triggered interface for I/O
61 events.
62
63 *sizehint* informs epoll about the expected number of events to be
64 registered. It must be positive, or ``-1`` to use the default. It is only
65 used on older systems where :c:func:`!epoll_create1` is not available;
66 otherwise it has no effect (though its value is still checked).
67
68 *flags* is deprecated and completely ignored. However, when supplied, its
69 value must be ``0`` or ``select.EPOLL_CLOEXEC``, otherwise ``OSError`` is
70 raised.
71
72 See the :ref:`epoll-objects` section below for the methods supported by
73 epolling objects.
74
75 ``epoll`` objects support the context management protocol: when used in a
76 :keyword:`with` statement, the new file descriptor is automatically closed
77 at the end of the block.
78
79 The new file descriptor is :ref:`non-inheritable <fd_inheritance>`.
80
81 .. versionchanged:: 3.3
82 Added the *flags* parameter.
83
84 .. versionchanged:: 3.4
85 Support for the :keyword:`with` statement was added.
86 The new file descriptor is now non-inheritable.
87
88 .. deprecated:: 3.4
89 The *flags* parameter. ``select.EPOLL_CLOEXEC`` is used by default now.
90 Use :func:`os.set_inheritable` to make the file descriptor inheritable.
91
92
93 .. function:: poll()
94
95 (Not supported by all operating systems.) Returns a polling object, which
96 supports registering and unregistering file descriptors, and then polling them
97 for I/O events; see section :ref:`poll-objects` below for the methods supported
98 by polling objects.
99
100
101 .. function:: kqueue()
102
103 (Only supported on BSD.) Returns a kernel queue object; see section
104 :ref:`kqueue-objects` below for the methods supported by kqueue objects.
105
106 The new file descriptor is :ref:`non-inheritable <fd_inheritance>`.
107
108 .. versionchanged:: 3.4
109 The new file descriptor is now non-inheritable.
110
111
112 .. function:: kevent(ident, filter=KQ_FILTER_READ, flags=KQ_EV_ADD, fflags=0, data=0, udata=0)
113
114 (Only supported on BSD.) Returns a kernel event object; see section
115 :ref:`kevent-objects` below for the methods supported by kevent objects.
116
117
118 .. function:: select(rlist, wlist, xlist, timeout=None)
119
120 This is a straightforward interface to the Unix :c:func:`!select` system call.
121 The first three arguments are iterables of 'waitable objects': either
122 integers representing file descriptors or objects with a parameterless method
123 named :meth:`~io.IOBase.fileno` returning such an integer:
124
125 * *rlist*: wait until ready for reading
126 * *wlist*: wait until ready for writing
127 * *xlist*: wait for an "exceptional condition" (see the manual page for what
128 your system considers such a condition)
129
130 Empty iterables are allowed, but acceptance of three empty iterables is
131 platform-dependent. (It is known to work on Unix but not on Windows.) The
132 optional *timeout* argument specifies a time-out as a floating-point number
133 in seconds.
134 When the *timeout* argument is omitted or ``None``, the function blocks until
135 at least one file descriptor is ready. A time-out value of zero specifies a
136 poll and never blocks.
137
138 The return value is a triple of lists of objects that are ready: subsets of the
139 first three arguments. When the time-out is reached without a file descriptor
140 becoming ready, three empty lists are returned.
141
142 .. index::
143 single: socket() (in module socket)
144 single: popen() (in module os)
145
146 Among the acceptable object types in the iterables are Python :term:`file
147 objects <file object>` (e.g. ``sys.stdin``, or objects returned by
148 :func:`open` or :func:`os.popen`), socket objects returned by
149 :func:`socket.socket`. You may also define a :dfn:`wrapper` class yourself,
150 as long as it has an appropriate :meth:`~io.IOBase.fileno` method (that
151 really returns a file descriptor, not just a random integer).
152
153 .. note::
154
155 .. index:: single: WinSock
156
157 File objects on Windows are not acceptable, but sockets are. On Windows,
158 the underlying :c:func:`!select` function is provided by the WinSock
159 library, and does not handle file descriptors that don't originate from
160 WinSock.
161
162 .. versionchanged:: 3.5
163 The function is now retried with a recomputed timeout when interrupted by
164 a signal, except if the signal handler raises an exception (see
165 :pep:`475` for the rationale), instead of raising
166 :exc:`InterruptedError`.
167
168
169 .. data:: PIPE_BUF
170
171 The minimum number of bytes which can be written without blocking to a pipe
172 when the pipe has been reported as ready for writing by :func:`~select.select`,
173 :func:`!poll` or another interface in this module. This doesn't apply
174 to other kind of file-like objects such as sockets.
175
176 This value is guaranteed by POSIX to be at least 512.
177
178 .. availability:: Unix
179
180 .. versionadded:: 3.2
181
182
183 .. _devpoll-objects:
184
185 ``/dev/poll`` Polling Objects
186 -----------------------------
187
188 Solaris and derivatives have ``/dev/poll``. While :c:func:`!select` is
189 *O*\ (*highest file descriptor*) and :c:func:`!poll` is *O*\ (*number of file
190 descriptors*), ``/dev/poll`` is *O*\ (*active file descriptors*).
191
192 ``/dev/poll`` behaviour is very close to the standard :c:func:`!poll`
193 object.
194
195
196 .. method:: devpoll.close()
197
198 Close the file descriptor of the polling object.
199
200 .. versionadded:: 3.4
201
202
203 .. attribute:: devpoll.closed
204
205 ``True`` if the polling object is closed.
206
207 .. versionadded:: 3.4
208
209
210 .. method:: devpoll.fileno()
211
212 Return the file descriptor number of the polling object.
213
214 .. versionadded:: 3.4
215
216
217 .. method:: devpoll.register(fd[, eventmask])
218
219 Register a file descriptor with the polling object. Future calls to the
220 :meth:`poll` method will then check whether the file descriptor has any
221 pending I/O events. *fd* can be either an integer, or an object with a
222 :meth:`~io.IOBase.fileno` method that returns an integer. File objects
223 implement :meth:`!fileno`, so they can also be used as the argument.
224
225 *eventmask* is an optional bitmask describing the type of events you want to
226 check for. The constants are the same that with :c:func:`!poll`
227 object. The default value is a combination of the constants :const:`POLLIN`,
228 :const:`POLLPRI`, and :const:`POLLOUT`.
229
230 .. warning::
231
232 Registering a file descriptor that's already registered is not an
233 error, but the result is undefined. The appropriate action is to
234 unregister or modify it first. This is an important difference
235 compared with :c:func:`!poll`.
236
237
238 .. method:: devpoll.modify(fd[, eventmask])
239
240 This method does an :meth:`unregister` followed by a
241 :meth:`register`. It is (a bit) more efficient that doing the same
242 explicitly.
243
244
245 .. method:: devpoll.unregister(fd)
246
247 Remove a file descriptor being tracked by a polling object. Just like the
248 :meth:`register` method, *fd* can be an integer or an object with a
249 :meth:`~io.IOBase.fileno` method that returns an integer.
250
251 Attempting to remove a file descriptor that was never registered is
252 safely ignored.
253
254
255 .. method:: devpoll.poll([timeout])
256
257 Polls the set of registered file descriptors, and returns a possibly empty list
258 containing ``(fd, event)`` 2-tuples for the descriptors that have events or
259 errors to report. *fd* is the file descriptor, and *event* is a bitmask with
260 bits set for the reported events for that descriptor --- :const:`POLLIN` for
261 waiting input, :const:`POLLOUT` to indicate that the descriptor can be written
262 to, and so forth. An empty list indicates that the call timed out and no file
263 descriptors had any events to report. If *timeout* is given, it specifies the
264 length of time in milliseconds which the system will wait for events before
265 returning. If *timeout* is omitted, -1, or :const:`None`, the call will
266 block until there is an event for this poll object.
267
268 .. versionchanged:: 3.5
269 The function is now retried with a recomputed timeout when interrupted by
270 a signal, except if the signal handler raises an exception (see
271 :pep:`475` for the rationale), instead of raising
272 :exc:`InterruptedError`.
273
274
275 .. _epoll-objects:
276
277 Edge and Level Trigger Polling (epoll) Objects
278 ----------------------------------------------
279
280 https://linux.die.net/man/4/epoll
281
282 *eventmask*
283
284 +-------------------------+-----------------------------------------------+
285 | Constant | Meaning |
286 +=========================+===============================================+
287 | :const:`EPOLLIN` | Available for read |
288 +-------------------------+-----------------------------------------------+
289 | :const:`EPOLLOUT` | Available for write |
290 +-------------------------+-----------------------------------------------+
291 | :const:`EPOLLPRI` | Urgent data for read |
292 +-------------------------+-----------------------------------------------+
293 | :const:`EPOLLERR` | Error condition happened on the assoc. fd |
294 +-------------------------+-----------------------------------------------+
295 | :const:`EPOLLHUP` | Hang up happened on the assoc. fd |
296 +-------------------------+-----------------------------------------------+
297 | :const:`EPOLLET` | Set Edge Trigger behavior, the default is |
298 | | Level Trigger behavior |
299 +-------------------------+-----------------------------------------------+
300 | :const:`EPOLLONESHOT` | Set one-shot behavior. After one event is |
301 | | pulled out, the fd is internally disabled |
302 +-------------------------+-----------------------------------------------+
303 | :const:`EPOLLEXCLUSIVE` | Wake only one epoll object when the |
304 | | associated fd has an event. The default (if |
305 | | this flag is not set) is to wake all epoll |
306 | | objects polling on a fd. |
307 +-------------------------+-----------------------------------------------+
308 | :const:`EPOLLRDHUP` | Stream socket peer closed connection or shut |
309 | | down writing half of connection. |
310 +-------------------------+-----------------------------------------------+
311 | :const:`EPOLLRDNORM` | Equivalent to :const:`EPOLLIN` |
312 +-------------------------+-----------------------------------------------+
313 | :const:`EPOLLRDBAND` | Priority data band can be read. |
314 +-------------------------+-----------------------------------------------+
315 | :const:`EPOLLWRNORM` | Equivalent to :const:`EPOLLOUT` |
316 +-------------------------+-----------------------------------------------+
317 | :const:`EPOLLWRBAND` | Priority data may be written. |
318 +-------------------------+-----------------------------------------------+
319 | :const:`EPOLLMSG` | Ignored. |
320 +-------------------------+-----------------------------------------------+
321
322 .. versionadded:: 3.6
323 :const:`EPOLLEXCLUSIVE` was added. It's only supported by Linux Kernel 4.5
324 or later.
325
326 .. method:: epoll.close()
327
328 Close the control file descriptor of the epoll object.
329
330
331 .. attribute:: epoll.closed
332
333 ``True`` if the epoll object is closed.
334
335
336 .. method:: epoll.fileno()
337
338 Return the file descriptor number of the control fd.
339
340
341 .. method:: epoll.fromfd(fd)
342
343 Create an epoll object from a given file descriptor.
344
345
346 .. method:: epoll.register(fd[, eventmask])
347
348 Register a fd descriptor with the epoll object.
349
350
351 .. method:: epoll.modify(fd, eventmask)
352
353 Modify a registered file descriptor.
354
355
356 .. method:: epoll.unregister(fd)
357
358 Remove a registered file descriptor from the epoll object.
359
360 .. versionchanged:: 3.9
361 The method no longer ignores the :data:`~errno.EBADF` error.
362
363
364 .. method:: epoll.poll(timeout=None, maxevents=-1)
365
366 Wait for events. timeout in seconds (float)
367
368 .. versionchanged:: 3.5
369 The function is now retried with a recomputed timeout when interrupted by
370 a signal, except if the signal handler raises an exception (see
371 :pep:`475` for the rationale), instead of raising
372 :exc:`InterruptedError`.
373
374
375 .. _poll-objects:
376
377 Polling Objects
378 ---------------
379
380 The :c:func:`!poll` system call, supported on most Unix systems, provides better
381 scalability for network servers that service many, many clients at the same
382 time. :c:func:`!poll` scales better because the system call only requires listing
383 the file descriptors of interest, while :c:func:`!select` builds a bitmap, turns
384 on bits for the fds of interest, and then afterward the whole bitmap has to be
385 linearly scanned again. :c:func:`!select` is *O*\ (*highest file descriptor*), while
386 :c:func:`!poll` is *O*\ (*number of file descriptors*).
387
388
389 .. method:: poll.register(fd[, eventmask])
390
391 Register a file descriptor with the polling object. Future calls to the
392 :meth:`poll` method will then check whether the file descriptor has any
393 pending I/O events. *fd* can be either an integer, or an object with a
394 :meth:`~io.IOBase.fileno` method that returns an integer. File objects
395 implement :meth:`!fileno`, so they can also be used as the argument.
396
397 *eventmask* is an optional bitmask describing the type of events you want to
398 check for, and can be a combination of the constants :const:`POLLIN`,
399 :const:`POLLPRI`, and :const:`POLLOUT`, described in the table below. If not
400 specified, the default value used will check for all 3 types of events.
401
402 +-------------------+------------------------------------------+
403 | Constant | Meaning |
404 +===================+==========================================+
405 | :const:`POLLIN` | There is data to read |
406 +-------------------+------------------------------------------+
407 | :const:`POLLPRI` | There is urgent data to read |
408 +-------------------+------------------------------------------+
409 | :const:`POLLOUT` | Ready for output: writing will not block |
410 +-------------------+------------------------------------------+
411 | :const:`POLLERR` | Error condition of some sort |
412 +-------------------+------------------------------------------+
413 | :const:`POLLHUP` | Hung up |
414 +-------------------+------------------------------------------+
415 | :const:`POLLRDHUP`| Stream socket peer closed connection, or |
416 | | shut down writing half of connection |
417 +-------------------+------------------------------------------+
418 | :const:`POLLNVAL` | Invalid request: descriptor not open |
419 +-------------------+------------------------------------------+
420
421 Registering a file descriptor that's already registered is not an error, and has
422 the same effect as registering the descriptor exactly once.
423
424
425 .. method:: poll.modify(fd, eventmask)
426
427 Modifies an already registered fd. This has the same effect as
428 ``register(fd, eventmask)``. Attempting to modify a file descriptor
429 that was never registered causes an :exc:`OSError` exception with errno
430 :const:`ENOENT` to be raised.
431
432
433 .. method:: poll.unregister(fd)
434
435 Remove a file descriptor being tracked by a polling object. Just like the
436 :meth:`register` method, *fd* can be an integer or an object with a
437 :meth:`~io.IOBase.fileno` method that returns an integer.
438
439 Attempting to remove a file descriptor that was never registered causes a
440 :exc:`KeyError` exception to be raised.
441
442
443 .. method:: poll.poll([timeout])
444
445 Polls the set of registered file descriptors, and returns a possibly empty list
446 containing ``(fd, event)`` 2-tuples for the descriptors that have events or
447 errors to report. *fd* is the file descriptor, and *event* is a bitmask with
448 bits set for the reported events for that descriptor --- :const:`POLLIN` for
449 waiting input, :const:`POLLOUT` to indicate that the descriptor can be written
450 to, and so forth. An empty list indicates that the call timed out and no file
451 descriptors had any events to report. If *timeout* is given, it specifies the
452 length of time in milliseconds which the system will wait for events before
453 returning. If *timeout* is omitted, negative, or :const:`None`, the call will
454 block until there is an event for this poll object.
455
456 .. versionchanged:: 3.5
457 The function is now retried with a recomputed timeout when interrupted by
458 a signal, except if the signal handler raises an exception (see
459 :pep:`475` for the rationale), instead of raising
460 :exc:`InterruptedError`.
461
462
463 .. _kqueue-objects:
464
465 Kqueue Objects
466 --------------
467
468 .. method:: kqueue.close()
469
470 Close the control file descriptor of the kqueue object.
471
472
473 .. attribute:: kqueue.closed
474
475 ``True`` if the kqueue object is closed.
476
477
478 .. method:: kqueue.fileno()
479
480 Return the file descriptor number of the control fd.
481
482
483 .. method:: kqueue.fromfd(fd)
484
485 Create a kqueue object from a given file descriptor.
486
487
488 .. method:: kqueue.control(changelist, max_events[, timeout]) -> eventlist
489
490 Low level interface to kevent
491
492 - changelist must be an iterable of kevent objects or ``None``
493 - max_events must be 0 or a positive integer
494 - timeout in seconds (floats possible); the default is ``None``,
495 to wait forever
496
497 .. versionchanged:: 3.5
498 The function is now retried with a recomputed timeout when interrupted by
499 a signal, except if the signal handler raises an exception (see
500 :pep:`475` for the rationale), instead of raising
501 :exc:`InterruptedError`.
502
503
504 .. _kevent-objects:
505
506 Kevent Objects
507 --------------
508
509 https://man.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
510
511 .. attribute:: kevent.ident
512
513 Value used to identify the event. The interpretation depends on the filter
514 but it's usually the file descriptor. In the constructor ident can either
515 be an int or an object with a :meth:`~io.IOBase.fileno` method. kevent
516 stores the integer internally.
517
518 .. attribute:: kevent.filter
519
520 Name of the kernel filter.
521
522 +---------------------------+---------------------------------------------+
523 | Constant | Meaning |
524 +===========================+=============================================+
525 | :const:`KQ_FILTER_READ` | Takes a descriptor and returns whenever |
526 | | there is data available to read |
527 +---------------------------+---------------------------------------------+
528 | :const:`KQ_FILTER_WRITE` | Takes a descriptor and returns whenever |
529 | | there is data available to write |
530 +---------------------------+---------------------------------------------+
531 | :const:`KQ_FILTER_AIO` | AIO requests |
532 +---------------------------+---------------------------------------------+
533 | :const:`KQ_FILTER_VNODE` | Returns when one or more of the requested |
534 | | events watched in *fflag* occurs |
535 +---------------------------+---------------------------------------------+
536 | :const:`KQ_FILTER_PROC` | Watch for events on a process id |
537 +---------------------------+---------------------------------------------+
538 | :const:`KQ_FILTER_NETDEV` | Watch for events on a network device |
539 | | [not available on macOS] |
540 +---------------------------+---------------------------------------------+
541 | :const:`KQ_FILTER_SIGNAL` | Returns whenever the watched signal is |
542 | | delivered to the process |
543 +---------------------------+---------------------------------------------+
544 | :const:`KQ_FILTER_TIMER` | Establishes an arbitrary timer |
545 +---------------------------+---------------------------------------------+
546
547 .. attribute:: kevent.flags
548
549 Filter action.
550
551 +---------------------------+---------------------------------------------+
552 | Constant | Meaning |
553 +===========================+=============================================+
554 | :const:`KQ_EV_ADD` | Adds or modifies an event |
555 +---------------------------+---------------------------------------------+
556 | :const:`KQ_EV_DELETE` | Removes an event from the queue |
557 +---------------------------+---------------------------------------------+
558 | :const:`KQ_EV_ENABLE` | Permitscontrol() to returns the event |
559 +---------------------------+---------------------------------------------+
560 | :const:`KQ_EV_DISABLE` | Disablesevent |
561 +---------------------------+---------------------------------------------+
562 | :const:`KQ_EV_ONESHOT` | Removes event after first occurrence |
563 +---------------------------+---------------------------------------------+
564 | :const:`KQ_EV_CLEAR` | Reset the state after an event is retrieved |
565 +---------------------------+---------------------------------------------+
566 | :const:`KQ_EV_SYSFLAGS` | internal event |
567 +---------------------------+---------------------------------------------+
568 | :const:`KQ_EV_FLAG1` | internal event |
569 +---------------------------+---------------------------------------------+
570 | :const:`KQ_EV_EOF` | Filter specific EOF condition |
571 +---------------------------+---------------------------------------------+
572 | :const:`KQ_EV_ERROR` | See return values |
573 +---------------------------+---------------------------------------------+
574
575
576 .. attribute:: kevent.fflags
577
578 Filter specific flags.
579
580 :const:`KQ_FILTER_READ` and :const:`KQ_FILTER_WRITE` filter flags:
581
582 +----------------------------+--------------------------------------------+
583 | Constant | Meaning |
584 +============================+============================================+
585 | :const:`KQ_NOTE_LOWAT` | low water mark of a socket buffer |
586 +----------------------------+--------------------------------------------+
587
588 :const:`KQ_FILTER_VNODE` filter flags:
589
590 +----------------------------+--------------------------------------------+
591 | Constant | Meaning |
592 +============================+============================================+
593 | :const:`KQ_NOTE_DELETE` | *unlink()* was called |
594 +----------------------------+--------------------------------------------+
595 | :const:`KQ_NOTE_WRITE` | a write occurred |
596 +----------------------------+--------------------------------------------+
597 | :const:`KQ_NOTE_EXTEND` | the file was extended |
598 +----------------------------+--------------------------------------------+
599 | :const:`KQ_NOTE_ATTRIB` | an attribute was changed |
600 +----------------------------+--------------------------------------------+
601 | :const:`KQ_NOTE_LINK` | the link count has changed |
602 +----------------------------+--------------------------------------------+
603 | :const:`KQ_NOTE_RENAME` | the file was renamed |
604 +----------------------------+--------------------------------------------+
605 | :const:`KQ_NOTE_REVOKE` | access to the file was revoked |
606 +----------------------------+--------------------------------------------+
607
608 :const:`KQ_FILTER_PROC` filter flags:
609
610 +----------------------------+--------------------------------------------+
611 | Constant | Meaning |
612 +============================+============================================+
613 | :const:`KQ_NOTE_EXIT` | the process has exited |
614 +----------------------------+--------------------------------------------+
615 | :const:`KQ_NOTE_FORK` | the process has called *fork()* |
616 +----------------------------+--------------------------------------------+
617 | :const:`KQ_NOTE_EXEC` | the process has executed a new process |
618 +----------------------------+--------------------------------------------+
619 | :const:`KQ_NOTE_PCTRLMASK` | internal filter flag |
620 +----------------------------+--------------------------------------------+
621 | :const:`KQ_NOTE_PDATAMASK` | internal filter flag |
622 +----------------------------+--------------------------------------------+
623 | :const:`KQ_NOTE_TRACK` | follow a process across *fork()* |
624 +----------------------------+--------------------------------------------+
625 | :const:`KQ_NOTE_CHILD` | returned on the child process for |
626 | | *NOTE_TRACK* |
627 +----------------------------+--------------------------------------------+
628 | :const:`KQ_NOTE_TRACKERR` | unable to attach to a child |
629 +----------------------------+--------------------------------------------+
630
631 :const:`KQ_FILTER_NETDEV` filter flags (not available on macOS):
632
633 +----------------------------+--------------------------------------------+
634 | Constant | Meaning |
635 +============================+============================================+
636 | :const:`KQ_NOTE_LINKUP` | link is up |
637 +----------------------------+--------------------------------------------+
638 | :const:`KQ_NOTE_LINKDOWN` | link is down |
639 +----------------------------+--------------------------------------------+
640 | :const:`KQ_NOTE_LINKINV` | link state is invalid |
641 +----------------------------+--------------------------------------------+
642
643
644 .. attribute:: kevent.data
645
646 Filter specific data.
647
648
649 .. attribute:: kevent.udata
650
651 User defined value.