This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem URGENT with the argument F_SETOWN in the function fcntl



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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]