public inbox for trinity@vger.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: trinity@vger.kernel.org
Subject: How about use default type for syscall setsockopt
Date: Mon, 26 Aug 2013 11:11:05 +0800	[thread overview]
Message-ID: <20130826031105.GN14331@localhost.localdomain> (raw)

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>

                 reply	other threads:[~2013-08-26  3:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130826031105.GN14331@localhost.localdomain \
    --to=liuhangbin@gmail.com \
    --cc=trinity@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox