delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/11/29/10:09:04

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <384294A8.45E14D42@vinschen.de>
Date: Mon, 29 Nov 1999 15:58:48 +0100
From: Corinna Vinschen <corinna AT vinschen DOT de>
X-Mailer: Mozilla 4.6 [en] (WinNT; I)
X-Accept-Language: de,en
MIME-Version: 1.0
To: david Depere <ddepere AT cr2a-di DOT fr>
CC: "'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: Problem URGENT with the argument F_SETOWN in the function fcntl
References: <01BF3A76 DOT DBE03880 DOT ddepere AT cr2a-di DOT fr>

Hello David,

david Depere wrote:
>         The function fcntl used with the argument F_SETOWN return a value of -1 and the errno indicate that
>         "the argument is invalid".
>         However in the include file fcntl.h, this argument exist. (#define F_SETOWN 6  /* Set owner - for ASYNC */ )
>         Do you have found this problem already?

F_SETOWN is in no way supported by Win32 so it's not possible to
implement it. Nevertheless it's defined by POSIX, so it's part of
the header. Maybe, it should be erased there...

But:

> fdsock = socket (AF_INET, SOCK_DGRAM, 0);
> [...]
> arg = getpid();
> fcntl(fdsock, F_SETOWN, arg);   /* PROBLEM */

Why do you do this? Your process has created the socket, so it _is_
already the owner?!?

If your app should be portable, simply write:

#ifndef __CYGWIN__
    fcntl(fdsock, F_SETOWN, getpid());   /* NO PROBLEM ANYMORE */
#endif /*__CYGWIN__*/

Corinna


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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