From shelton@sentry.granch.ru  Mon Dec 16 06:28:40 2002
Return-Path: <shelton@sentry.granch.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 98F7C37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 16 Dec 2002 06:28:40 -0800 (PST)
Received: from sentry.granch.ru (sentry.granch.ru [212.20.5.55])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5E6B343E4A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 16 Dec 2002 06:28:39 -0800 (PST)
	(envelope-from shelton@sentry.granch.ru)
Received: from sentry.granch.ru (IDENT:smmsp@localhost.granch.ru [127.0.0.1])
	by sentry.granch.ru (8.12.6/8.12.6) with ESMTP id gBGESXE0042970
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 16 Dec 2002 20:28:33 +0600 (NOVT)
	(envelope-from shelton@sentry.granch.ru)
Received: (from root@localhost)
	by sentry.granch.ru (8.12.6/8.12.6/Submit) id gBGESXYU042969;
	Mon, 16 Dec 2002 20:28:33 +0600 (NOVT)
	(envelope-from shelton)
Message-Id: <200212161428.gBGESXYU042969@sentry.granch.ru>
Date: Mon, 16 Dec 2002 20:28:33 +0600 (NOVT)
From: "Rashid N. Achilov" <shelton@sentry.granch.ru>
Reply-To: "Rashid N. Achilov" <shelton@sentry.granch.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: correlation between HZ kernel config parameter and socket timeouts is not documented
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         46291
>Category:       docs
>Synopsis:       correlation between HZ kernel config parameter and socket timeouts is not documented
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 16 06:30:01 PST 2002
>Closed-Date:    Sat Oct 21 21:08:17 GMT 2006
>Last-Modified:  Sat Oct 21 21:08:17 GMT 2006
>Originator:     Rashid N. Achilov
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
Granch Ltd.
>Environment:
System: FreeBSD sentry.granch.ru 4.7-STABLE FreeBSD 4.7-STABLE #6: Mon Dec 9 09:59:17 NOVT 2002 shelton@sentry.granch.ru:/usr/src/sys/compile/Sentry i386
>Description:
man setsockopt(2), FreeBSD Handbook and FreeBSD FAQ have missed a correlation
between HZ kernel configuration parameter and maximal timeout, accessible to
setsockopt() function, when try to set SO_SNDTIMEO or SO_RCVTIMEO. This
correlation defined in ~sys/kern/uipc_socket.c in function sosetopt() and is
SHRT_MAX / HZ. When HZ set to 1000 (advisable to DEVICE_POLLING), maximum
timeout value shorted from 327 sec to 32 sec without any notification. Also
I think, EDOM is not suitable error code
this occassion.

>How-To-Repeat:
Include in your kernel config line

HZ = 1000

recompile kernel, reload kernel and try to set socket timeout more than 32 sec.
System replied: Numerical domain out or range. Which correlation has a math
error to socket operation?

>Fix:

Delete HZ option in kernel config file or do not use socket timeouts more than
SHRT_MAX / HZ (rounded to short int)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Sat Oct 21 21:05:47 UTC 2006 
State-Changed-Why:  
In FreeBSD 5 and later, the limit was changed to INT_MAX / HZ which 
makes it more practical with large (sane) values of HZ such as 1000. 

The EDOM is required by POSIX. 


Responsible-Changed-From-To: freebsd-doc->ru 
Responsible-Changed-By: ru 
Responsible-Changed-When: Sat Oct 21 21:05:47 UTC 2006 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=46291 
>Unformatted:
