1*01869ca4Swiz.\" $NetBSD: itimerfix.9,v 1.8 2017/07/03 21:28:48 wiz Exp $ 2796fcac2Sgmcgarry.\" 3796fcac2Sgmcgarry.\" Copyright (c) 2001 The NetBSD Foundation, Inc. 4796fcac2Sgmcgarry.\" All rights reserved. 5796fcac2Sgmcgarry.\" 6796fcac2Sgmcgarry.\" This code is derived from software contributed to The NetBSD Foundation 7796fcac2Sgmcgarry.\" by Christos Zoulas. 8796fcac2Sgmcgarry.\" 9796fcac2Sgmcgarry.\" Redistribution and use in source and binary forms, with or without 10796fcac2Sgmcgarry.\" modification, are permitted provided that the following conditions 11796fcac2Sgmcgarry.\" are met: 12796fcac2Sgmcgarry.\" 1. Redistributions of source code must retain the above copyright 13796fcac2Sgmcgarry.\" notice, this list of conditions and the following disclaimer. 14796fcac2Sgmcgarry.\" 2. Redistributions in binary form must reproduce the above copyright 15796fcac2Sgmcgarry.\" notice, this list of conditions and the following disclaimer in the 16796fcac2Sgmcgarry.\" documentation and/or other materials provided with the distribution. 17796fcac2Sgmcgarry.\" 18796fcac2Sgmcgarry.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19796fcac2Sgmcgarry.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20796fcac2Sgmcgarry.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21796fcac2Sgmcgarry.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22796fcac2Sgmcgarry.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23796fcac2Sgmcgarry.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24796fcac2Sgmcgarry.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25796fcac2Sgmcgarry.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26796fcac2Sgmcgarry.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27796fcac2Sgmcgarry.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28796fcac2Sgmcgarry.\" POSSIBILITY OF SUCH DAMAGE. 29796fcac2Sgmcgarry.\" 30796fcac2Sgmcgarry.Dd November 23, 2001 31796fcac2Sgmcgarry.Dt ITIMERFIX 9 32796fcac2Sgmcgarry.Os 33796fcac2Sgmcgarry.Sh NAME 34796fcac2Sgmcgarry.Nm itimerfix 35796fcac2Sgmcgarry.Nd check that a timeval value is valid, and correct 36796fcac2Sgmcgarry.Sh SYNOPSIS 37472351e1Swiz.In sys/time.h 38796fcac2Sgmcgarry.Ft int 39796fcac2Sgmcgarry.Fn itimerfix "struct timeval *tv" 40796fcac2Sgmcgarry.Sh DESCRIPTION 41796fcac2SgmcgarryThe 42796fcac2Sgmcgarry.Nm 43796fcac2Sgmcgarryfunction checks that the value in 44796fcac2Sgmcgarry.Fa tv 45*01869ca4Swizis valid (0 \*[Le] tv->tv_sec && 0 \*[Le] tv->tv_usec < 1000000), and that the 4616ebe506Sjdolecektotal time represented is at least one 4716ebe506Sjdolecek.Em tick , 4816ebe506Sjdolecekor zero. 49796fcac2Sgmcgarry.Pp 5016ebe506SjdolecekIf the total represented time is nonzero and smaller than tick, 515fe28dc7Sreedit is adjusted to exactly one tick. 52796fcac2Sgmcgarry.Sh RETURN VALUES 53796fcac2Sgmcgarry.Nm 54a4f28211Swizreturns 0 on success or 55a4f28211Swiz.Er EINVAL 56a4f28211Swizif 57796fcac2Sgmcgarry.Fa tv 58796fcac2Sgmcgarryis invalid. 59796fcac2Sgmcgarry.Sh SEE ALSO 60796fcac2Sgmcgarry.Xr nanosleep 2 , 61796fcac2Sgmcgarry.Xr poll 2 , 62796fcac2Sgmcgarry.Xr select 2 , 63796fcac2Sgmcgarry.Xr setitimer 2 64