Article View: news.software.nntp
Article #84119Re: Rebuilding overview
From: Russ Allbery
Date: Sat, 11 Jun 2011 19:50
Date: Sat, 11 Jun 2011 19:50
32 lines
2537 bytes
2537 bytes
Julien ΓLIE <iulius@nom-de-mon-site.com.invalid> writes:
> I understand for innd.
> But something still puzzles me. What for backends/innxmit.c where we have:
> fd_set rmask;
> FromServer = fileno(From);
> FD_ZERO(&rmask);
> FD_SET(FromServer, &rmask);
> i = select(FromServer + 1, &rmask, NULL, NULL, &t);
> Don't we have a problem if we do not check the value of FromServer with
> FD_SETSIZE?
Once upon a time, the limit on file descriptor numbers in stdio was even
lower than that for FD_SETSIZE, but that's probably not true any more.
However, it's likely true for anything that would do something
particularly horrible if the file descriptor number is larger than
FD_SETSIZE.
But probably somewhat more to the point, it's hard to see how innxmit
would ever open enough connections to get a large file descriptor number.
They're always allocated starting with 3 (since 0, 1, and 2 are stdin,
stdout, and stderr), so if you only open a few sockets, there's usually no
need to worry about it.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID:
<87oc24m9kk.fsf@windlord.stanford.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!usenet.stanford.edu!usenet-its.stanford.edu!not-for-mailReferences:
<slrnis7i5f.bet.steve@news.mixmin.net> <iq1e3h$59m$1@news.trigofacile.com> <slrnit9m74.23b.steve@news.mixmin.net> <95gob9Fsl1U1@mid.individual.net> <95gpauF4aiU1@mid.individual.net>Show Full Headers
Complete Article Headers
Message-ID: <87oc24m9kk.fsf@windlord.stanford.edu> Subject: Re: Rebuilding overview Date: Sat, 11 Jun 2011 12:50:35 -0700 From: Russ Allbery <rra@stanford.edu> References: <slrnis7i5f.bet.steve@news.mixmin.net> <iq1e3h$59m$1@news.trigofacile.com> <slrnit9m74.23b.steve@news.mixmin.net> <95gob9Fsl1U1@mid.individual.net> <95gpauF4aiU1@mid.individual.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!usenet.stanford.edu!usenet-its.stanford.edu!not-for-mail Newsgroups: news.software.nntp Organization: The Eyrie Lines: 32 NNTP-Posting-Host: windlord.stanford.edu Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: usenet-its.stanford.edu 1307821835 26759 171.67.225.134 (11 Jun 2011 X-Complaints-To: news@usenet-its.stanford.edu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:PXaGZ8i4DeFtX9DYPoz5kq7ulF0= X-Original-Bytes: 2349