set/getsockopt SO_LINGER problem

Prasanta Sadhukhan <[email protected]>
Newsgroups gmane.os.netbsd.help
Message-ID <[email protected]>
Hi,

I am trying to use get/setsockopt for SO_LINGER option but am facing a 
problem
I used setsockopt with opt as SO_LINGER passing linger structure with 
l_onoff as 1 and l_linger as 65535
but when I try to get back through getsockopt, I am getting l_onoff as 
128 and l_linger as -1.
For other values of l_linger (like 1, 2, 10) during set, though I get 
l_onoff as 128 but l_linger is returned correctly
Before getting the value, I typecast the (void *)optval to (linger *). 
Has anyone seen this problem before in Netbsd 3.0?

Regards
Prasanta
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.