public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Trenton D. Adams" <tadams@extremeeng.com>
To: "'Jonathan Larmour'" <jlarmour@redhat.com>
Cc: "'eCos Discussion'" <ecos-discuss@sourceware.cygnus.com>
Subject: RE: [ECOS] select () confusion
Date: Thu, 02 Aug 2001 14:55:00 -0000	[thread overview]
Message-ID: <000601c11b9d$e8012890$090110ac@TRENT> (raw)
In-Reply-To: <3B69CAC8.BD0CEA9C@redhat.com>

  > 
  > Yes. Normally you track the largest fd you've ever had, or keep a
list
  > of
  > fds. Or just use FD_SETSIZE if you're lazy IIRC.
  > 

IIRC?

  > > Anyhow, I thought that the first parameter was the number of file
  > > descriptors in the fd_set.  It makes no sense to have to calculate
  > what
  > > the highest numbered socket descriptor is before calling select
().
  > 
  > It's standard BSD select() use.
  > 

Not *_ALL_* standards are a good idea! ;)

I personally like the windows, BSD *compatible*, select better.  The
first parameter is there only for compatibility.  Since FD_SET always
increments the fd count anyhow, I don't see a point in even using the
first parameter.

  > > On
  > > top of that, the example at the bottom of the documentation for
select
  > > () is not very good.  It passes a 1 in as the first parameter
which is
  > > exactly why I thought it was the number of file descriptors and
not
  > the
  > > highest numbered one.
  > 
  > Ah, that's because it happens to choose stdin, which is always fd 0.
  > 

Oh, I see.

  reply	other threads:[~2001-08-02 14:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-02 14:28 Trenton D. Adams
2001-08-02 14:49 ` Jonathan Larmour
2001-08-02 14:55   ` Trenton D. Adams [this message]
2001-08-02 15:05     ` Jonathan Larmour
2001-08-02 15:30       ` Trenton D. Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000601c11b9d$e8012890$090110ac@TRENT' \
    --to=tadams@extremeeng.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=jlarmour@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).