blob: a4bc6fc1e9303e18292ea043c10c927580c07185 [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001:mod:`select` --- Waiting for I/O completion
2============================================
3
4.. module:: select
5 :synopsis: Wait for I/O completion on multiple streams.
6
7
Georg Brandl60203b42010-10-06 10:11:56 +00008This module provides access to the :c:func:`select` and :c:func:`poll` functions
9available in most operating systems, :c:func:`epoll` available on Linux 2.5+ and
10:c:func:`kqueue` available on most BSD.
Christian Heimes4fbc72b2008-03-22 00:47:35 +000011Note that on Windows, it only works for sockets; on other operating systems,
12it also works for other file types (in particular, on Unix, it works on pipes).
13It cannot be used on regular files to determine whether a file has grown since
14it was last read.
Georg Brandl116aa622007-08-15 14:28:22 +000015
16The module defines the following:
17
18
19.. exception:: error
20
Antoine Pitrou9b7fcf82011-10-12 16:23:02 +020021 A deprecated alias of :exc:`OSError`.
22
23 .. versionchanged:: 3.3
24 Following :pep:`3151`, this class was made an alias of :exc:`OSError`.
Georg Brandl116aa622007-08-15 14:28:22 +000025
26
Georg Brandl18244152009-09-02 20:34:52 +000027.. function:: epoll(sizehint=-1)
Christian Heimes4fbc72b2008-03-22 00:47:35 +000028
Christian Heimesfe337bf2008-03-23 21:54:12 +000029 (Only supported on Linux 2.5.44 and newer.) Returns an edge polling object,
30 which can be used as Edge or Level Triggered interface for I/O events; see
31 section :ref:`epoll-objects` below for the methods supported by epolling
32 objects.
Christian Heimes4fbc72b2008-03-22 00:47:35 +000033
Christian Heimes4fbc72b2008-03-22 00:47:35 +000034
Georg Brandl116aa622007-08-15 14:28:22 +000035.. function:: poll()
36
37 (Not supported by all operating systems.) Returns a polling object, which
38 supports registering and unregistering file descriptors, and then polling them
39 for I/O events; see section :ref:`poll-objects` below for the methods supported
40 by polling objects.
41
42
Christian Heimesfe337bf2008-03-23 21:54:12 +000043.. function:: kqueue()
Christian Heimes4fbc72b2008-03-22 00:47:35 +000044
Georg Brandle767e042010-07-14 08:00:22 +000045 (Only supported on BSD.) Returns a kernel queue object; see section
Christian Heimesfe337bf2008-03-23 21:54:12 +000046 :ref:`kqueue-objects` below for the methods supported by kqueue objects.
Christian Heimes4fbc72b2008-03-22 00:47:35 +000047
Christian Heimes4fbc72b2008-03-22 00:47:35 +000048
Benjamin Peterson1baf4652009-12-31 03:11:23 +000049.. function:: kevent(ident, filter=KQ_FILTER_READ, flags=KQ_EV_ADD, fflags=0, data=0, udata=0)
Christian Heimes4fbc72b2008-03-22 00:47:35 +000050
Georg Brandle767e042010-07-14 08:00:22 +000051 (Only supported on BSD.) Returns a kernel event object; see section
52 :ref:`kevent-objects` below for the methods supported by kevent objects.
Christian Heimes4fbc72b2008-03-22 00:47:35 +000053
Christian Heimes4fbc72b2008-03-22 00:47:35 +000054
Georg Brandl734e2682008-08-12 08:18:18 +000055.. function:: select(rlist, wlist, xlist[, timeout])
Georg Brandl116aa622007-08-15 14:28:22 +000056
Georg Brandl60203b42010-10-06 10:11:56 +000057 This is a straightforward interface to the Unix :c:func:`select` system call.
Georg Brandl116aa622007-08-15 14:28:22 +000058 The first three arguments are sequences of 'waitable objects': either
59 integers representing file descriptors or objects with a parameterless method
Georg Brandl734e2682008-08-12 08:18:18 +000060 named :meth:`fileno` returning such an integer:
61
62 * *rlist*: wait until ready for reading
63 * *wlist*: wait until ready for writing
64 * *xlist*: wait for an "exceptional condition" (see the manual page for what
65 your system considers such a condition)
66
67 Empty sequences are allowed, but acceptance of three empty sequences is
68 platform-dependent. (It is known to work on Unix but not on Windows.) The
69 optional *timeout* argument specifies a time-out as a floating point number
70 in seconds. When the *timeout* argument is omitted the function blocks until
71 at least one file descriptor is ready. A time-out value of zero specifies a
72 poll and never blocks.
Georg Brandl116aa622007-08-15 14:28:22 +000073
74 The return value is a triple of lists of objects that are ready: subsets of the
75 first three arguments. When the time-out is reached without a file descriptor
76 becoming ready, three empty lists are returned.
77
78 .. index::
79 single: socket() (in module socket)
80 single: popen() (in module os)
81
Antoine Pitrou11cb9612010-09-15 11:11:28 +000082 Among the acceptable object types in the sequences are Python :term:`file
83 objects <file object>` (e.g. ``sys.stdin``, or objects returned by
84 :func:`open` or :func:`os.popen`), socket objects returned by
85 :func:`socket.socket`. You may also define a :dfn:`wrapper` class yourself,
86 as long as it has an appropriate :meth:`fileno` method (that really returns
87 a file descriptor, not just a random integer).
Georg Brandl116aa622007-08-15 14:28:22 +000088
Georg Brandl116aa622007-08-15 14:28:22 +000089 .. note::
90
91 .. index:: single: WinSock
92
Georg Brandl734e2682008-08-12 08:18:18 +000093 File objects on Windows are not acceptable, but sockets are. On Windows,
Georg Brandl60203b42010-10-06 10:11:56 +000094 the underlying :c:func:`select` function is provided by the WinSock
Georg Brandl734e2682008-08-12 08:18:18 +000095 library, and does not handle file descriptors that don't originate from
96 WinSock.
Georg Brandl116aa622007-08-15 14:28:22 +000097
Antoine Pitroucfad97b2011-01-25 17:24:57 +000098.. attribute:: PIPE_BUF
Gregory P. Smithb970b862009-07-04 02:28:47 +000099
Antoine Pitrouda7be3e2011-01-25 16:28:44 +0000100 The minimum number of bytes which can be written without blocking to a pipe
101 when the pipe has been reported as ready for writing by :func:`select`,
102 :func:`poll` or another interface in this module. This doesn't apply
103 to other kind of file-like objects such as sockets.
104
Amaury Forgeot d'Arcace31022009-07-09 22:44:11 +0000105 This value is guaranteed by POSIX to be at least 512. Availability: Unix.
Gregory P. Smithb970b862009-07-04 02:28:47 +0000106
Mark Dickinson574b1d62009-10-01 20:20:09 +0000107 .. versionadded:: 3.2
Gregory P. Smithb970b862009-07-04 02:28:47 +0000108
Georg Brandl116aa622007-08-15 14:28:22 +0000109
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000110.. _epoll-objects:
111
112Edge and Level Trigger Polling (epoll) Objects
113----------------------------------------------
114
115 http://linux.die.net/man/4/epoll
116
117 *eventmask*
118
119 +-----------------------+-----------------------------------------------+
120 | Constant | Meaning |
121 +=======================+===============================================+
122 | :const:`EPOLLIN` | Available for read |
123 +-----------------------+-----------------------------------------------+
124 | :const:`EPOLLOUT` | Available for write |
125 +-----------------------+-----------------------------------------------+
126 | :const:`EPOLLPRI` | Urgent data for read |
127 +-----------------------+-----------------------------------------------+
Christian Heimes5e696852008-04-09 08:37:03 +0000128 | :const:`EPOLLERR` | Error condition happened on the assoc. fd |
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000129 +-----------------------+-----------------------------------------------+
Christian Heimes5e696852008-04-09 08:37:03 +0000130 | :const:`EPOLLHUP` | Hang up happened on the assoc. fd |
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000131 +-----------------------+-----------------------------------------------+
132 | :const:`EPOLLET` | Set Edge Trigger behavior, the default is |
133 | | Level Trigger behavior |
134 +-----------------------+-----------------------------------------------+
135 | :const:`EPOLLONESHOT` | Set one-shot behavior. After one event is |
136 | | pulled out, the fd is internally disabled |
137 +-----------------------+-----------------------------------------------+
Jean-Paul Calderone7f54dce2010-07-18 16:30:31 +0000138 | :const:`EPOLLRDNORM` | Equivalent to :const:`EPOLLIN` |
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000139 +-----------------------+-----------------------------------------------+
Jean-Paul Calderone7f54dce2010-07-18 16:30:31 +0000140 | :const:`EPOLLRDBAND` | Priority data band can be read. |
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000141 +-----------------------+-----------------------------------------------+
Jean-Paul Calderone7f54dce2010-07-18 16:30:31 +0000142 | :const:`EPOLLWRNORM` | Equivalent to :const:`EPOLLOUT` |
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000143 +-----------------------+-----------------------------------------------+
Jean-Paul Calderone7f54dce2010-07-18 16:30:31 +0000144 | :const:`EPOLLWRBAND` | Priority data may be written. |
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000145 +-----------------------+-----------------------------------------------+
Jean-Paul Calderone7f54dce2010-07-18 16:30:31 +0000146 | :const:`EPOLLMSG` | Ignored. |
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000147 +-----------------------+-----------------------------------------------+
148
149
150.. method:: epoll.close()
151
152 Close the control file descriptor of the epoll object.
153
154
155.. method:: epoll.fileno()
156
157 Return the file descriptor number of the control fd.
158
159
160.. method:: epoll.fromfd(fd)
161
162 Create an epoll object from a given file descriptor.
163
164
165.. method:: epoll.register(fd[, eventmask])
166
167 Register a fd descriptor with the epoll object.
168
169
170.. method:: epoll.modify(fd, eventmask)
171
172 Modify a register file descriptor.
173
174
175.. method:: epoll.unregister(fd)
176
177 Remove a registered file descriptor from the epoll object.
178
179
180.. method:: epoll.poll([timeout=-1[, maxevents=-1]])
181
182 Wait for events. timeout in seconds (float)
183
184
Georg Brandl116aa622007-08-15 14:28:22 +0000185.. _poll-objects:
186
187Polling Objects
188---------------
189
Georg Brandl60203b42010-10-06 10:11:56 +0000190The :c:func:`poll` system call, supported on most Unix systems, provides better
Georg Brandl116aa622007-08-15 14:28:22 +0000191scalability for network servers that service many, many clients at the same
Georg Brandl60203b42010-10-06 10:11:56 +0000192time. :c:func:`poll` scales better because the system call only requires listing
193the file descriptors of interest, while :c:func:`select` builds a bitmap, turns
Georg Brandl116aa622007-08-15 14:28:22 +0000194on bits for the fds of interest, and then afterward the whole bitmap has to be
Georg Brandl60203b42010-10-06 10:11:56 +0000195linearly scanned again. :c:func:`select` is O(highest file descriptor), while
196:c:func:`poll` is O(number of file descriptors).
Georg Brandl116aa622007-08-15 14:28:22 +0000197
198
199.. method:: poll.register(fd[, eventmask])
200
201 Register a file descriptor with the polling object. Future calls to the
202 :meth:`poll` method will then check whether the file descriptor has any pending
203 I/O events. *fd* can be either an integer, or an object with a :meth:`fileno`
204 method that returns an integer. File objects implement :meth:`fileno`, so they
205 can also be used as the argument.
206
207 *eventmask* is an optional bitmask describing the type of events you want to
208 check for, and can be a combination of the constants :const:`POLLIN`,
209 :const:`POLLPRI`, and :const:`POLLOUT`, described in the table below. If not
210 specified, the default value used will check for all 3 types of events.
211
212 +-------------------+------------------------------------------+
213 | Constant | Meaning |
214 +===================+==========================================+
215 | :const:`POLLIN` | There is data to read |
216 +-------------------+------------------------------------------+
217 | :const:`POLLPRI` | There is urgent data to read |
218 +-------------------+------------------------------------------+
219 | :const:`POLLOUT` | Ready for output: writing will not block |
220 +-------------------+------------------------------------------+
221 | :const:`POLLERR` | Error condition of some sort |
222 +-------------------+------------------------------------------+
223 | :const:`POLLHUP` | Hung up |
224 +-------------------+------------------------------------------+
225 | :const:`POLLNVAL` | Invalid request: descriptor not open |
226 +-------------------+------------------------------------------+
227
228 Registering a file descriptor that's already registered is not an error, and has
229 the same effect as registering the descriptor exactly once.
230
231
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000232.. method:: poll.modify(fd, eventmask)
233
234 Modifies an already registered fd. This has the same effect as
Jean-Paul Calderone7f94f392010-07-18 16:13:27 +0000235 ``register(fd, eventmask)``. Attempting to modify a file descriptor
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000236 that was never registered causes an :exc:`IOError` exception with errno
237 :const:`ENOENT` to be raised.
238
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000239
Georg Brandl116aa622007-08-15 14:28:22 +0000240.. method:: poll.unregister(fd)
241
242 Remove a file descriptor being tracked by a polling object. Just like the
243 :meth:`register` method, *fd* can be an integer or an object with a
244 :meth:`fileno` method that returns an integer.
245
246 Attempting to remove a file descriptor that was never registered causes a
247 :exc:`KeyError` exception to be raised.
248
249
250.. method:: poll.poll([timeout])
251
252 Polls the set of registered file descriptors, and returns a possibly-empty list
253 containing ``(fd, event)`` 2-tuples for the descriptors that have events or
254 errors to report. *fd* is the file descriptor, and *event* is a bitmask with
255 bits set for the reported events for that descriptor --- :const:`POLLIN` for
256 waiting input, :const:`POLLOUT` to indicate that the descriptor can be written
257 to, and so forth. An empty list indicates that the call timed out and no file
258 descriptors had any events to report. If *timeout* is given, it specifies the
259 length of time in milliseconds which the system will wait for events before
260 returning. If *timeout* is omitted, negative, or :const:`None`, the call will
261 block until there is an event for this poll object.
262
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000263
264.. _kqueue-objects:
265
266Kqueue Objects
267--------------
268
269.. method:: kqueue.close()
270
271 Close the control file descriptor of the kqueue object.
272
273
274.. method:: kqueue.fileno()
275
276 Return the file descriptor number of the control fd.
277
278
Benjamin Peterson9bc93512008-09-22 22:10:59 +0000279.. method:: kqueue.fromfd(fd)
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000280
281 Create a kqueue object from a given file descriptor.
282
283
Benjamin Peterson9bc93512008-09-22 22:10:59 +0000284.. method:: kqueue.control(changelist, max_events[, timeout=None]) -> eventlist
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000285
286 Low level interface to kevent
287
288 - changelist must be an iterable of kevent object or None
289 - max_events must be 0 or a positive integer
290 - timeout in seconds (floats possible)
291
292
293.. _kevent-objects:
294
295Kevent Objects
296--------------
297
Christian Heimesfe337bf2008-03-23 21:54:12 +0000298http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000299
Christian Heimesfe337bf2008-03-23 21:54:12 +0000300.. attribute:: kevent.ident
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000301
302 Value used to identify the event. The interpretation depends on the filter
303 but it's usually the file descriptor. In the constructor ident can either
304 be an int or an object with a fileno() function. kevent stores the integer
305 internally.
306
Christian Heimesfe337bf2008-03-23 21:54:12 +0000307.. attribute:: kevent.filter
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000308
Georg Brandl1b5ab452009-08-13 07:56:35 +0000309 Name of the kernel filter.
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000310
311 +---------------------------+---------------------------------------------+
312 | Constant | Meaning |
313 +===========================+=============================================+
314 | :const:`KQ_FILTER_READ` | Takes a descriptor and returns whenever |
315 | | there is data available to read |
316 +---------------------------+---------------------------------------------+
317 | :const:`KQ_FILTER_WRITE` | Takes a descriptor and returns whenever |
Georg Brandl1b5ab452009-08-13 07:56:35 +0000318 | | there is data available to write |
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000319 +---------------------------+---------------------------------------------+
320 | :const:`KQ_FILTER_AIO` | AIO requests |
321 +---------------------------+---------------------------------------------+
322 | :const:`KQ_FILTER_VNODE` | Returns when one or more of the requested |
323 | | events watched in *fflag* occurs |
324 +---------------------------+---------------------------------------------+
325 | :const:`KQ_FILTER_PROC` | Watch for events on a process id |
326 +---------------------------+---------------------------------------------+
327 | :const:`KQ_FILTER_NETDEV` | Watch for events on a network device |
328 | | [not available on Mac OS X] |
329 +---------------------------+---------------------------------------------+
330 | :const:`KQ_FILTER_SIGNAL` | Returns whenever the watched signal is |
331 | | delivered to the process |
332 +---------------------------+---------------------------------------------+
333 | :const:`KQ_FILTER_TIMER` | Establishes an arbitrary timer |
334 +---------------------------+---------------------------------------------+
335
Christian Heimesfe337bf2008-03-23 21:54:12 +0000336.. attribute:: kevent.flags
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000337
Georg Brandl1b5ab452009-08-13 07:56:35 +0000338 Filter action.
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000339
340 +---------------------------+---------------------------------------------+
341 | Constant | Meaning |
342 +===========================+=============================================+
343 | :const:`KQ_EV_ADD` | Adds or modifies an event |
344 +---------------------------+---------------------------------------------+
345 | :const:`KQ_EV_DELETE` | Removes an event from the queue |
346 +---------------------------+---------------------------------------------+
347 | :const:`KQ_EV_ENABLE` | Permitscontrol() to returns the event |
348 +---------------------------+---------------------------------------------+
349 | :const:`KQ_EV_DISABLE` | Disablesevent |
350 +---------------------------+---------------------------------------------+
Georg Brandl2ee470f2008-07-16 12:55:28 +0000351 | :const:`KQ_EV_ONESHOT` | Removes event after first occurrence |
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000352 +---------------------------+---------------------------------------------+
353 | :const:`KQ_EV_CLEAR` | Reset the state after an event is retrieved |
354 +---------------------------+---------------------------------------------+
355 | :const:`KQ_EV_SYSFLAGS` | internal event |
356 +---------------------------+---------------------------------------------+
357 | :const:`KQ_EV_FLAG1` | internal event |
358 +---------------------------+---------------------------------------------+
359 | :const:`KQ_EV_EOF` | Filter specific EOF condition |
360 +---------------------------+---------------------------------------------+
361 | :const:`KQ_EV_ERROR` | See return values |
362 +---------------------------+---------------------------------------------+
363
364
Christian Heimesfe337bf2008-03-23 21:54:12 +0000365.. attribute:: kevent.fflags
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000366
Georg Brandl1b5ab452009-08-13 07:56:35 +0000367 Filter specific flags.
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000368
Georg Brandl1b5ab452009-08-13 07:56:35 +0000369 :const:`KQ_FILTER_READ` and :const:`KQ_FILTER_WRITE` filter flags:
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000370
371 +----------------------------+--------------------------------------------+
372 | Constant | Meaning |
373 +============================+============================================+
374 | :const:`KQ_NOTE_LOWAT` | low water mark of a socket buffer |
375 +----------------------------+--------------------------------------------+
376
Georg Brandl1b5ab452009-08-13 07:56:35 +0000377 :const:`KQ_FILTER_VNODE` filter flags:
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000378
379 +----------------------------+--------------------------------------------+
380 | Constant | Meaning |
381 +============================+============================================+
382 | :const:`KQ_NOTE_DELETE` | *unlink()* was called |
383 +----------------------------+--------------------------------------------+
Georg Brandl2ee470f2008-07-16 12:55:28 +0000384 | :const:`KQ_NOTE_WRITE` | a write occurred |
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000385 +----------------------------+--------------------------------------------+
386 | :const:`KQ_NOTE_EXTEND` | the file was extended |
387 +----------------------------+--------------------------------------------+
388 | :const:`KQ_NOTE_ATTRIB` | an attribute was changed |
389 +----------------------------+--------------------------------------------+
390 | :const:`KQ_NOTE_LINK` | the link count has changed |
391 +----------------------------+--------------------------------------------+
392 | :const:`KQ_NOTE_RENAME` | the file was renamed |
393 +----------------------------+--------------------------------------------+
394 | :const:`KQ_NOTE_REVOKE` | access to the file was revoked |
395 +----------------------------+--------------------------------------------+
396
Georg Brandl1b5ab452009-08-13 07:56:35 +0000397 :const:`KQ_FILTER_PROC` filter flags:
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000398
399 +----------------------------+--------------------------------------------+
400 | Constant | Meaning |
401 +============================+============================================+
402 | :const:`KQ_NOTE_EXIT` | the process has exited |
403 +----------------------------+--------------------------------------------+
404 | :const:`KQ_NOTE_FORK` | the process has called *fork()* |
405 +----------------------------+--------------------------------------------+
406 | :const:`KQ_NOTE_EXEC` | the process has executed a new process |
407 +----------------------------+--------------------------------------------+
408 | :const:`KQ_NOTE_PCTRLMASK` | internal filter flag |
409 +----------------------------+--------------------------------------------+
410 | :const:`KQ_NOTE_PDATAMASK` | internal filter flag |
411 +----------------------------+--------------------------------------------+
412 | :const:`KQ_NOTE_TRACK` | follow a process across *fork()* |
413 +----------------------------+--------------------------------------------+
414 | :const:`KQ_NOTE_CHILD` | returned on the child process for |
415 | | *NOTE_TRACK* |
416 +----------------------------+--------------------------------------------+
417 | :const:`KQ_NOTE_TRACKERR` | unable to attach to a child |
418 +----------------------------+--------------------------------------------+
419
Georg Brandl1b5ab452009-08-13 07:56:35 +0000420 :const:`KQ_FILTER_NETDEV` filter flags (not available on Mac OS X):
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000421
422 +----------------------------+--------------------------------------------+
423 | Constant | Meaning |
424 +============================+============================================+
425 | :const:`KQ_NOTE_LINKUP` | link is up |
426 +----------------------------+--------------------------------------------+
427 | :const:`KQ_NOTE_LINKDOWN` | link is down |
428 +----------------------------+--------------------------------------------+
429 | :const:`KQ_NOTE_LINKINV` | link state is invalid |
430 +----------------------------+--------------------------------------------+
431
432
Christian Heimesfe337bf2008-03-23 21:54:12 +0000433.. attribute:: kevent.data
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000434
Georg Brandl1b5ab452009-08-13 07:56:35 +0000435 Filter specific data.
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000436
437
Christian Heimesfe337bf2008-03-23 21:54:12 +0000438.. attribute:: kevent.udata
Christian Heimes4fbc72b2008-03-22 00:47:35 +0000439
Georg Brandl1b5ab452009-08-13 07:56:35 +0000440 User defined value.