*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: ppsratecheck | Section: 9 | Source: FreeBSD | File: ppsratecheck.9.gz
RATECHECK(9) FreeBSD Kernel Developer's Manual RATECHECK(9) NAME ratecheck, ppsratecheck - event rate limiting SYNOPSIS #include <sys/time.h> int ratecheck(struct timeval *lasttime, const struct timeval *mininterval); int ppsratecheck(struct timeval *lasttime, int *curpps, int maxpps); DESCRIPTION The ratecheck and ppsratecheck functions facilitate rate-limiting of arbitrary events. The former enforces a minimum interval between events while the latter enforces a maximum number of events per second. The ratecheck function compares the current time to the value pointed to by lasttime. If the difference is equal to or greater than mininterval, it returns a non-zero value and updates lasttime to the current time. Otherwise, it returns zero. The ppsratecheck function first compares the current time to lasttime. If at least a full second has passed, the value pointed to by the curpps argument is reset to 1 and lasttime is updated to the current time. Otherwise, curpps is incremented and lasttime is left untouched. In either case, ppsratecheck returns a non-zero value if and only if the updated curpps is less than or equal to maxpps or maxpps is negative. SEE ALSO counter(9) HISTORY The ratecheck and ppsratecheck functions first appeared in FreeBSD 5.1. FreeBSD 14.1-RELEASE-p8 March 11, 2022 FreeBSD 14.1-RELEASE-p8

Navigation Options