Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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 CC: cygwin AT cygwin DOT com Subject: Re: 1.3.3: fcntl F_{SETOWN,ASYNC} seems broken? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/