Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/sys mention truncation of the result if the size in...



details:   https://anonhg.NetBSD.org/src/rev/4ae100ce0010
branches:  trunk
changeset: 451171:4ae100ce0010
user:      christos <christos%NetBSD.org@localhost>
date:      Wed May 08 14:10:42 2019 +0000

description:
mention truncation of the result if the size in optlen is less that the
size of the option to be returned in optval.

diffstat:

 lib/libc/sys/getsockopt.2 |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 246a997f1e4c -r 4ae100ce0010 lib/libc/sys/getsockopt.2
--- a/lib/libc/sys/getsockopt.2 Wed May 08 14:05:18 2019 +0000
+++ b/lib/libc/sys/getsockopt.2 Wed May 08 14:10:42 2019 +0000
@@ -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 @@
 .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



Home | Main Index | Thread Index | Old Index