mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jogchem de Groot <bighawk@kryptology.org>
To: linux-kernel@vger.kernel.org
Cc: root@chaos.analogic.com
Subject: Re: poll() incompatability with POSIX.1-2001
Date: Mon, 14 Oct 2002 19:13:43 +0200	[thread overview]
Message-ID: <20021014171302.ERYV394.mail6-sh.home.nl@there> (raw)
In-Reply-To: <Pine.LNX.3.95.1021014110505.12302A-100000@chaos.analogic.com>

Hello, 

This is a failure to connect! The socket is therefore not ready for
writing  or reading -ever. This behavior may not be correct, not
because of a failure to set the POLLOUT bit, but because the POLLIN
bit is set. Check if this is really true. I can't duplicate this
on 2.4.18 here because it's hard to get a deferred connect with my
setup.

It's really true:..

Here is some strace output:

Case where connect() succeeds:

connect(3, {sin_family=AF_INET, sin_port=htons(111), 
sin_addr=inet_addr("127.0.0.1")}}, 16) = -1 EINPROGRESS (Operation now in 
progress)
poll([{fd=3, events=POLLIN|POLLOUT, revents=POLLOUT}], 1, -1) = 1
getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0

As you can see SO_ERROR returns '0', connection succeeded.

Case where connect() fails:

connect(3, {sin_family=AF_INET, sin_port=htons(110), 
sin_addr=inet_addr("127.0.0.1")}}, 16) = -1 EINPROGRESS (Operation now in 
progress)
poll([{fd=3, events=POLLIN|POLLOUT, revents=POLLIN|POLLERR|POLLHUP}], 1, -1) 
= 1
getsockopt(3, SOL_SOCKET, SO_ERROR, [111], [4]) = 0

As you can see SO_ERROR returns '111', connection failed.

   bighawk

  reply	other threads:[~2002-10-14 17:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-14 14:58 Jogchem de Groot
2002-10-14 15:14 ` Richard B. Johnson
2002-10-14 17:13   ` Jogchem de Groot [this message]
2002-10-15  3:36   ` Geoffrey Lee
2002-10-15  7:47     ` Jogchem de Groot
2002-10-15 13:53       ` Geoffrey Lee

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=20021014171302.ERYV394.mail6-sh.home.nl@there \
    --to=bighawk@kryptology.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.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

all inboxes | Powered by JetHome®