Module Name: src
Committed By: christos
Date: Wed May 8 14:10:42 UTC 2019
Modified Files:
src/lib/libc/sys: getsockopt.2
Log Message:
mention truncation of the result if the size in optlen is less that the
size of the option to be returned in optval.
To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/lib/libc/sys/getsockopt.2
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/sys/getsockopt.2
diff -u src/lib/libc/sys/getsockopt.2:1.39 src/lib/libc/sys/getsockopt.2:1.40
--- src/lib/libc/sys/getsockopt.2:1.39 Mon Nov 5 04:18:55 2018
+++ src/lib/libc/sys/getsockopt.2 Wed May 8 10:10:42 2019
@@ -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