Mailinglist Archive: opensuse-programming (33 mails)

< Previous Next >
Re: [suse-programming-e] EAGAIN on a blocking socket?
  • From: Per Jessen <per@xxxxxxxxxxxx>
  • Date: Thu, 02 Mar 2006 19:49:34 +0100
  • Message-id: <du7enu$kbe$1@xxxxxxxxxxxxxxxx>
Anders Johansson wrote:

> Per Jessen wrote:
>> right2=dup(right);
>> fcntl( right, F_SETFL, O_NONBLOCK );
> File status flags are shared between dup()licated file descriptors, so
> this operation sets both to O_NONBLOCK. Could this answer your
> problem?

Yeah, that would explain it, except when I do fcntl( GET_FL ) to read
the setting of right2 it doesn't report nonblocking? Are you sure the
flags are shared?
They should be _copied_ with dup(), but the a change of flags on one
filedescriptor is copied to another, that doesn't sound right - to me

/Per Jessen, Z├╝rich

< Previous Next >
List Navigation