summaryrefslogtreecommitdiff
path: root/usr/src/man/man3c/memset_s.3c
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2018-08-17 12:26:02 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2018-08-17 12:26:02 +0000
commitb024317c8de8fc6aa55e87767b0e084ba5941ce7 (patch)
tree2fb250f1cfd1ef0a78b9db6c2b2553a1140ef198 /usr/src/man/man3c/memset_s.3c
parent48810110f815c605fe76c7da807dcfc9f4962485 (diff)
parente5ecfaa0ff00b00d0b97e8638701ff77caeeab1d (diff)
downloadillumos-joyent-b024317c8de8fc6aa55e87767b0e084ba5941ce7.tar.gz
[illumos-gate merge]
commit e5ecfaa0ff00b00d0b97e8638701ff77caeeab1d 9726 getent could list the attr databases commit 70ee30a511f4abfd1b9cdf25495a219fe131829a 9719 uts/i86pc: add way to set bootrd_debug commit ca876c1c4225b51f8e1c2763b28e8466add83a0b 9717 libstand: build with -Wall only commit 64a170cf91c8d267e7707c00ac13639160db85cd 9703 loader: stage1 should not probe floppies for zfs commit 843ead088f87e5e766084646370e981f176eb323 9418 iwn: rate array in struct iwn_ks_txpower should have size IWN_RIDX_MAX+1 commit 8e5dcf3a637ec78130ed00945993c8c991997a44 9728 3secdb man pages need some tlc commit 00efb5e1437d3912284689f1b0c13190e634e788 8548 want memset_s(3C) commit 3b5ccf6b95a705120c7f7fa193afabfd40dc7342 9242 st: this statement may fall through Conflicts: usr/src/test/libc-tests/runfiles/default.run
Diffstat (limited to 'usr/src/man/man3c/memset_s.3c')
-rw-r--r--usr/src/man/man3c/memset_s.3c104
1 files changed, 104 insertions, 0 deletions
diff --git a/usr/src/man/man3c/memset_s.3c b/usr/src/man/man3c/memset_s.3c
new file mode 100644
index 0000000000..9da92ff927
--- /dev/null
+++ b/usr/src/man/man3c/memset_s.3c
@@ -0,0 +1,104 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source. A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\"
+.\" Copyright 2018 Nexenta Systems, Inc.
+.\"
+.Dd August 12, 2017
+.Dt MEMSET_S 3C
+.Os
+.Sh NAME
+.Nm memset_s
+.Nd copy a value to all bytes of a memory buffer
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.Fd #define __STDC_WANT_LIB_EXT1__ 1
+.In string.h
+.Ft errno_t
+.Fo memset_s
+.Fa "void *s"
+.Fa "rsize_t smax"
+.Fa "int c"
+.Fa "rsize_t n"
+.Fc
+.Sh DESCRIPTION
+The
+.Fn memset_s
+function copies the value of
+.Fa c
+.Po converted to an
+.Vt unsigned char
+.Pc
+into each of the first
+.Fa n
+bytes of the memory buffer pointed to by
+.Fa s .
+.Pp
+Unlike the
+.Xr memset 3C ,
+.Fn memset_s
+is guaranteed to never be optimized away by the compiler.
+.Pp
+The
+.Fn memset_s
+function detects the following runtime-constraint violations:
+.Bl -enum
+.It
+.Fa s
+is a
+.Dv NULL
+pointer.
+.It
+.Fa smax
+or
+.Fa n
+is greater than
+.Dv RSIZE_MAX .
+.It
+.Fa n
+is greater than
+.Fa smax
+.Pq buffer overflow .
+.El
+.Pp
+If runtime-constraint violation is detected, and if
+.Fa s
+and
+.Fa smax
+are valid, the
+.Fn memset_s
+function copies the value of
+.Fa c
+.Po converted to an
+.Vt unsigned char
+.Pc
+into each of the first
+.Fa smax
+bytes of the memory buffer pointed to by
+.Fa s
+before calling the runtime-constraint handler.
+.Sh RETURN VALUES
+The
+.Fn memset_s
+function returns 0 if there was no runtime-constraint violation.
+Otherwise, a non-zero value is returned.
+.Sh INTERFACE STABILITY
+.Sy Standard
+.Sh MT-LEVEL
+.Sy Safe
+.Sh SEE ALSO
+.Xr memset 3C ,
+.Xr set_constraint_handler 3C
+.Sh STANDARDS
+The
+.Fn memset_s
+function conforms to
+.St -isoC-2011 .