Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163417923
D13682.id37195.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D13682.id37195.diff
View Options
Index: lib/libc/string/Makefile.inc
===================================================================
--- lib/libc/string/Makefile.inc
+++ lib/libc/string/Makefile.inc
@@ -50,6 +50,7 @@
ffs.3 flsll.3
MLINKS+=index.3 rindex.3
MLINKS+=memchr.3 memrchr.3
+MLINKS+=memset.3 memset_s.3
MLINKS+=strcasecmp.3 strncasecmp.3 \
strcasecmp.3 strcasecmp_l.3 \
strcasecmp.3 strncasecmp_l.3
Index: lib/libc/string/memset.3
===================================================================
--- lib/libc/string/memset.3
+++ lib/libc/string/memset.3
@@ -44,6 +44,7 @@
.In string.h
.Ft void *
.Fn memset "void *b" "int c" "size_t len"
+.Fn memset_s "void *b" "rsize_t destsz" "int c" "rsize_t len"
.Sh DESCRIPTION
The
.Fn memset
@@ -56,6 +57,21 @@
.Vt "unsigned char" )
to the string
.Fa b .
+The
+.Fn memset_s
+function performs the same as
+.Fn memset
+except that an error is thrown and constraint handler is called if
+.Fa b
+is a null pointer,
+.Fa destsz
+or
+.Fa len
+is greater than RSIZE_MAX, or
+.Fa len
+is greater than
+.Fa destsz
+(buffer overflow would occur).
.Sh RETURN VALUES
The
.Fn memset
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 24, 1:13 AM (12 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35422855
Default Alt Text
D13682.id37195.diff (1 KB)
Attached To
Mode
D13682: Add memset_s(3) doc to memset(3) man page.
Attached
Detach File
Event Timeline
Log In to Comment