delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/12/06/05:22:10

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: <01BF3FDC.5DF22AD0.ddepere@cr2a-di.fr>
From: david Depere <ddepere AT cr2a-di DOT fr>
To: "'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>
Subject: Problem always URGENT with the argument F_SETOWN in the function fcntl
Date: Mon, 6 Dec 1999 11:23:47 +0100
X-Mailer: Messagerie Internet de Microsoft/MAPI - 8.0.0.4211
MIME-Version: 1.0

Hello

	On UNIX, if you want to make UDP protocol (monothread) without block the 
process, the only means that i know is used the SIGIO signal, which is 
generated by the system when a event occurs on a file descriptor.
	For receive this signal, call the function fcntl(fd, SET_OWN, getpid) or 
ioctl(fd, SIOCSPGRP, getpid) is necessary even if we have created the file 
descriptor in the current process.
	If we don't do this action on the file descriptor then the signal handler 
for SIGIO signal cannot be called.

 	My problem is always that:
	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?

	int fdsock, arg;
	int PORTBASE = 19000;
	struct sockaddr_in  socket_in;

	fdsock = socket (AF_INET, SOCK_DGRAM, 0);
	if (fdsock == -1)
	return(-1);

	socket_addr.socket_in.sin_family = AF_INET;
	socket_addr.socket_in.sin_port = PORTBASE;
	socket_addr.socket_in.sin_addr.s_addr = htonl(INADDR_ANY);

	if (bind(fdsock,(struct sockaddr *) socket_addr, 
sizeof(socket_addr.socket_in))== -1)
  		{
  		close(fdsock);
   		return(-1);
		}

	arg = getpid();
	fcntl(fdsock, F_SETOWN, arg);	/* PROBLEM */

	I've heard that the product NuTCRACKER (www.datafocus.com) similar to 
Cygwin under WINDOWS NT use the function fcntl with the arguments F_SETOWN 
and F_GETOWN and CYGWIN not !!!!! WHY?
	
	See you soon!

>        		     )))((
>            	     (.  .)
> + ----------ooO-(_)-Ooo-----------	+
> +              David DEPERE 		+
> +      mailto:ddepere AT cr2a-di DOT fr  	+
> + -----------------------------------	+



--
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