Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 May 2000 18:44:40 +0400 (MSD)
From:      Vsevolod Semenov <s@gw2.mtelecom.ru>
To:        freebsd-hackers@freebsd.org
Subject:   extremaly useful option for mount_portal
Message-ID:  <Pine.BSF.4.01.10005091831520.14288-100000@gw2>

next in thread | raw e-mail | index | archive | help
i've just invented extremaly useful option for mount_portal utils!
to make non blocking tcp connections.

if open(2) /p/tcp/address/port/nodel
file descriptor will retuned in non-blocked mode.


55a56
> #include <fcntl.h>
83a85
> 	int nodel = 0;
107c109,112
< 			return (EINVAL);
---
> 			if(strcmp(p,"nodel")==0)
> 				nodel=1;
> 			else
> 				return (EINVAL);
155c160,164
< 
---
> 		if(nodel)
> 			if(fcntl(so,F_SETFL,O_NONBLOCK)==-1){
> 				syslog(LOG_ERR,"fcntl: %m");
> 				return(errno);
> 			}
159a169,172
> 		}
> 		if(nodel&&errno==EINPROGRESS){
> 			*fdp=so;
> 			return(0);



seva




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.01.10005091831520.14288-100000>