public inbox for trinity@vger.kernel.org
 help / color / mirror / Atom feed
* How about use default type for syscall setsockopt
@ 2013-08-26  3:11 Hangbin Liu
  0 siblings, 0 replies; only message in thread
From: Hangbin Liu @ 2013-08-26  3:11 UTC (permalink / raw)
  To: trinity

Hi all,

I don't know why we use unsigned int/long for all sockopt parameters. But how
about use the default type for setsockopt. Then we can set optval for some
special options such as SO_LIGNER, SO_SNDTIMEO...


diff --git a/include/net.h b/include/net.h
index 78665d2..6306551 100644
--- a/include/net.h
+++ b/include/net.h
@@ -29,10 +29,10 @@ struct socket_triplet {
 };

 struct sockopt {
-       unsigned int level;
-       unsigned long optname;
-       unsigned long optval;
-       unsigned long optlen;
+       int level;
+       int optname;
+       const void *optval;
+       socklen_t optlen;
 };


-- 

Thanks & Best Regards
Hangbin Liu <liuhangbin@gmail.com>

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-08-26  3:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-26  3:11 How about use default type for syscall setsockopt Hangbin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox