tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: New getsockopt2() syscall



christos%zoulas.com@localhost (Christos Zoulas) wrote:
>On Jun 9,  2:20pm, rjs%fdy2.co.uk@localhost (Robert Swindells) wrote:
>-- Subject: Re: New getsockopt2() syscall
>
>| What is the best way to provide it for review, diffs or the complete
>| page ?
>
>Either way. I think that the complete man page is not too long (I just looked).

This is my first go at it as diffs, the complete page is 14k.

Index: getsockopt.2
===================================================================
RCS file: /cvsroot/src/lib/libc/sys/getsockopt.2,v
retrieving revision 1.35
diff -u -r1.35 getsockopt.2
--- getsockopt.2	25 Jan 2012 00:28:35 -0000	1.35
+++ getsockopt.2	16 Jun 2018 21:00:31 -0000
@@ -34,7 +34,8 @@
 .Os
 .Sh NAME
 .Nm getsockopt ,
-.Nm setsockopt
+.Nm setsockopt ,
+.Nm getsockopt2
 .Nd get and set options on sockets
 .Sh LIBRARY
 .Lb libc
@@ -44,10 +45,13 @@
 .Fn getsockopt "int s" "int level" "int optname" "void * restrict optval" "socklen_t * restrict optlen"
 .Ft int
 .Fn setsockopt "int s" "int level" "int optname" "const void *optval" "socklen_t optlen"
+.Ft int
+.Fn getsockopt2 "int s" "int level" "int optname" "void * restrict optval" "socklen_t * restrict optlen"
 .Sh DESCRIPTION
-.Fn getsockopt
-and
+.Fn getsockopt ,
 .Fn setsockopt
+and
+.Fn getsockopt2
 manipulate the
 .Em options
 associated with a socket.
@@ -82,10 +86,18 @@
 .Fn setsockopt .
 For
 .Fn getsockopt
+and
+.Fn getsockopt2
 they identify a buffer in which the value for the
 requested option(s) are to be returned.
 For
-.Fn getsockopt ,
+.Fn getsockopt2
+they are also used to provide an extra argument to select which
+value to return.
+For
+.Fn getsockopt
+and
+.Fn getsockopt2 ,
 .Fa optlen
 is a value-result parameter, initially containing the
 size of the buffer pointed to by
@@ -148,6 +160,8 @@
 The following options are recognized at the socket level.
 Except as noted, each may be examined with
 .Fn getsockopt
+or
+.Fn getsockopt2
 and set with
 .Fn setsockopt .
 .Bl -column SO_ACCEPTFILTER data -offset indent
@@ -379,7 +393,9 @@
 and
 .Dv SO_ERROR
 are options used only with
-.Fn getsockopt .
+.Fn getsockopt
+or
+.Fn getsockopt2 .
 .Dv SO_TYPE
 returns the type of the socket, such as
 .Dv SOCK_STREAM ;
@@ -444,5 +460,10 @@
 .Fn getsockopt
 system call appeared in
 .Bx 4.2 .
+.Pp
+The
+.Fn getsockopt2
+system call appeared in
+.Nx 9.0 .
 .Sh BUGS
 Several of the socket options should be handled at lower levels of the system.


Home | Main Index | Thread Index | Old Index