Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Nov 1998 08:25:31 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        nate@mt.sri.com (Nate Williams)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Supporting more than FD_SETSIZE fd's
Message-ID:  <199811110825.BAA06296@usr02.primenet.com>
In-Reply-To: <199811091734.KAA04752@mt.sri.com> from "Nate Williams" at Nov 9, 98 10:34:00 am

next in thread | previous in thread | raw e-mail | index | archive | help
> I looked through the handbook and the FAQ and didn't find anything, so
> hopefully someone can help me out.
> 
> I need to support more than the default 255 FD's in an application (the
> JDK for what it's worth).  To be portable, the code uses fd_set as
> defined in <sys/types.h>.  Unfortunately, unless I redefine FD_SETSIZE
> in every file that uses it, I still have a hard-limit on the number of
> FD's the application can use.
> 
> Is there any 'portable' way of getting around this?

Redefine FD_SETSIZE.

If you don't wwant to do it in every file that uses it, then either
do it in the header file itself, or add -DFD_SETSIZE=1024 to CFLAGS.


> I'd really like to
> have it use whichever open FD that the limit allows, but I know now way
> of having this happen?

I can't really parse this.  The "the limit allows" value is based on
how many contiguous bits there are in an fd_set, which is based on
the value of FD_SETSIZE at the time the fd_set is declared.


Basically, the first argument is how many bits into the fd_set
that select is supposed to index looking for FD_ISSET bits to
select fd's to select on...


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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