1*bb75b0d5SLexi Winter/* 2*bb75b0d5SLexi Winter * SPDX-License-Identifier: BSD-2-Clause 3*bb75b0d5SLexi Winter * 4*bb75b0d5SLexi Winter * Copyright (c)1996-2006 by Hartmut Brandt 5*bb75b0d5SLexi Winter * All rights reserved. 6*bb75b0d5SLexi Winter * 7*bb75b0d5SLexi Winter * Author: harti@freebsd.org <Hartmut Brandt> 8*bb75b0d5SLexi Winter * 9*bb75b0d5SLexi Winter * Redistribution of this software and documentation and use in source and 10*bb75b0d5SLexi Winter * binary forms, with or without modification, are permitted provided that 11*bb75b0d5SLexi Winter * the following conditions are met: 12*bb75b0d5SLexi Winter * 13*bb75b0d5SLexi Winter * 1. Redistributions of source code or documentation must retain the above 14*bb75b0d5SLexi Winter * copyright notice, this list of conditions and the following disclaimer. 15*bb75b0d5SLexi Winter * 2. Redistributions in binary form must reproduce the above copyright 16*bb75b0d5SLexi Winter * notice, this list of conditions and the following disclaimer in the 17*bb75b0d5SLexi Winter * documentation and/or other materials provided with the distribution. 18*bb75b0d5SLexi Winter * 19*bb75b0d5SLexi Winter * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE AUTHOR 20*bb75b0d5SLexi Winter * AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 21*bb75b0d5SLexi Winter * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 22*bb75b0d5SLexi Winter * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 23*bb75b0d5SLexi Winter * THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 24*bb75b0d5SLexi Winter * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25*bb75b0d5SLexi Winter * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 26*bb75b0d5SLexi Winter * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27*bb75b0d5SLexi Winter * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28*bb75b0d5SLexi Winter * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29*bb75b0d5SLexi Winter * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30*bb75b0d5SLexi Winter */ 31*bb75b0d5SLexi Winter 32*bb75b0d5SLexi Wintercomment = "rpoll(3) interface for event-driven I/O" 33*bb75b0d5SLexi Winter 34*bb75b0d5SLexi Winterdesc = <<EOD 35*bb75b0d5SLexi Winterlibbegemot provides rpoll(3), a simplified interface for handling event-driven 36*bb75b0d5SLexi WinterI/O programming. 37*bb75b0d5SLexi Winter 38*bb75b0d5SLexi WinterMany programs need to read from several file descriptors at the same time. 39*bb75b0d5SLexi WinterTypically in these programs one of select(2) or poll(2) is used. These 40*bb75b0d5SLexi Wintercalls are however clumsy to use and the usage of one of these calls is 41*bb75b0d5SLexi Winterprobably not portable to other systems - not all systems support both calls. 42*bb75b0d5SLexi Winter 43*bb75b0d5SLexi WinterThe rpoll(3) family of functions is designed to overcome these restrictions. 44*bb75b0d5SLexi WinterThey support the well known and understood technique of event driven 45*bb75b0d5SLexi Winterprogramming and, in addition to select(2) and poll(2) also support timers. 46*bb75b0d5SLexi WinterEOD 47