Userland changes for getsockopt2().

This commit is contained in:
rjs 2018-07-31 13:04:09 +00:00
parent 8c89512565
commit 4dbc455943
5 changed files with 39 additions and 14 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: shl.mi,v 1.842 2018/06/28 10:14:01 christos Exp $
# $NetBSD: shl.mi,v 1.843 2018/07/31 13:04:09 rjs Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@ -18,7 +18,7 @@
./lib/libblacklist.so.0.0 base-sys-shlib dynamicroot
./lib/libc.so base-sys-shlib dynamicroot
./lib/libc.so.12 base-sys-shlib dynamicroot
./lib/libc.so.12.209 base-sys-shlib dynamicroot
./lib/libc.so.12.210 base-sys-shlib dynamicroot
./lib/libcrypt.so base-sys-shlib dynamicroot
./lib/libcrypt.so.1 base-sys-shlib dynamicroot
./lib/libcrypt.so.1.0 base-sys-shlib dynamicroot
@ -221,7 +221,7 @@
./usr/lib/libc++.so.1.0 base-sys-shlib compatfile,libcxx
./usr/lib/libc.so base-sys-shlib compatfile
./usr/lib/libc.so.12 base-sys-shlib compatfile
./usr/lib/libc.so.12.209 base-sys-shlib compatfile
./usr/lib/libc.so.12.210 base-sys-shlib compatfile
./usr/lib/libcdk.so base-obsolete compatfile,obsolete
./usr/lib/libcom_err.so base-krb5-shlib compatfile,kerberos
./usr/lib/libcom_err.so.8 base-krb5-shlib compatfile,kerberos

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.2212 2018/07/17 18:55:24 joerg Exp $
# $NetBSD: mi,v 1.2213 2018/07/31 13:04:10 rjs Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
./etc/mtree/set.comp comp-sys-root
@ -4272,6 +4272,7 @@
./usr/share/man/cat2/getsid.0 comp-c-catman .cat
./usr/share/man/cat2/getsockname.0 comp-c-catman .cat
./usr/share/man/cat2/getsockopt.0 comp-c-catman .cat
./usr/share/man/cat2/getsockopt2.0 comp-c-catman .cat
./usr/share/man/cat2/gettimeofday.0 comp-c-catman .cat
./usr/share/man/cat2/getuid.0 comp-c-catman .cat
./usr/share/man/cat2/getvfsstat.0 comp-c-catman .cat
@ -12121,6 +12122,7 @@
./usr/share/man/html2/getsid.html comp-c-htmlman html
./usr/share/man/html2/getsockname.html comp-c-htmlman html
./usr/share/man/html2/getsockopt.html comp-c-htmlman html
./usr/share/man/html2/getsockopt2.html comp-c-htmlman html
./usr/share/man/html2/gettimeofday.html comp-c-htmlman html
./usr/share/man/html2/getuid.html comp-c-htmlman html
./usr/share/man/html2/getvfsstat.html comp-c-htmlman html
@ -19793,6 +19795,7 @@
./usr/share/man/man2/getsid.2 comp-c-man .man
./usr/share/man/man2/getsockname.2 comp-c-man .man
./usr/share/man/man2/getsockopt.2 comp-c-man .man
./usr/share/man/man2/getsockopt2.2 comp-c-man .man
./usr/share/man/man2/gettimeofday.2 comp-c-man .man
./usr/share/man/man2/getuid.2 comp-c-man .man
./usr/share/man/man2/getvfsstat.2 comp-c-man .man

View File

@ -1,4 +1,4 @@
# $NetBSD: shlib_version,v 1.279 2018/04/06 17:03:59 dholland Exp $
# $NetBSD: shlib_version,v 1.280 2018/07/31 13:04:10 rjs Exp $
# Remember to update distrib/sets/lists/base/shl.* when changing
#
# things we wish to do on next major version bump:
@ -53,4 +53,4 @@
# - move environ and __ps_strings from crt0.o into libc.
# - move statfs() to libcompat since we have statvfs()
major=12
minor=209
minor=210

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.239 2018/07/12 10:46:41 maxv Exp $
# $NetBSD: Makefile.inc,v 1.240 2018/07/31 13:04:10 rjs Exp $
# @(#)Makefile.inc 8.3 (Berkeley) 10/24/94
# sys sources
@ -111,7 +111,7 @@ ASM= access.S acct.S \
__getcwd.S __getdents30.S __getfh30.S getvfsstat.S getgroups.S\
__getitimer50.S __getlogin.S getpeername.S getpgid.S getpgrp.S \
getpriority.S getrlimit.S __getrusage50.S getsid.S \
getsockname.S getsockopt.S __gettimeofday50.S \
getsockname.S getsockopt.S getsockopt2.S __gettimeofday50.S \
ioctl.S \
kqueue.S kqueue1.S ktrace.S \
_ksem_close.S _ksem_destroy.S _ksem_getvalue.S _ksem_init.S \
@ -319,6 +319,7 @@ MLINKS+=getpgrp.2 getpgid.2
MLINKS+=getpid.2 getppid.2
MLINKS+=getpriority.2 setpriority.2
MLINKS+=getrlimit.2 setrlimit.2
MLINKS+=getsockopt.2 getsockopt2.2
MLINKS+=getsockopt.2 setsockopt.2
MLINKS+=gettimeofday.2 settimeofday.2
MLINKS+=getuid.2 geteuid.2

View File

@ -1,4 +1,4 @@
.\" $NetBSD: getsockopt.2,v 1.35 2012/01/25 00:28:35 christos Exp $
.\" $NetBSD: getsockopt.2,v 1.36 2018/07/31 13:04:10 rjs Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -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 @@ are used to access option values for
.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 @@ parameter, defined in
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 @@ Finally,
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 @@ The
.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.