setsockopt -- SO_LINGER parameter?

Chris Torek chris at mimsy.UUCP
Mon Jul 11 23:20:55 AEST 1988


In article <4084 at saturn.ucsc.edu> koreth at ssyx.ucsc.edu (Steven Grimm) writes:
>Does anyone know what kind of value setsockopt() is expecting 
>as a parameter to the SO_LINGER flag?

In 4.2BSD (and hence [old?] SunOS), an `int' which is the linger time.
To turn it off, you must use SO_DONTLINGER.

In 4.3BSD and later, a structure called `linger', defined in <socket.h>:

/*
 * Structure used for manipulating linger option.
 */
struct	linger {
	int	l_onoff;		/* option on/off */
	int	l_linger;		/* linger time */
};
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.wizards mailing list