ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.3
(Generate patch)

Comparing libev/ev.3 (file contents):
Revision 1.109 by root, Fri Dec 21 07:03:02 2018 UTC vs.
Revision 1.110 by root, Thu Jun 20 22:44:59 2019 UTC

1.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) 1.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
2.\" 2.\"
3.\" Standard preamble: 3.\" Standard preamble:
4.\" ======================================================================== 4.\" ========================================================================
5.de Sp \" Vertical space (when we can't use .PP) 5.de Sp \" Vertical space (when we can't use .PP)
6.if t .sp .5v 6.if t .sp .5v
44.\" 44.\"
45.\" Escape single quotes in literal strings from groff's Unicode transform. 45.\" Escape single quotes in literal strings from groff's Unicode transform.
46.ie \n(.g .ds Aq \(aq 46.ie \n(.g .ds Aq \(aq
47.el .ds Aq ' 47.el .ds Aq '
48.\" 48.\"
49.\" If the F register is turned on, we'll generate index entries on stderr for 49.\" If the F register is >0, we'll generate index entries on stderr for
50.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index 50.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51.\" entries marked with X<> in POD. Of course, you'll have to process the 51.\" entries marked with X<> in POD. Of course, you'll have to process the
52.\" output yourself in some meaningful fashion. 52.\" output yourself in some meaningful fashion.
53.\" 53.\"
54.\" Avoid warning from groff about undefined register 'F'. 54.\" Avoid warning from groff about undefined register 'F'.
55.de IX 55.de IX
56.. 56..
57.nr rF 0 57.nr rF 0
58.if \n(.g .if rF .nr rF 1 58.if \n(.g .if rF .nr rF 1
59.if (\n(rF:(\n(.g==0)) \{ 59.if (\n(rF:(\n(.g==0)) \{\
60. if \nF \{ 60. if \nF \{\
61. de IX 61. de IX
62. tm Index:\\$1\t\\n%\t"\\$2" 62. tm Index:\\$1\t\\n%\t"\\$2"
63.. 63..
64. if !\nF==2 \{ 64. if !\nF==2 \{\
65. nr % 0 65. nr % 0
66. nr F 2 66. nr F 2
67. \} 67. \}
68. \} 68. \}
69.\} 69.\}
131.\} 131.\}
132.rm #[ #] #H #V #F C 132.rm #[ #] #H #V #F C
133.\" ======================================================================== 133.\" ========================================================================
134.\" 134.\"
135.IX Title "LIBEV 3" 135.IX Title "LIBEV 3"
136.TH LIBEV 3 "2018-12-21" "libev-4.25" "libev - high performance full featured event loop" 136.TH LIBEV 3 "2019-06-20" "libev-4.25" "libev - high performance full featured event loop"
137.\" For nroff, turn off justification. Always turn off hyphenation; it makes 137.\" For nroff, turn off justification. Always turn off hyphenation; it makes
138.\" way too many mistakes in technical documents. 138.\" way too many mistakes in technical documents.
139.if n .ad l 139.if n .ad l
140.nh 140.nh
141.SH "NAME" 141.SH "NAME"
392.Sp 392.Sp
393You could override this function in high-availability programs to, say, 393You could override this function in high-availability programs to, say,
394free some memory if it cannot allocate memory, to use a special allocator, 394free some memory if it cannot allocate memory, to use a special allocator,
395or even to sleep a while and retry until some memory is available. 395or even to sleep a while and retry until some memory is available.
396.Sp 396.Sp
397Example: The following is the \f(CW\*(C`realloc\*(C'\fR function that libev itself uses
398which should work with \f(CW\*(C`realloc\*(C'\fR and \f(CW\*(C`free\*(C'\fR functions of all kinds and
399is probably a good basis for your own implementation.
400.Sp
401.Vb 5
402\& static void *
403\& ev_realloc_emul (void *ptr, long size) EV_NOEXCEPT
404\& {
405\& if (size)
406\& return realloc (ptr, size);
407\&
408\& free (ptr);
409\& return 0;
410\& }
411.Ve
412.Sp
397Example: Replace the libev allocator with one that waits a bit and then 413Example: Replace the libev allocator with one that waits a bit and then
398retries (example requires a standards-compliant \f(CW\*(C`realloc\*(C'\fR). 414retries.
399.Sp 415.Sp
400.Vb 6 416.Vb 8
401\& static void * 417\& static void *
402\& persistent_realloc (void *ptr, size_t size) 418\& persistent_realloc (void *ptr, size_t size)
403\& { 419\& {
420\& if (!size)
421\& {
422\& free (ptr);
423\& return 0;
424\& }
425\&
404\& for (;;) 426\& for (;;)
405\& { 427\& {
406\& void *newptr = realloc (ptr, size); 428\& void *newptr = realloc (ptr, size);
407\& 429\&
408\& if (newptr) 430\& if (newptr)
585.Sp 607.Sp
586This flag's behaviour will become the default in future versions of libev. 608This flag's behaviour will become the default in future versions of libev.
587.ie n .IP """EVBACKEND_SELECT"" (value 1, portable select backend)" 4 609.ie n .IP """EVBACKEND_SELECT"" (value 1, portable select backend)" 4
588.el .IP "\f(CWEVBACKEND_SELECT\fR (value 1, portable select backend)" 4 610.el .IP "\f(CWEVBACKEND_SELECT\fR (value 1, portable select backend)" 4
589.IX Item "EVBACKEND_SELECT (value 1, portable select backend)" 611.IX Item "EVBACKEND_SELECT (value 1, portable select backend)"
590This is your standard \fIselect\fR\|(2) backend. Not \fIcompletely\fR standard, as 612This is your standard \fBselect\fR\|(2) backend. Not \fIcompletely\fR standard, as
591libev tries to roll its own fd_set with no limits on the number of fds, 613libev tries to roll its own fd_set with no limits on the number of fds,
592but if that fails, expect a fairly low limit on the number of fds when 614but if that fails, expect a fairly low limit on the number of fds when
593using this backend. It doesn't scale too well (O(highest_fd)), but its 615using this backend. It doesn't scale too well (O(highest_fd)), but its
594usually the fastest backend for a low number of (low-numbered :) fds. 616usually the fastest backend for a low number of (low-numbered :) fds.
595.Sp 617.Sp
604\&\f(CW\*(C`writefds\*(C'\fR set (and to work around Microsoft Windows bugs, also onto the 626\&\f(CW\*(C`writefds\*(C'\fR set (and to work around Microsoft Windows bugs, also onto the
605\&\f(CW\*(C`exceptfds\*(C'\fR set on that platform). 627\&\f(CW\*(C`exceptfds\*(C'\fR set on that platform).
606.ie n .IP """EVBACKEND_POLL"" (value 2, poll backend, available everywhere except on windows)" 4 628.ie n .IP """EVBACKEND_POLL"" (value 2, poll backend, available everywhere except on windows)" 4
607.el .IP "\f(CWEVBACKEND_POLL\fR (value 2, poll backend, available everywhere except on windows)" 4 629.el .IP "\f(CWEVBACKEND_POLL\fR (value 2, poll backend, available everywhere except on windows)" 4
608.IX Item "EVBACKEND_POLL (value 2, poll backend, available everywhere except on windows)" 630.IX Item "EVBACKEND_POLL (value 2, poll backend, available everywhere except on windows)"
609And this is your standard \fIpoll\fR\|(2) backend. It's more complicated 631And this is your standard \fBpoll\fR\|(2) backend. It's more complicated
610than select, but handles sparse fds better and has no artificial 632than select, but handles sparse fds better and has no artificial
611limit on the number of fds you can use (except it will slow down 633limit on the number of fds you can use (except it will slow down
612considerably with a lot of inactive fds). It scales similarly to select, 634considerably with a lot of inactive fds). It scales similarly to select,
613i.e. O(total_fds). See the entry for \f(CW\*(C`EVBACKEND_SELECT\*(C'\fR, above, for 635i.e. O(total_fds). See the entry for \f(CW\*(C`EVBACKEND_SELECT\*(C'\fR, above, for
614performance tips. 636performance tips.
616This backend maps \f(CW\*(C`EV_READ\*(C'\fR to \f(CW\*(C`POLLIN | POLLERR | POLLHUP\*(C'\fR, and 638This backend maps \f(CW\*(C`EV_READ\*(C'\fR to \f(CW\*(C`POLLIN | POLLERR | POLLHUP\*(C'\fR, and
617\&\f(CW\*(C`EV_WRITE\*(C'\fR to \f(CW\*(C`POLLOUT | POLLERR | POLLHUP\*(C'\fR. 639\&\f(CW\*(C`EV_WRITE\*(C'\fR to \f(CW\*(C`POLLOUT | POLLERR | POLLHUP\*(C'\fR.
618.ie n .IP """EVBACKEND_EPOLL"" (value 4, Linux)" 4 640.ie n .IP """EVBACKEND_EPOLL"" (value 4, Linux)" 4
619.el .IP "\f(CWEVBACKEND_EPOLL\fR (value 4, Linux)" 4 641.el .IP "\f(CWEVBACKEND_EPOLL\fR (value 4, Linux)" 4
620.IX Item "EVBACKEND_EPOLL (value 4, Linux)" 642.IX Item "EVBACKEND_EPOLL (value 4, Linux)"
621Use the linux-specific \fIepoll\fR\|(7) interface (for both pre\- and post\-2.6.9 643Use the linux-specific \fBepoll\fR\|(7) interface (for both pre\- and post\-2.6.9
622kernels). 644kernels).
623.Sp 645.Sp
624For few fds, this backend is a bit little slower than poll and select, but 646For few fds, this backend is a bit little slower than poll and select, but
625it scales phenomenally better. While poll and select usually scale like 647it scales phenomenally better. While poll and select usually scale like
626O(total_fds) where total_fds is the total number of fds (or the highest 648O(total_fds) where total_fds is the total number of fds (or the highest
1365bug in your program. 1387bug in your program.
1366.Sp 1388.Sp
1367Libev will usually signal a few \*(L"dummy\*(R" events together with an error, for 1389Libev will usually signal a few \*(L"dummy\*(R" events together with an error, for
1368example it might indicate that a fd is readable or writable, and if your 1390example it might indicate that a fd is readable or writable, and if your
1369callbacks is well-written it can just attempt the operation and cope with 1391callbacks is well-written it can just attempt the operation and cope with
1370the error from \fIread()\fR or \fIwrite()\fR. This will not work in multi-threaded 1392the error from \fBread()\fR or \fBwrite()\fR. This will not work in multi-threaded
1371programs, though, as the fd could already be closed and reused for another 1393programs, though, as the fd could already be closed and reused for another
1372thing, so beware. 1394thing, so beware.
1373.SS "\s-1GENERIC WATCHER FUNCTIONS\s0" 1395.SS "\s-1GENERIC WATCHER FUNCTIONS\s0"
1374.IX Subsection "GENERIC WATCHER FUNCTIONS" 1396.IX Subsection "GENERIC WATCHER FUNCTIONS"
1375.ie n .IP """ev_init"" (ev_TYPE *watcher, callback)" 4 1397.ie n .IP """ev_init"" (ev_TYPE *watcher, callback)" 4
1811when writing to a pipe whose other end has been closed, your program gets 1833when writing to a pipe whose other end has been closed, your program gets
1812sent a \s-1SIGPIPE,\s0 which, by default, aborts your program. For most programs 1834sent a \s-1SIGPIPE,\s0 which, by default, aborts your program. For most programs
1813this is sensible behaviour, for daemons, this is usually undesirable. 1835this is sensible behaviour, for daemons, this is usually undesirable.
1814.PP 1836.PP
1815So when you encounter spurious, unexplained daemon exits, make sure you 1837So when you encounter spurious, unexplained daemon exits, make sure you
1816ignore \s-1SIGPIPE \s0(and maybe make sure you log the exit status of your daemon 1838ignore \s-1SIGPIPE\s0 (and maybe make sure you log the exit status of your daemon
1817somewhere, as that would have given you a big clue). 1839somewhere, as that would have given you a big clue).
1818.PP 1840.PP
1819\fIThe special problem of \fIaccept()\fIing when you can't\fR 1841\fIThe special problem of \f(BIaccept()\fIing when you can't\fR
1820.IX Subsection "The special problem of accept()ing when you can't" 1842.IX Subsection "The special problem of accept()ing when you can't"
1821.PP 1843.PP
1822Many implementations of the \s-1POSIX \s0\f(CW\*(C`accept\*(C'\fR function (for example, 1844Many implementations of the \s-1POSIX\s0 \f(CW\*(C`accept\*(C'\fR function (for example,
1823found in post\-2004 Linux) have the peculiar behaviour of not removing a 1845found in post\-2004 Linux) have the peculiar behaviour of not removing a
1824connection from the pending queue in all error cases. 1846connection from the pending queue in all error cases.
1825.PP 1847.PP
1826For example, larger servers often run out of file descriptors (because 1848For example, larger servers often run out of file descriptors (because
1827of resource limits), causing \f(CW\*(C`accept\*(C'\fR to fail with \f(CW\*(C`ENFILE\*(C'\fR but not 1849of resource limits), causing \f(CW\*(C`accept\*(C'\fR to fail with \f(CW\*(C`ENFILE\*(C'\fR but not
2434In this mode the values for \f(CW\*(C`interval\*(C'\fR and \f(CW\*(C`offset\*(C'\fR are both being 2456In this mode the values for \f(CW\*(C`interval\*(C'\fR and \f(CW\*(C`offset\*(C'\fR are both being
2435ignored. Instead, each time the periodic watcher gets scheduled, the 2457ignored. Instead, each time the periodic watcher gets scheduled, the
2436reschedule callback will be called with the watcher as first, and the 2458reschedule callback will be called with the watcher as first, and the
2437current time as second argument. 2459current time as second argument.
2438.Sp 2460.Sp
2439\&\s-1NOTE: \s0\fIThis callback \s-1MUST NOT\s0 stop or destroy any periodic watcher, ever, 2461\&\s-1NOTE:\s0 \fIThis callback \s-1MUST NOT\s0 stop or destroy any periodic watcher, ever,
2440or make \s-1ANY\s0 other event loop modifications whatsoever, unless explicitly 2462or make \s-1ANY\s0 other event loop modifications whatsoever, unless explicitly
2441allowed by documentation here\fR. 2463allowed by documentation here\fR.
2442.Sp 2464.Sp
2443If you need to stop it, return \f(CW\*(C`now + 1e30\*(C'\fR (or so, fudge fudge) and stop 2465If you need to stop it, return \f(CW\*(C`now + 1e30\*(C'\fR (or so, fudge fudge) and stop
2444it afterwards (e.g. by starting an \f(CW\*(C`ev_prepare\*(C'\fR watcher, which is the 2466it afterwards (e.g. by starting an \f(CW\*(C`ev_prepare\*(C'\fR watcher, which is the
2458It must return the next time to trigger, based on the passed time value 2480It must return the next time to trigger, based on the passed time value
2459(that is, the lowest time value larger than to the second argument). It 2481(that is, the lowest time value larger than to the second argument). It
2460will usually be called just before the callback will be triggered, but 2482will usually be called just before the callback will be triggered, but
2461might be called at other times, too. 2483might be called at other times, too.
2462.Sp 2484.Sp
2463\&\s-1NOTE: \s0\fIThis callback must always return a time that is higher than or 2485\&\s-1NOTE:\s0 \fIThis callback must always return a time that is higher than or
2464equal to the passed \f(CI\*(C`now\*(C'\fI value\fR. 2486equal to the passed \f(CI\*(C`now\*(C'\fI value\fR.
2465.Sp 2487.Sp
2466This can be used to create very complex timers, such as a timer that 2488This can be used to create very complex timers, such as a timer that
2467triggers on \*(L"next midnight, local time\*(R". To do this, you would calculate 2489triggers on \*(L"next midnight, local time\*(R". To do this, you would calculate
2468the next midnight after \f(CW\*(C`now\*(C'\fR and return the timestamp value for 2490the next midnight after \f(CW\*(C`now\*(C'\fR and return the timestamp value for
2613The simplest way to ensure that the signal mask is reset in the child is 2635The simplest way to ensure that the signal mask is reset in the child is
2614to install a fork handler with \f(CW\*(C`pthread_atfork\*(C'\fR that resets it. That will 2636to install a fork handler with \f(CW\*(C`pthread_atfork\*(C'\fR that resets it. That will
2615catch fork calls done by libraries (such as the libc) as well. 2637catch fork calls done by libraries (such as the libc) as well.
2616.PP 2638.PP
2617In current versions of libev, the signal will not be blocked indefinitely 2639In current versions of libev, the signal will not be blocked indefinitely
2618unless you use the \f(CW\*(C`signalfd\*(C'\fR \s-1API \s0(\f(CW\*(C`EV_SIGNALFD\*(C'\fR). While this reduces 2640unless you use the \f(CW\*(C`signalfd\*(C'\fR \s-1API\s0 (\f(CW\*(C`EV_SIGNALFD\*(C'\fR). While this reduces
2619the window of opportunity for problems, it will not go away, as libev 2641the window of opportunity for problems, it will not go away, as libev
2620\&\fIhas\fR to modify the signal mask, at least temporarily. 2642\&\fIhas\fR to modify the signal mask, at least temporarily.
2621.PP 2643.PP
2622So I can't stress this enough: \fIIf you do not reset your signal mask when 2644So I can't stress this enough: \fIIf you do not reset your signal mask when
2623you expect it to be empty, you have a race condition in your code\fR. This 2645you expect it to be empty, you have a race condition in your code\fR. This
4518\& #include "ev.c" 4540\& #include "ev.c"
4519.Ve 4541.Ve
4520.PP 4542.PP
4521This will automatically include \fIev.h\fR, too, and should be done in a 4543This will automatically include \fIev.h\fR, too, and should be done in a
4522single C source file only to provide the function implementations. To use 4544single C source file only to provide the function implementations. To use
4523it, do the same for \fIev.h\fR in all files wishing to use this \s-1API \s0(best 4545it, do the same for \fIev.h\fR in all files wishing to use this \s-1API\s0 (best
4524done by writing a wrapper around \fIev.h\fR that you can include instead and 4546done by writing a wrapper around \fIev.h\fR that you can include instead and
4525where you can put other configuration options): 4547where you can put other configuration options):
4526.PP 4548.PP
4527.Vb 2 4549.Vb 2
4528\& #define EV_STANDALONE 1 4550\& #define EV_STANDALONE 1
4601values when compiling libev vs. including \fIev.h\fR, so it is permissible 4623values when compiling libev vs. including \fIev.h\fR, so it is permissible
4602to redefine them before including \fIev.h\fR without breaking compatibility 4624to redefine them before including \fIev.h\fR without breaking compatibility
4603to a compiled library. All other symbols change the \s-1ABI,\s0 which means all 4625to a compiled library. All other symbols change the \s-1ABI,\s0 which means all
4604users of libev and the libev code itself must be compiled with compatible 4626users of libev and the libev code itself must be compiled with compatible
4605settings. 4627settings.
4606.IP "\s-1EV_COMPAT3 \s0(h)" 4 4628.IP "\s-1EV_COMPAT3\s0 (h)" 4
4607.IX Item "EV_COMPAT3 (h)" 4629.IX Item "EV_COMPAT3 (h)"
4608Backwards compatibility is a major concern for libev. This is why this 4630Backwards compatibility is a major concern for libev. This is why this
4609release of libev comes with wrappers for the functions and symbols that 4631release of libev comes with wrappers for the functions and symbols that
4610have been renamed between libev version 3 and 4. 4632have been renamed between libev version 3 and 4.
4611.Sp 4633.Sp
4616typedef in that case. 4638typedef in that case.
4617.Sp 4639.Sp
4618In some future version, the default for \f(CW\*(C`EV_COMPAT3\*(C'\fR will become \f(CW0\fR, 4640In some future version, the default for \f(CW\*(C`EV_COMPAT3\*(C'\fR will become \f(CW0\fR,
4619and in some even more future version the compatibility code will be 4641and in some even more future version the compatibility code will be
4620removed completely. 4642removed completely.
4621.IP "\s-1EV_STANDALONE \s0(h)" 4 4643.IP "\s-1EV_STANDALONE\s0 (h)" 4
4622.IX Item "EV_STANDALONE (h)" 4644.IX Item "EV_STANDALONE (h)"
4623Must always be \f(CW1\fR if you do not use autoconf configuration, which 4645Must always be \f(CW1\fR if you do not use autoconf configuration, which
4624keeps libev from including \fIconfig.h\fR, and it also defines dummy 4646keeps libev from including \fIconfig.h\fR, and it also defines dummy
4625implementations for some libevent functions (such as logging, which is not 4647implementations for some libevent functions (such as logging, which is not
4626supported). It will also not define any of the structs usually found in 4648supported). It will also not define any of the structs usually found in
4784handler \*(L"locking\*(R" as well as for signal and thread safety in \f(CW\*(C`ev_async\*(C'\fR 4806handler \*(L"locking\*(R" as well as for signal and thread safety in \f(CW\*(C`ev_async\*(C'\fR
4785watchers. 4807watchers.
4786.Sp 4808.Sp
4787In the absence of this define, libev will use \f(CW\*(C`sig_atomic_t volatile\*(C'\fR 4809In the absence of this define, libev will use \f(CW\*(C`sig_atomic_t volatile\*(C'\fR
4788(from \fIsignal.h\fR), which is usually good enough on most platforms. 4810(from \fIsignal.h\fR), which is usually good enough on most platforms.
4789.IP "\s-1EV_H \s0(h)" 4 4811.IP "\s-1EV_H\s0 (h)" 4
4790.IX Item "EV_H (h)" 4812.IX Item "EV_H (h)"
4791The name of the \fIev.h\fR header file used to include it. The default if 4813The name of the \fIev.h\fR header file used to include it. The default if
4792undefined is \f(CW"ev.h"\fR in \fIevent.h\fR, \fIev.c\fR and \fIev++.h\fR. This can be 4814undefined is \f(CW"ev.h"\fR in \fIevent.h\fR, \fIev.c\fR and \fIev++.h\fR. This can be
4793used to virtually rename the \fIev.h\fR header file in case of conflicts. 4815used to virtually rename the \fIev.h\fR header file in case of conflicts.
4794.IP "\s-1EV_CONFIG_H \s0(h)" 4 4816.IP "\s-1EV_CONFIG_H\s0 (h)" 4
4795.IX Item "EV_CONFIG_H (h)" 4817.IX Item "EV_CONFIG_H (h)"
4796If \f(CW\*(C`EV_STANDALONE\*(C'\fR isn't \f(CW1\fR, this variable can be used to override 4818If \f(CW\*(C`EV_STANDALONE\*(C'\fR isn't \f(CW1\fR, this variable can be used to override
4797\&\fIev.c\fR's idea of where to find the \fIconfig.h\fR file, similarly to 4819\&\fIev.c\fR's idea of where to find the \fIconfig.h\fR file, similarly to
4798\&\f(CW\*(C`EV_H\*(C'\fR, above. 4820\&\f(CW\*(C`EV_H\*(C'\fR, above.
4799.IP "\s-1EV_EVENT_H \s0(h)" 4 4821.IP "\s-1EV_EVENT_H\s0 (h)" 4
4800.IX Item "EV_EVENT_H (h)" 4822.IX Item "EV_EVENT_H (h)"
4801Similarly to \f(CW\*(C`EV_H\*(C'\fR, this macro can be used to override \fIevent.c\fR's idea 4823Similarly to \f(CW\*(C`EV_H\*(C'\fR, this macro can be used to override \fIevent.c\fR's idea
4802of how the \fIevent.h\fR header can be found, the default is \f(CW"event.h"\fR. 4824of how the \fIevent.h\fR header can be found, the default is \f(CW"event.h"\fR.
4803.IP "\s-1EV_PROTOTYPES \s0(h)" 4 4825.IP "\s-1EV_PROTOTYPES\s0 (h)" 4
4804.IX Item "EV_PROTOTYPES (h)" 4826.IX Item "EV_PROTOTYPES (h)"
4805If defined to be \f(CW0\fR, then \fIev.h\fR will not define any function 4827If defined to be \f(CW0\fR, then \fIev.h\fR will not define any function
4806prototypes, but still define all the structs and other symbols. This is 4828prototypes, but still define all the structs and other symbols. This is
4807occasionally useful if you want to provide your own wrapper functions 4829occasionally useful if you want to provide your own wrapper functions
4808around libev functions. 4830around libev functions.
5017.Vb 3 5039.Vb 3
5018\& #define EV_COMMON \e 5040\& #define EV_COMMON \e
5019\& SV *self; /* contains this struct */ \e 5041\& SV *self; /* contains this struct */ \e
5020\& SV *cb_sv, *fh /* note no trailing ";" */ 5042\& SV *cb_sv, *fh /* note no trailing ";" */
5021.Ve 5043.Ve
5022.IP "\s-1EV_CB_DECLARE \s0(type)" 4 5044.IP "\s-1EV_CB_DECLARE\s0 (type)" 4
5023.IX Item "EV_CB_DECLARE (type)" 5045.IX Item "EV_CB_DECLARE (type)"
5024.PD 0 5046.PD 0
5025.IP "\s-1EV_CB_INVOKE \s0(watcher, revents)" 4 5047.IP "\s-1EV_CB_INVOKE\s0 (watcher, revents)" 4
5026.IX Item "EV_CB_INVOKE (watcher, revents)" 5048.IX Item "EV_CB_INVOKE (watcher, revents)"
5027.IP "ev_set_cb (ev, cb)" 4 5049.IP "ev_set_cb (ev, cb)" 4
5028.IX Item "ev_set_cb (ev, cb)" 5050.IX Item "ev_set_cb (ev, cb)"
5029.PD 5051.PD
5030Can be used to change the callback member declaration in each watcher, 5052Can be used to change the callback member declaration in each watcher,
5033their default definitions. One possible use for overriding these is to 5055their default definitions. One possible use for overriding these is to
5034avoid the \f(CW\*(C`struct ev_loop *\*(C'\fR as first argument in all cases, or to use 5056avoid the \f(CW\*(C`struct ev_loop *\*(C'\fR as first argument in all cases, or to use
5035method calls instead of plain function calls in \*(C+. 5057method calls instead of plain function calls in \*(C+.
5036.SS "\s-1EXPORTED API SYMBOLS\s0" 5058.SS "\s-1EXPORTED API SYMBOLS\s0"
5037.IX Subsection "EXPORTED API SYMBOLS" 5059.IX Subsection "EXPORTED API SYMBOLS"
5038If you need to re-export the \s-1API \s0(e.g. via a \s-1DLL\s0) and you need a list of 5060If you need to re-export the \s-1API\s0 (e.g. via a \s-1DLL\s0) and you need a list of
5039exported symbols, you can use the provided \fISymbol.*\fR files which list 5061exported symbols, you can use the provided \fISymbol.*\fR files which list
5040all public symbols, one per line: 5062all public symbols, one per line:
5041.PP 5063.PP
5042.Vb 2 5064.Vb 2
5043\& Symbols.ev for libev proper 5065\& Symbols.ev for libev proper
5275.PP 5297.PP
5276\fI\f(CI\*(C`select\*(C'\fI is buggy\fR 5298\fI\f(CI\*(C`select\*(C'\fI is buggy\fR
5277.IX Subsection "select is buggy" 5299.IX Subsection "select is buggy"
5278.PP 5300.PP
5279All that's left is \f(CW\*(C`select\*(C'\fR, and of course Apple found a way to fuck this 5301All that's left is \f(CW\*(C`select\*(C'\fR, and of course Apple found a way to fuck this
5280one up as well: On \s-1OS/X, \s0\f(CW\*(C`select\*(C'\fR actively limits the number of file 5302one up as well: On \s-1OS/X,\s0 \f(CW\*(C`select\*(C'\fR actively limits the number of file
5281descriptors you can pass in to 1024 \- your program suddenly crashes when 5303descriptors you can pass in to 1024 \- your program suddenly crashes when
5282you use more. 5304you use more.
5283.PP 5305.PP
5284There is an undocumented \*(L"workaround\*(R" for this \- defining 5306There is an undocumented \*(L"workaround\*(R" for this \- defining
5285\&\f(CW\*(C`_DARWIN_UNLIMITED_SELECT\*(C'\fR, which libev tries to use, so select \fIshould\fR 5307\&\f(CW\*(C`_DARWIN_UNLIMITED_SELECT\*(C'\fR, which libev tries to use, so select \fIshould\fR

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines