Clarify that memset_s(3) requires __STDC_WANT_LIB_EXT1__ for visibility.

Fix typos and other nits.

Submitted by:	Yuri Pankov <yuripv@yuripv.net>
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D16797
This commit is contained in:
Konstantin Belousov 2018-08-19 14:25:28 +00:00
parent d3ee476315
commit 759a4bc697
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=338049

View File

@ -32,7 +32,7 @@
.\" @(#)memset.3 8.1 (Berkeley) 6/4/93 .\" @(#)memset.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd February 15, 2018 .Dd August 19, 2018
.Dt MEMSET 3 .Dt MEMSET 3
.Os .Os
.Sh NAME .Sh NAME
@ -44,6 +44,7 @@
.In string.h .In string.h
.Ft void * .Ft void *
.Fn memset "void *dest" "int c" "size_t len" .Fn memset "void *dest" "int c" "size_t len"
.Fd #define __STDC_WANT_LIB_EXT1__ 1
.Ft errno_t .Ft errno_t
.Fn memset_s "void *dest" "rsize_t destsz" "int c" "rsize_t len" .Fn memset_s "void *dest" "rsize_t destsz" "int c" "rsize_t len"
.Sh DESCRIPTION .Sh DESCRIPTION
@ -82,7 +83,6 @@ or
is greater than is greater than
.Dv RSIZE_MAX , .Dv RSIZE_MAX ,
or or
.Sp
.Fa len .Fa len
is greater than is greater than
.Fa destsz .Fa destsz
@ -93,10 +93,10 @@ Like
.Xr explicit_bzero 3 , .Xr explicit_bzero 3 ,
.Fn memset_s .Fn memset_s
is not removed through Dead Store Elimination (DSE), making it useful for is not removed through Dead Store Elimination (DSE), making it useful for
clearing sensitve data. clearing sensitive data.
In contrast In contrast
.Fn memset .Fn memset
function function
may be optimized away if the object modified by the function is not accessed may be optimized away if the object modified by the function is not accessed
again. again.
To clear memory that will not subsequently be accessed it is advised to use To clear memory that will not subsequently be accessed it is advised to use
@ -126,6 +126,6 @@ function
conforms to conforms to
.St -isoC . .St -isoC .
.Fn memset_s .Fn memset_s
conforms to: conforms to
.St -isoC-2011 .St -isoC-2011
K.3.7.4.1. K.3.7.4.1.