[comp.unix.wizards] setsockopt -- SO_LINGER parameter?

koreth@ssyx.ucsc.edu (Steven Grimm) (07/08/88)

Does anyone know what kind of value setsockopt() is expecting 
as a parameter to the SO_LINGER flag?  I can't find it documented
anywhere.  I'm guessing it's a struct timeval, since that seems to
be used a lot in system calls.  Does anyone know for sure?

---
These are my opinions, and in no way reflect those of UCSC, which are wrong.
Steven Grimm		Moderator, comp.{sources,binaries}.atari.st
koreth@ssyx.ucsc.edu	...!ucbvax!ucscc!ssyx!koreth

chris@mimsy.UUCP (Chris Torek) (07/11/88)

In article <4084@saturn.ucsc.edu> koreth@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@mimsy.umd.edu	Path:	uunet!mimsy!chris