delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/10/15/04:29:14

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3BCA9E3A.796CB2AC@syntrex.com>
Date: Mon, 15 Oct 2001 10:28:42 +0200
From: Pavel Tsekov <ptsekov AT syntrex DOT com>
Organization: Syntrex Inc.
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Rony Shapiro <ronys AT gmx DOT net>
CC: cygwin AT cygwin DOT com
Subject: Re: 1.3.3: fcntl F_{SETOWN,ASYNC} seems broken?
References: <KHEGKKOPPNOLICPLBKDOGEGCCFAA DOT ronys AT gmx DOT net>

Hey, Rony :)

Rony Shapiro wrote:

EINVAL is returned in case of invalid argument being passed
to the function called - in this case fcntl. So I'd say that
F_SETOWN is not implemented in cygwin's fcntl :)

Look below :)

  switch (cmd)
    {
	// [snip]
	// Here cygwin processes supported operations
    default:
	// This is what happens to you :)
      set_errno (EINVAL);
      res = -1;
      break;
    }

Btw more info on the subj:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/fhandler.cc?rev=1.94&content-type=text/x-cvsweb-markup&cvsroot=src

This is the source in cygwin handling fcntl.

> Here's the code fragment that seems to be the problem, symptoms in comments:
> 
> void
> FileSetFd (int fd)
> {
>     int flags;
> 
>     fcntl (fd, F_SETOWN, getpid()); // This return EINVAL
> 
>     flags = fcntl (fd, F_GETFL);
>     flags |= F_ASYNC|F_NOBLOCK;
>     fcntl (fd, F_SETFL, flags) != 0); // This succeeds, but has no effect
>     { // Tried the following based on something I found in the cygwin mail
> archive,
>         // to no avail.
>       int yesplease = 1;
>       ioctl( fd, FIOASYNC, &yesplease );
>     }
> }
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019