Problem URGENT with the argument F_SETOWN in the function fcntl
Corinna Vinschen
corinna@vinschen.de
Mon Nov 29 07:08:00 GMT 1999
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
More information about the Cygwin
mailing list