xref: /freebsd-14.2/lib/libc/sys/kqueue.2 (revision d7d962ea)
1.\" Copyright (c) 2000 Jonathan Lemon
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd September 7, 2021
28.Dt KQUEUE 2
29.Os
30.Sh NAME
31.Nm kqueue ,
32.Nm kevent
33.Nd kernel event notification mechanism
34.Sh LIBRARY
35.Lb libc
36.Sh SYNOPSIS
37.In sys/event.h
38.Ft int
39.Fn kqueue "void"
40.Ft int
41.Fo kevent
42.Fa "int kq"
43.Fa "const struct kevent *changelist"
44.Fa "int nchanges"
45.Fa "struct kevent *eventlist"
46.Fa "int nevents"
47.Fa "const struct timespec *timeout"
48.Fc
49.Fn EV_SET "kev" ident filter flags fflags data udata
50.Sh DESCRIPTION
51The
52.Fn kqueue
53system call
54provides a generic method of notifying the user when an event
55happens or a condition holds, based on the results of small
56pieces of kernel code termed filters.
57A kevent is identified by the (ident, filter) pair; there may only
58be one unique kevent per kqueue.
59.Pp
60The filter is executed upon the initial registration of a kevent
61in order to detect whether a preexisting condition is present, and is also
62executed whenever an event is passed to the filter for evaluation.
63If the filter determines that the condition should be reported,
64then the kevent is placed on the kqueue for the user to retrieve.
65.Pp
66The filter is also run when the user attempts to retrieve the kevent
67from the kqueue.
68If the filter indicates that the condition that triggered
69the event no longer holds, the kevent is removed from the kqueue and
70is not returned.
71.Pp
72Multiple events which trigger the filter do not result in multiple
73kevents being placed on the kqueue; instead, the filter will aggregate
74the events into a single struct kevent.
75Calling
76.Fn close
77on a file descriptor will remove any kevents that reference the descriptor.
78.Pp
79The
80.Fn kqueue
81system call
82creates a new kernel event queue and returns a descriptor.
83The queue is not inherited by a child created with
84.Xr fork 2 .
85However, if
86.Xr rfork 2
87is called without the
88.Dv RFFDG
89flag, then the descriptor table is shared,
90which will allow sharing of the kqueue between two processes.
91.Pp
92The
93.Fn kevent
94system call
95is used to register events with the queue, and return any pending
96events to the user.
97The
98.Fa changelist
99argument
100is a pointer to an array of
101.Va kevent
102structures, as defined in
103.In sys/event.h .
104All changes contained in the
105.Fa changelist
106are applied before any pending events are read from the queue.
107The
108.Fa nchanges
109argument
110gives the size of
111.Fa changelist .
112The
113.Fa eventlist
114argument
115is a pointer to an array of kevent structures.
116The
117.Fa nevents
118argument
119determines the size of
120.Fa eventlist .
121When
122.Fa nevents
123is zero,
124.Fn kevent
125will return immediately even if there is a
126.Fa timeout
127specified unlike
128.Xr select 2 .
129If
130.Fa timeout
131is a non-NULL pointer, it specifies a maximum interval to wait
132for an event, which will be interpreted as a struct timespec.
133If
134.Fa timeout
135is a NULL pointer,
136.Fn kevent
137waits indefinitely.
138To effect a poll, the
139.Fa timeout
140argument should be non-NULL, pointing to a zero-valued
141.Va timespec
142structure.
143The same array may be used for the
144.Fa changelist
145and
146.Fa eventlist .
147.Pp
148The
149.Fn EV_SET
150macro is provided for ease of initializing a
151kevent structure.
152.Pp
153The
154.Va kevent
155structure is defined as:
156.Bd -literal
157struct kevent {
158	uintptr_t  ident;	/* identifier for this event */
159	short	  filter;	/* filter for event */
160	u_short	  flags;	/* action flags for kqueue */
161	u_int	  fflags;	/* filter flag value */
162	int64_t   data;		/* filter data value */
163	void	  *udata;	/* opaque user data identifier */
164	uint64_t  ext[4];	/* extensions */
165};
166.Ed
167.Pp
168The fields of
169.Fa struct kevent
170are:
171.Bl -tag -width "Fa filter"
172.It Fa ident
173Value used to identify this event.
174The exact interpretation is determined by the attached filter,
175but often is a file descriptor.
176.It Fa filter
177Identifies the kernel filter used to process this event.
178The pre-defined
179system filters are described below.
180.It Fa flags
181Actions to perform on the event.
182.It Fa fflags
183Filter-specific flags.
184.It Fa data
185Filter-specific data value.
186.It Fa udata
187Opaque user-defined value passed through the kernel unchanged.
188.It Fa ext
189Extended data passed to and from kernel.
190The
191.Fa ext[0]
192and
193.Fa ext[1]
194members use is defined by the filter.
195If the filter does not use them, the members are copied unchanged.
196The
197.Fa ext[2]
198and
199.Fa ext[3]
200members are always passed through the kernel as-is,
201making additional context available to application.
202.El
203.Pp
204The
205.Va flags
206field can contain the following values:
207.Bl -tag -width EV_DISPATCH
208.It Dv EV_ADD
209Adds the event to the kqueue.
210Re-adding an existing event
211will modify the parameters of the original event, and not result
212in a duplicate entry.
213Adding an event automatically enables it,
214unless overridden by the EV_DISABLE flag.
215.It Dv EV_ENABLE
216Permit
217.Fn kevent
218to return the event if it is triggered.
219.It Dv EV_DISABLE
220Disable the event so
221.Fn kevent
222will not return it.
223The filter itself is not disabled.
224.It Dv EV_DISPATCH
225Disable the event source immediately after delivery of an event.
226See
227.Dv EV_DISABLE
228above.
229.It Dv EV_DELETE
230Removes the event from the kqueue.
231Events which are attached to
232file descriptors are automatically deleted on the last close of
233the descriptor.
234.It Dv EV_RECEIPT
235This flag is useful for making bulk changes to a kqueue without draining
236any pending events.
237When passed as input, it forces
238.Dv EV_ERROR
239to always be returned.
240When a filter is successfully added the
241.Va data
242field will be zero.
243Note that if this flag is encountered and there is no remaining space in
244.Fa eventlist
245to hold the
246.Dv EV_ERROR
247event, then subsequent changes will not get processed.
248.It Dv EV_ONESHOT
249Causes the event to return only the first occurrence of the filter
250being triggered.
251After the user retrieves the event from the kqueue,
252it is deleted.
253.It Dv EV_CLEAR
254After the event is retrieved by the user, its state is reset.
255This is useful for filters which report state transitions
256instead of the current state.
257Note that some filters may automatically
258set this flag internally.
259.It Dv EV_EOF
260Filters may set this flag to indicate filter-specific EOF condition.
261.It Dv EV_ERROR
262See
263.Sx RETURN VALUES
264below.
265.El
266.Pp
267The predefined system filters are listed below.
268Arguments may be passed to and from the filter via the
269.Va fflags
270and
271.Va data
272fields in the kevent structure.
273.Bl -tag -width "Dv EVFILT_PROCDESC"
274.It Dv EVFILT_READ
275Takes a descriptor as the identifier, and returns whenever
276there is data available to read.
277The behavior of the filter is slightly different depending
278on the descriptor type.
279.Bl -tag -width 2n
280.It Sockets
281Sockets which have previously been passed to
282.Fn listen
283return when there is an incoming connection pending.
284.Va data
285contains the size of the listen backlog.
286.Pp
287Other socket descriptors return when there is data to be read,
288subject to the
289.Dv SO_RCVLOWAT
290value of the socket buffer.
291This may be overridden with a per-filter low water mark at the
292time the filter is added by setting the
293.Dv NOTE_LOWAT
294flag in
295.Va fflags ,
296and specifying the new low water mark in
297.Va data .
298On return,
299.Va data
300contains the number of bytes of protocol data available to read.
301.Pp
302If the read direction of the socket has shutdown, then the filter
303also sets
304.Dv EV_EOF
305in
306.Va flags ,
307and returns the socket error (if any) in
308.Va fflags .
309It is possible for EOF to be returned (indicating the connection is gone)
310while there is still data pending in the socket buffer.
311.It Vnodes
312Returns when the file pointer is not at the end of file.
313.Va data
314contains the offset from current position to end of file,
315and may be negative.
316.Pp
317This behavior is different from
318.Xr poll 2 ,
319where read events are triggered for regular files unconditionally.
320This event can be triggered unconditionally by setting the
321.Dv NOTE_FILE_POLL
322flag in
323.Va fflags .
324.It "Fifos, Pipes"
325Returns when the there is data to read;
326.Va data
327contains the number of bytes available.
328.Pp
329When the last writer disconnects, the filter will set
330.Dv EV_EOF
331in
332.Va flags .
333This will be cleared by the filter when a new writer connects,
334at which point the
335filter will resume waiting for data to become available before
336returning.
337.It "BPF devices"
338Returns when the BPF buffer is full, the BPF timeout has expired, or
339when the BPF has
340.Dq immediate mode
341enabled and there is any data to read;
342.Va data
343contains the number of bytes available.
344.It Eventfds
345Returns when the counter is greater than 0;
346.Va data
347contains the counter value, which must be cast to
348.Vt uint64_t .
349.It Kqueues
350Returns when pending events are present on the queue;
351.Va data
352contains the number of events available.
353.El
354.It Dv EVFILT_WRITE
355Takes a descriptor as the identifier, and returns whenever
356it is possible to write to the descriptor.
357For sockets, pipes
358and fifos,
359.Va data
360will contain the amount of space remaining in the write buffer.
361The filter will set
362.Dv EV_EOF
363when the reader disconnects, and for the fifo case, this will be cleared
364when a new reader connects.
365Note that this filter is not supported for vnodes or BPF devices.
366.Pp
367For sockets, the low water mark and socket error handling is
368identical to the
369.Dv EVFILT_READ
370case.
371.Pp
372For eventfds,
373.Va data
374will contain the maximum value that can be added to the counter
375without blocking.
376.It Dv EVFILT_EMPTY
377Takes a descriptor as the identifier, and returns whenever
378there is no remaining data in the write buffer.
379.It Dv EVFILT_AIO
380Events for this filter are not registered with
381.Fn kevent
382directly but are registered via the
383.Va aio_sigevent
384member of an asynchronous I/O request when it is scheduled via an
385asynchronous I/O system call such as
386.Fn aio_read .
387The filter returns under the same conditions as
388.Fn aio_error .
389For more details on this filter see
390.Xr sigevent 3 and
391.Xr aio 4 .
392.It Dv EVFILT_VNODE
393Takes a file descriptor as the identifier and the events to watch for in
394.Va fflags ,
395and returns when one or more of the requested events occurs on the descriptor.
396The events to monitor are:
397.Bl -tag -width "Dv NOTE_CLOSE_WRITE"
398.It Dv NOTE_ATTRIB
399The file referenced by the descriptor had its attributes changed.
400.It Dv NOTE_CLOSE
401A file descriptor referencing the monitored file, was closed.
402The closed file descriptor did not have write access.
403.It Dv NOTE_CLOSE_WRITE
404A file descriptor referencing the monitored file, was closed.
405The closed file descriptor had write access.
406.Pp
407This note, as well as
408.Dv NOTE_CLOSE ,
409are not activated when files are closed forcibly by
410.Xr unmount 2 or
411.Xr revoke 2 .
412Instead,
413.Dv NOTE_REVOKE
414is sent for such events.
415.It Dv NOTE_DELETE
416The
417.Fn unlink
418system call was called on the file referenced by the descriptor.
419.It Dv NOTE_EXTEND
420For regular file, the file referenced by the descriptor was extended.
421.Pp
422For directory, reports that a directory entry was added or removed,
423as the result of rename operation.
424The
425.Dv NOTE_EXTEND
426event is not reported when a name is changed inside the directory.
427.It Dv NOTE_LINK
428The link count on the file changed.
429In particular, the
430.Dv NOTE_LINK
431event is reported if a subdirectory was created or deleted inside
432the directory referenced by the descriptor.
433.It Dv NOTE_OPEN
434The file referenced by the descriptor was opened.
435.It Dv NOTE_READ
436A read occurred on the file referenced by the descriptor.
437.It Dv NOTE_RENAME
438The file referenced by the descriptor was renamed.
439.It Dv NOTE_REVOKE
440Access to the file was revoked via
441.Xr revoke 2
442or the underlying file system was unmounted.
443.It Dv NOTE_WRITE
444A write occurred on the file referenced by the descriptor.
445.El
446.Pp
447On return,
448.Va fflags
449contains the events which triggered the filter.
450.It Dv EVFILT_PROC
451Takes the process ID to monitor as the identifier and the events to watch for
452in
453.Va fflags ,
454and returns when the process performs one or more of the requested events.
455If a process can normally see another process, it can attach an event to it.
456The events to monitor are:
457.Bl -tag -width "Dv NOTE_TRACKERR"
458.It Dv NOTE_EXIT
459The process has exited.
460The exit status will be stored in
461.Va data .
462.It Dv NOTE_FORK
463The process has called
464.Fn fork .
465.It Dv NOTE_EXEC
466The process has executed a new process via
467.Xr execve 2
468or a similar call.
469.It Dv NOTE_TRACK
470Follow a process across
471.Fn fork
472calls.
473The parent process registers a new kevent to monitor the child process
474using the same
475.Va fflags
476as the original event.
477The child process will signal an event with
478.Dv NOTE_CHILD
479set in
480.Va fflags
481and the parent PID in
482.Va data .
483.Pp
484If the parent process fails to register a new kevent
485.Pq usually due to resource limitations ,
486it will signal an event with
487.Dv NOTE_TRACKERR
488set in
489.Va fflags ,
490and the child process will not signal a
491.Dv NOTE_CHILD
492event.
493.El
494.Pp
495On return,
496.Va fflags
497contains the events which triggered the filter.
498.It Dv EVFILT_PROCDESC
499Takes the process descriptor created by
500.Xr pdfork 2
501to monitor as the identifier and the events to watch for in
502.Va fflags ,
503and returns when the associated process performs one or more of the
504requested events.
505The events to monitor are:
506.Bl -tag -width "Dv NOTE_EXIT"
507.It Dv NOTE_EXIT
508The process has exited.
509The exit status will be stored in
510.Va data .
511.El
512.Pp
513On return,
514.Va fflags
515contains the events which triggered the filter.
516.It Dv EVFILT_SIGNAL
517Takes the signal number to monitor as the identifier and returns
518when the given signal is delivered to the process.
519This coexists with the
520.Fn signal
521and
522.Fn sigaction
523facilities, and has a lower precedence.
524The filter will record
525all attempts to deliver a signal to a process, even if the signal has
526been marked as
527.Dv SIG_IGN ,
528except for the
529.Dv SIGCHLD
530signal, which, if ignored, will not be recorded by the filter.
531Event notification happens after normal
532signal delivery processing.
533.Va data
534returns the number of times the signal has occurred since the last call to
535.Fn kevent .
536This filter automatically sets the
537.Dv EV_CLEAR
538flag internally.
539.It Dv EVFILT_TIMER
540Establishes an arbitrary timer identified by
541.Va ident .
542When adding a timer,
543.Va data
544specifies the moment to fire the timer (for
545.Dv NOTE_ABSTIME )
546or the timeout period.
547The timer will be periodic unless
548.Dv EV_ONESHOT
549or
550.Dv NOTE_ABSTIME
551is specified.
552On return,
553.Va data
554contains the number of times the timeout has expired since the last call to
555.Fn kevent .
556For non-monotonic timers, this filter automatically sets the
557.Dv EV_CLEAR
558flag internally.
559.Pp
560The filter accepts the following flags in the
561.Va fflags
562argument:
563.Bl -tag -width "Dv NOTE_MSECONDS"
564.It Dv NOTE_SECONDS
565.Va data
566is in seconds.
567.It Dv NOTE_MSECONDS
568.Va data
569is in milliseconds.
570.It Dv NOTE_USECONDS
571.Va data
572is in microseconds.
573.It Dv NOTE_NSECONDS
574.Va data
575is in nanoseconds.
576.It Dv NOTE_ABSTIME
577The specified expiration time is absolute.
578.El
579.Pp
580If
581.Va fflags
582is not set, the default is milliseconds.
583On return,
584.Va fflags
585contains the events which triggered the filter.
586.Pp
587If an existing timer is re-added, the existing timer will be
588effectively canceled (throwing away any undelivered record of previous
589timer expiration) and re-started using the new parameters contained in
590.Va data
591and
592.Va fflags .
593.Pp
594There is a system wide limit on the number of timers
595which is controlled by the
596.Va kern.kq_calloutmax
597sysctl.
598.It Dv EVFILT_USER
599Establishes a user event identified by
600.Va ident
601which is not associated with any kernel mechanism but is triggered by
602user level code.
603The lower 24 bits of the
604.Va fflags
605may be used for user defined flags and manipulated using the following:
606.Bl -tag -width "Dv NOTE_FFLAGSMASK"
607.It Dv NOTE_FFNOP
608Ignore the input
609.Va fflags .
610.It Dv NOTE_FFAND
611Bitwise AND
612.Va fflags .
613.It Dv NOTE_FFOR
614Bitwise OR
615.Va fflags .
616.It Dv NOTE_FFCOPY
617Copy
618.Va fflags .
619.It Dv NOTE_FFCTRLMASK
620Control mask for
621.Va fflags .
622.It Dv NOTE_FFLAGSMASK
623User defined flag mask for
624.Va fflags .
625.El
626.Pp
627A user event is triggered for output with the following:
628.Bl -tag -width "Dv NOTE_FFLAGSMASK"
629.It Dv NOTE_TRIGGER
630Cause the event to be triggered.
631.El
632.Pp
633On return,
634.Va fflags
635contains the users defined flags in the lower 24 bits.
636.El
637.Sh CANCELLATION BEHAVIOUR
638If
639.Fa nevents
640is non-zero, i.e., the function is potentially blocking, the call
641is a cancellation point.
642Otherwise, i.e., if
643.Fa nevents
644is zero, the call is not cancellable.
645Cancellation can only occur before any changes are made to the kqueue,
646or when the call was blocked and no changes to the queue were requested.
647.Sh RETURN VALUES
648The
649.Fn kqueue
650system call
651creates a new kernel event queue and returns a file descriptor.
652If there was an error creating the kernel event queue, a value of -1 is
653returned and errno set.
654.Pp
655The
656.Fn kevent
657system call
658returns the number of events placed in the
659.Fa eventlist ,
660up to the value given by
661.Fa nevents .
662If an error occurs while processing an element of the
663.Fa changelist
664and there is enough room in the
665.Fa eventlist ,
666then the event will be placed in the
667.Fa eventlist
668with
669.Dv EV_ERROR
670set in
671.Va flags
672and the system error in
673.Va data .
674Otherwise,
675.Dv -1
676will be returned, and
677.Dv errno
678will be set to indicate the error condition.
679If the time limit expires, then
680.Fn kevent
681returns 0.
682.Sh EXAMPLES
683.Bd -literal -compact
684#include <sys/event.h>
685#include <err.h>
686#include <fcntl.h>
687#include <stdio.h>
688#include <stdlib.h>
689#include <string.h>
690
691int
692main(int argc, char **argv)
693{
694    struct kevent event;    /* Event we want to monitor */
695    struct kevent tevent;   /* Event triggered */
696    int kq, fd, ret;
697
698    if (argc != 2)
699	err(EXIT_FAILURE, "Usage: %s path\en", argv[0]);
700    fd = open(argv[1], O_RDONLY);
701    if (fd == -1)
702	err(EXIT_FAILURE, "Failed to open '%s'", argv[1]);
703
704    /* Create kqueue. */
705    kq = kqueue();
706    if (kq == -1)
707	err(EXIT_FAILURE, "kqueue() failed");
708
709    /* Initialize kevent structure. */
710    EV_SET(&event, fd, EVFILT_VNODE, EV_ADD | EV_CLEAR, NOTE_WRITE,
711	0, NULL);
712    /* Attach event to the kqueue. */
713    ret = kevent(kq, &event, 1, NULL, 0, NULL);
714    if (ret == -1)
715	err(EXIT_FAILURE, "kevent register");
716    if (event.flags & EV_ERROR)
717	errx(EXIT_FAILURE, "Event error: %s", strerror(event.data));
718
719    for (;;) {
720	/* Sleep until something happens. */
721	ret = kevent(kq, NULL, 0, &tevent, 1, NULL);
722	if (ret == -1) {
723	    err(EXIT_FAILURE, "kevent wait");
724	} else if (ret > 0) {
725	    printf("Something was written in '%s'\en", argv[1]);
726	}
727    }
728}
729.Ed
730.Sh ERRORS
731The
732.Fn kqueue
733system call fails if:
734.Bl -tag -width Er
735.It Bq Er ENOMEM
736The kernel failed to allocate enough memory for the kernel queue.
737.It Bq Er ENOMEM
738The
739.Dv RLIMIT_KQUEUES
740rlimit
741(see
742.Xr getrlimit 2 )
743for the current user would be exceeded.
744.It Bq Er EMFILE
745The per-process descriptor table is full.
746.It Bq Er ENFILE
747The system file table is full.
748.El
749.Pp
750The
751.Fn kevent
752system call fails if:
753.Bl -tag -width Er
754.It Bq Er EACCES
755The process does not have permission to register a filter.
756.It Bq Er EFAULT
757There was an error reading or writing the
758.Va kevent
759structure.
760.It Bq Er EBADF
761The specified descriptor is invalid.
762.It Bq Er EINTR
763A signal was delivered before the timeout expired and before any
764events were placed on the kqueue for return.
765.It Bq Er EINTR
766A cancellation request was delivered to the thread, but not yet handled.
767.It Bq Er EINVAL
768The specified time limit or filter is invalid.
769.It Bq Er EINVAL
770The specified length of the event or change lists is negative.
771.It Bq Er ENOENT
772The event could not be found to be modified or deleted.
773.It Bq Er ENOMEM
774No memory was available to register the event
775or, in the special case of a timer, the maximum number of
776timers has been exceeded.
777This maximum is configurable via the
778.Va kern.kq_calloutmax
779sysctl.
780.It Bq Er ESRCH
781The specified process to attach to does not exist.
782.El
783.Pp
784When
785.Fn kevent
786call fails with
787.Er EINTR
788error, all changes in the
789.Fa changelist
790have been applied.
791.Sh SEE ALSO
792.Xr aio_error 2 ,
793.Xr aio_read 2 ,
794.Xr aio_return 2 ,
795.Xr poll 2 ,
796.Xr read 2 ,
797.Xr select 2 ,
798.Xr sigaction 2 ,
799.Xr write 2 ,
800.Xr pthread_setcancelstate 3 ,
801.Xr signal 3
802.Rs
803.%A Jonathan Lemon
804.%T "Kqueue: A Generic and Scalable Event Notification Facility"
805.%I USENIX Association
806.%B Proceedings of the FREENIX Track: 2001 USENIX Annual Technical Conference
807.%D June 25-30, 2001
808.\".http://www.usenix.org/event/usenix01/freenix01/full_papers/lemon/lemon.pdf
809.Re
810.Sh HISTORY
811The
812.Fn kqueue
813and
814.Fn kevent
815system calls first appeared in
816.Fx 4.1 .
817.Sh AUTHORS
818The
819.Fn kqueue
820system and this manual page were written by
821.An Jonathan Lemon Aq Mt [email protected] .
822.Sh BUGS
823The
824.Fa timeout
825value is limited to 24 hours; longer timeouts will be silently
826reinterpreted as 24 hours.
827.Pp
828In versions older than
829.Fx 12.0 ,
830.In sys/event.h
831failed to parse without including
832.In sys/types.h
833manually.
834