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 October 8, 2020 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.El 350.It Dv EVFILT_WRITE 351Takes a descriptor as the identifier, and returns whenever 352it is possible to write to the descriptor. 353For sockets, pipes 354and fifos, 355.Va data 356will contain the amount of space remaining in the write buffer. 357The filter will set 358.Dv EV_EOF 359when the reader disconnects, and for the fifo case, this will be cleared 360when a new reader connects. 361Note that this filter is not supported for vnodes or BPF devices. 362.Pp 363For sockets, the low water mark and socket error handling is 364identical to the 365.Dv EVFILT_READ 366case. 367.Pp 368For eventfds, 369.Va data 370will contain the maximum value that can be added to the counter 371without blocking. 372.It Dv EVFILT_EMPTY 373Takes a descriptor as the identifier, and returns whenever 374there is no remaining data in the write buffer. 375.It Dv EVFILT_AIO 376Events for this filter are not registered with 377.Fn kevent 378directly but are registered via the 379.Va aio_sigevent 380member of an asynchronous I/O request when it is scheduled via an 381asynchronous I/O system call such as 382.Fn aio_read . 383The filter returns under the same conditions as 384.Fn aio_error . 385For more details on this filter see 386.Xr sigevent 3 and 387.Xr aio 4 . 388.It Dv EVFILT_VNODE 389Takes a file descriptor as the identifier and the events to watch for in 390.Va fflags , 391and returns when one or more of the requested events occurs on the descriptor. 392The events to monitor are: 393.Bl -tag -width "Dv NOTE_CLOSE_WRITE" 394.It Dv NOTE_ATTRIB 395The file referenced by the descriptor had its attributes changed. 396.It Dv NOTE_CLOSE 397A file descriptor referencing the monitored file, was closed. 398The closed file descriptor did not have write access. 399.It Dv NOTE_CLOSE_WRITE 400A file descriptor referencing the monitored file, was closed. 401The closed file descriptor had write access. 402.Pp 403This note, as well as 404.Dv NOTE_CLOSE , 405are not activated when files are closed forcibly by 406.Xr unmount 2 or 407.Xr revoke 2 . 408Instead, 409.Dv NOTE_REVOKE 410is sent for such events. 411.It Dv NOTE_DELETE 412The 413.Fn unlink 414system call was called on the file referenced by the descriptor. 415.It Dv NOTE_EXTEND 416For regular file, the file referenced by the descriptor was extended. 417.Pp 418For directory, reports that a directory entry was added or removed, 419as the result of rename operation. 420The 421.Dv NOTE_EXTEND 422event is not reported when a name is changed inside the directory. 423.It Dv NOTE_LINK 424The link count on the file changed. 425In particular, the 426.Dv NOTE_LINK 427event is reported if a subdirectory was created or deleted inside 428the directory referenced by the descriptor. 429.It Dv NOTE_OPEN 430The file referenced by the descriptor was opened. 431.It Dv NOTE_READ 432A read occurred on the file referenced by the descriptor. 433.It Dv NOTE_RENAME 434The file referenced by the descriptor was renamed. 435.It Dv NOTE_REVOKE 436Access to the file was revoked via 437.Xr revoke 2 438or the underlying file system was unmounted. 439.It Dv NOTE_WRITE 440A write occurred on the file referenced by the descriptor. 441.El 442.Pp 443On return, 444.Va fflags 445contains the events which triggered the filter. 446.It Dv EVFILT_PROC 447Takes the process ID to monitor as the identifier and the events to watch for 448in 449.Va fflags , 450and returns when the process performs one or more of the requested events. 451If a process can normally see another process, it can attach an event to it. 452The events to monitor are: 453.Bl -tag -width "Dv NOTE_TRACKERR" 454.It Dv NOTE_EXIT 455The process has exited. 456The exit status will be stored in 457.Va data . 458.It Dv NOTE_FORK 459The process has called 460.Fn fork . 461.It Dv NOTE_EXEC 462The process has executed a new process via 463.Xr execve 2 464or a similar call. 465.It Dv NOTE_TRACK 466Follow a process across 467.Fn fork 468calls. 469The parent process registers a new kevent to monitor the child process 470using the same 471.Va fflags 472as the original event. 473The child process will signal an event with 474.Dv NOTE_CHILD 475set in 476.Va fflags 477and the parent PID in 478.Va data . 479.Pp 480If the parent process fails to register a new kevent 481.Pq usually due to resource limitations , 482it will signal an event with 483.Dv NOTE_TRACKERR 484set in 485.Va fflags , 486and the child process will not signal a 487.Dv NOTE_CHILD 488event. 489.El 490.Pp 491On return, 492.Va fflags 493contains the events which triggered the filter. 494.It Dv EVFILT_PROCDESC 495Takes the process descriptor created by 496.Xr pdfork 2 497to monitor as the identifier and the events to watch for in 498.Va fflags , 499and returns when the associated process performs one or more of the 500requested events. 501The events to monitor are: 502.Bl -tag -width "Dv NOTE_EXIT" 503.It Dv NOTE_EXIT 504The process has exited. 505The exit status will be stored in 506.Va data . 507.El 508.Pp 509On return, 510.Va fflags 511contains the events which triggered the filter. 512.It Dv EVFILT_SIGNAL 513Takes the signal number to monitor as the identifier and returns 514when the given signal is delivered to the process. 515This coexists with the 516.Fn signal 517and 518.Fn sigaction 519facilities, and has a lower precedence. 520The filter will record 521all attempts to deliver a signal to a process, even if the signal has 522been marked as 523.Dv SIG_IGN , 524except for the 525.Dv SIGCHLD 526signal, which, if ignored, will not be recorded by the filter. 527Event notification happens after normal 528signal delivery processing. 529.Va data 530returns the number of times the signal has occurred since the last call to 531.Fn kevent . 532This filter automatically sets the 533.Dv EV_CLEAR 534flag internally. 535.It Dv EVFILT_TIMER 536Establishes an arbitrary timer identified by 537.Va ident . 538When adding a timer, 539.Va data 540specifies the moment to fire the timer (for 541.Dv NOTE_ABSTIME ) 542or the timeout period. 543The timer will be periodic unless 544.Dv EV_ONESHOT 545or 546.Dv NOTE_ABSTIME 547is specified. 548On return, 549.Va data 550contains the number of times the timeout has expired since the last call to 551.Fn kevent . 552For non-monotonic timers, this filter automatically sets the 553.Dv EV_CLEAR 554flag internally. 555.Pp 556The filter accepts the following flags in the 557.Va fflags 558argument: 559.Bl -tag -width "Dv NOTE_MSECONDS" 560.It Dv NOTE_SECONDS 561.Va data 562is in seconds. 563.It Dv NOTE_MSECONDS 564.Va data 565is in milliseconds. 566.It Dv NOTE_USECONDS 567.Va data 568is in microseconds. 569.It Dv NOTE_NSECONDS 570.Va data 571is in nanoseconds. 572.It Dv NOTE_ABSTIME 573The specified expiration time is absolute. 574.El 575.Pp 576If 577.Va fflags 578is not set, the default is milliseconds. 579On return, 580.Va fflags 581contains the events which triggered the filter. 582.Pp 583If an existing timer is re-added, the existing timer will be 584effectively canceled (throwing away any undelivered record of previous 585timer expiration) and re-started using the new parameters contained in 586.Va data 587and 588.Va fflags . 589.Pp 590There is a system wide limit on the number of timers 591which is controlled by the 592.Va kern.kq_calloutmax 593sysctl. 594.It Dv EVFILT_USER 595Establishes a user event identified by 596.Va ident 597which is not associated with any kernel mechanism but is triggered by 598user level code. 599The lower 24 bits of the 600.Va fflags 601may be used for user defined flags and manipulated using the following: 602.Bl -tag -width "Dv NOTE_FFLAGSMASK" 603.It Dv NOTE_FFNOP 604Ignore the input 605.Va fflags . 606.It Dv NOTE_FFAND 607Bitwise AND 608.Va fflags . 609.It Dv NOTE_FFOR 610Bitwise OR 611.Va fflags . 612.It Dv NOTE_FFCOPY 613Copy 614.Va fflags . 615.It Dv NOTE_FFCTRLMASK 616Control mask for 617.Va fflags . 618.It Dv NOTE_FFLAGSMASK 619User defined flag mask for 620.Va fflags . 621.El 622.Pp 623A user event is triggered for output with the following: 624.Bl -tag -width "Dv NOTE_FFLAGSMASK" 625.It Dv NOTE_TRIGGER 626Cause the event to be triggered. 627.El 628.Pp 629On return, 630.Va fflags 631contains the users defined flags in the lower 24 bits. 632.El 633.Sh CANCELLATION BEHAVIOUR 634If 635.Fa nevents 636is non-zero, i.e., the function is potentially blocking, the call 637is a cancellation point. 638Otherwise, i.e., if 639.Fa nevents 640is zero, the call is not cancellable. 641Cancellation can only occur before any changes are made to the kqueue, 642or when the call was blocked and no changes to the queue were requested. 643.Sh RETURN VALUES 644The 645.Fn kqueue 646system call 647creates a new kernel event queue and returns a file descriptor. 648If there was an error creating the kernel event queue, a value of -1 is 649returned and errno set. 650.Pp 651The 652.Fn kevent 653system call 654returns the number of events placed in the 655.Fa eventlist , 656up to the value given by 657.Fa nevents . 658If an error occurs while processing an element of the 659.Fa changelist 660and there is enough room in the 661.Fa eventlist , 662then the event will be placed in the 663.Fa eventlist 664with 665.Dv EV_ERROR 666set in 667.Va flags 668and the system error in 669.Va data . 670Otherwise, 671.Dv -1 672will be returned, and 673.Dv errno 674will be set to indicate the error condition. 675If the time limit expires, then 676.Fn kevent 677returns 0. 678.Sh EXAMPLES 679.Bd -literal -compact 680#include <sys/event.h> 681#include <err.h> 682#include <fcntl.h> 683#include <stdio.h> 684#include <stdlib.h> 685#include <string.h> 686 687int 688main(int argc, char **argv) 689{ 690 struct kevent event; /* Event we want to monitor */ 691 struct kevent tevent; /* Event triggered */ 692 int kq, fd, ret; 693 694 if (argc != 2) 695 err(EXIT_FAILURE, "Usage: %s path\en", argv[0]); 696 fd = open(argv[1], O_RDONLY); 697 if (fd == -1) 698 err(EXIT_FAILURE, "Failed to open '%s'", argv[1]); 699 700 /* Create kqueue. */ 701 kq = kqueue(); 702 if (kq == -1) 703 err(EXIT_FAILURE, "kqueue() failed"); 704 705 /* Initialize kevent structure. */ 706 EV_SET(&event, fd, EVFILT_VNODE, EV_ADD | EV_CLEAR, NOTE_WRITE, 707 0, NULL); 708 /* Attach event to the kqueue. */ 709 ret = kevent(kq, &event, 1, NULL, 0, NULL); 710 if (ret == -1) 711 err(EXIT_FAILURE, "kevent register"); 712 if (event.flags & EV_ERROR) 713 errx(EXIT_FAILURE, "Event error: %s", strerror(event.data)); 714 715 for (;;) { 716 /* Sleep until something happens. */ 717 ret = kevent(kq, NULL, 0, &tevent, 1, NULL); 718 if (ret == -1) { 719 err(EXIT_FAILURE, "kevent wait"); 720 } else if (ret > 0) { 721 printf("Something was written in '%s'\en", argv[1]); 722 } 723 } 724} 725.Ed 726.Sh ERRORS 727The 728.Fn kqueue 729system call fails if: 730.Bl -tag -width Er 731.It Bq Er ENOMEM 732The kernel failed to allocate enough memory for the kernel queue. 733.It Bq Er ENOMEM 734The 735.Dv RLIMIT_KQUEUES 736rlimit 737(see 738.Xr getrlimit 2 ) 739for the current user would be exceeded. 740.It Bq Er EMFILE 741The per-process descriptor table is full. 742.It Bq Er ENFILE 743The system file table is full. 744.El 745.Pp 746The 747.Fn kevent 748system call fails if: 749.Bl -tag -width Er 750.It Bq Er EACCES 751The process does not have permission to register a filter. 752.It Bq Er EFAULT 753There was an error reading or writing the 754.Va kevent 755structure. 756.It Bq Er EBADF 757The specified descriptor is invalid. 758.It Bq Er EINTR 759A signal was delivered before the timeout expired and before any 760events were placed on the kqueue for return. 761.It Bq Er EINTR 762A cancellation request was delivered to the thread, but not yet handled. 763.It Bq Er EINVAL 764The specified time limit or filter is invalid. 765.It Bq Er ENOENT 766The event could not be found to be modified or deleted. 767.It Bq Er ENOMEM 768No memory was available to register the event 769or, in the special case of a timer, the maximum number of 770timers has been exceeded. 771This maximum is configurable via the 772.Va kern.kq_calloutmax 773sysctl. 774.It Bq Er ESRCH 775The specified process to attach to does not exist. 776.El 777.Pp 778When 779.Fn kevent 780call fails with 781.Er EINTR 782error, all changes in the 783.Fa changelist 784have been applied. 785.Sh SEE ALSO 786.Xr aio_error 2 , 787.Xr aio_read 2 , 788.Xr aio_return 2 , 789.Xr poll 2 , 790.Xr read 2 , 791.Xr select 2 , 792.Xr sigaction 2 , 793.Xr write 2 , 794.Xr pthread_setcancelstate 3 , 795.Xr signal 3 796.Rs 797.%A Jonathan Lemon 798.%T "Kqueue: A Generic and Scalable Event Notification Facility" 799.%I USENIX Association 800.%B Proceedings of the FREENIX Track: 2001 USENIX Annual Technical Conference 801.%D June 25-30, 2001 802.\".http://www.usenix.org/event/usenix01/freenix01/full_papers/lemon/lemon.pdf 803.Re 804.Sh HISTORY 805The 806.Fn kqueue 807and 808.Fn kevent 809system calls first appeared in 810.Fx 4.1 . 811.Sh AUTHORS 812The 813.Fn kqueue 814system and this manual page were written by 815.An Jonathan Lemon Aq Mt [email protected] . 816.Sh BUGS 817The 818.Fa timeout 819value is limited to 24 hours; longer timeouts will be silently 820reinterpreted as 24 hours. 821.Pp 822In versions older than 823.Fx 12.0 , 824.In sys/event.h 825failed to parse without including 826.In sys/types.h 827manually. 828