Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 1996 23:53:25 -0800 (PST)
From:      sameer <sameer@c2.net>
To:        freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org
Subject:   getdtablesize, OPEN_MAX, and sysctl
Message-ID:  <199612130753.XAA11862@clotho.c2.org>

next in thread | raw e-mail | index | archive | help
	So I have a machine (2.1-STABLE) with OPEN_MAX set to 256.
When I do sysctl -a kern.maxfiles is 2088. Is there a relationship
between OPEN_MAX and something that shows up in sysctl?
	I have this program, where if I do a getdtablesize (or
sysconf(SC_OPEN_MAX)) it returns 256 at program startup, but returns
*258* on a getdtablesize() call further on in execution. (Right before
a select(), which then subsequently fails with EINVAL) Anyone know how
the getdtablesize() result could have changed by two?

	I have another machine (2.1-STABLE) with OPEN_MAX of
1024. sysctl kern.maxfiles is 2088. getdtablesize() returns 1024 on
program startup and 1026 right before that select call.

	I have yet another machine (2.1.5-RELEASE) with a default
OPEN_MAX. kern.maxfiles is 4136. When I run this same program, it
works. getdtablesize() returns 64 on startup and 66 right before the
select.

	I have yet another machine (2.1.0-RELEASE) with an OPEN_MAX of
128 and kern.maxfiles is 360. getdtablesize() at main is 128 at right
before the select it is 130.

	On the last two machines, the select runs fine On the first
two, the select (the result of the getdtablesize() is going to the
first arg of the select() call) returns EINVAL.

	Could someone point me in the direction of a clue? thanks.
-- 
Sameer Parekh					Voice:   510-986-8770
President					FAX:     510-986-8777
C2Net
http://www.c2.net/				sameer@c2.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612130753.XAA11862>