summaryrefslogtreecommitdiff
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2019-05-08 14:10:42 +0000
committerchristos <christos@NetBSD.org>2019-05-08 14:10:42 +0000
commit43cdf7be49610bf4890798bb5fa3087f340efa22 (patch)
tree1d533c2b97ee495d368c8b49fd866133b46ea1ef /lib/libc/sys
parent160c3eb203635af167481968ef01cd83f08554b1 (diff)
mention truncation of the result if the size in optlen is less that the
size of the option to be returned in optval.
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/getsockopt.213
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/libc/sys/getsockopt.2 b/lib/libc/sys/getsockopt.2
index 87531d9bc1a..db624e4ace7 100644
--- a/lib/libc/sys/getsockopt.2
+++ b/lib/libc/sys/getsockopt.2
@@ -1,4 +1,4 @@
-.\" $NetBSD: getsockopt.2,v 1.39 2018/11/05 09:18:55 wiz Exp $
+.\" $NetBSD: getsockopt.2,v 1.40 2019/05/08 14:10:42 christos Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95
.\"
-.Dd November 3, 2018
+.Dd May 8, 2019
.Dt GETSOCKOPT 2
.Os
.Sh NAME
@@ -104,6 +104,15 @@ size of the buffer pointed to by
.Fa optval ,
and modified on return to indicate the actual size of
the value returned.
+If the size of the requested option value to be stored in
+.Fa optval
+is greater than the size indicated in
+.Fa optlen
+then only
+.Fa optlen
+bytes will be stored in
+.Fa optval
+and the result will be silently truncated.
If no option value is to be supplied or returned,
.Fa optval
may be