Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Authentication-Warning: eos.vss.fsi.com: ford owned process doing -bs
Date: Fri, 17 Oct 2003 16:57:50 -0500 (CDT)
From: Brian Ford <ford@vss.fsi.com>
X-X-Sender: ford@eos
To: Andy Howell <AndyHowell@austin.rr.com>
cc: cygwin@cygwin.com
Subject: Re: error setting pipe to non-blocking IO
In-Reply-To: <3F906430.5000100@austin.rr.com>
Message-ID: <Pine.GSO.4.56.0310171656160.823@eos>
References: <3F906430.5000100@austin.rr.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Fri, 17 Oct 2003, Andy Howell wrote:

> I am trying to setup a pipe to do non-blocking IO:
>
> int main()
> {
> 	int pipefd[2];
> 	int n;
> 	n = 1;
>
> 	pipe(pipefd);
> 	perror("Pipe: ");
> 	ioctl(pipefd[0], FIOBIO, &n);
> 	perror("Ioctl: ");
> }
>
> When I run this, I get:
>
> Pipe: No Error
> Ioctl: Invalid argument
>
> Any ideas?
>
Yup, unsupported.

from src/winsup/cygwin/fhandler.cc:909

int
fhandler_base::ioctl (unsigned int cmd, void *buf)
{
  if (cmd == FIONBIO)
    syscall_printf ("ioctl (FIONBIO, %p)", buf);
  else
    syscall_printf ("ioctl (%x, %p)", cmd, buf);

  set_errno (EINVAL);
  return -1;
}

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

