mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matti Aarnio <matti.aarnio@zmailer.org>
To: Brad Bonkoski <bbonkoski@xyterra.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: Fw: select(2)
Date: Sat, 4 Aug 2001 04:42:02 +0300	[thread overview]
Message-ID: <20010804044202.G11046@mea-ext.zmailer.org> (raw)
In-Reply-To: <03f101c11c5b$b53a19d0$6e00a8c0@BBONKOSKI>
In-Reply-To: <03f101c11c5b$b53a19d0$6e00a8c0@BBONKOSKI>; from bbonkoski@xyterra.com on Fri, Aug 03, 2001 at 01:34:34PM -0700

On Fri, Aug 03, 2001 at 01:34:34PM -0700, Brad Bonkoski wrote:
> > Hello,
> >
> > this code:
> > fd_set set;
> > struct timeval timeout;
> > int len_inet;
> > int n;
> > FD_ZERO(&set);
> > timeout.tv_sec = 1L;

  I would venture a guess that as you don't EXPLICITELY
  initialize the   timeout.tv_usec  value to be
  within  0  to   999999   it may get some system dependent
  sometimes random, sometimes fixed value (the joys of these
  stack-allocated "automatic" variables..)

  For short:  Smells of UNINITIALIZED PARAMETER DATA.

> > FD_SET(sc_sock,&set);
> > n = select(sc_sock+1, &set, NULL, NULL, &timeout);
> > if (n == -1)
> >
> 
> >   perror("select()\n");
> >   exit(1);
> > }
> >
> > Works just fine on one machine, i.e. select() does not return a '-1' which
> lets it run through the rest of the code.  However, on other machines, it
> does not work fine, -1 is always returned by select() with error of: Invalid
> arguement
> >
> > Any ideas on where I could look to fix this problem?  Something in the
> syntax of the posted code, or should I be looking at the creation of the
> socket?
> > TIA.
> > Brad
> >
> >
> >
> >
> >
> 
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

      reply	other threads:[~2001-08-04  1:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-03 20:34 Brad Bonkoski
2001-08-04  1:42 ` Matti Aarnio [this message]

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=20010804044202.G11046@mea-ext.zmailer.org \
    --to=matti.aarnio@zmailer.org \
    --cc=bbonkoski@xyterra.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®