Page MenuHomeFreeBSD

D42905.diff
No OneTemporary

D42905.diff

diff --git a/lib/libc/string/bstring.3 b/lib/libc/string/bstring.3
--- a/lib/libc/string/bstring.3
+++ b/lib/libc/string/bstring.3
@@ -29,7 +29,7 @@
.\"
.\" @(#)bstring.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd June 4, 1993
+.Dd December 5, 2023
.Dt BSTRING 3
.Os
.Sh NAME
@@ -58,7 +58,7 @@
.Ft int
.Fn memcmp "const void *b1" "const void *b2" "size_t len"
.Ft void *
-.Fn memccpy "void *dst" "const void *src" "int c" "size_t len"
+.Fn memccpy "void * restrict dst" "const void * restrict src" "int c" "size_t len"
.Ft void *
.Fn memcpy "void *dst" "const void *src" "size_t len"
.Ft void *
@@ -80,6 +80,7 @@
.Xr memccpy 3 ,
.Xr memchr 3 ,
.Xr memcmp 3 ,
+.Xr memccpy 3 ,
.Xr memcpy 3 ,
.Xr memmove 3 ,
.Xr memset 3
diff --git a/lib/libc/string/memccpy.3 b/lib/libc/string/memccpy.3
--- a/lib/libc/string/memccpy.3
+++ b/lib/libc/string/memccpy.3
@@ -27,7 +27,7 @@
.\"
.\" @(#)memccpy.3 8.1 (Berkeley) 6/9/93
.\"
-.Dd June 9, 1993
+.Dd December 5, 2023
.Dt MEMCCPY 3
.Os
.Sh NAME
@@ -38,7 +38,12 @@
.Sh SYNOPSIS
.In string.h
.Ft void *
-.Fn memccpy "void *dst" "const void *src" "int c" "size_t len"
+.Fo memccpy
+.Fa "void * restrict dst"
+.Fa "const void * restrict src"
+.Fa "int c"
+.Fa "size_t len"
+.Fc
.Sh DESCRIPTION
The
.Fn memccpy
@@ -61,13 +66,35 @@
Otherwise,
.Fa len
bytes are copied, and a NULL pointer is returned.
+If
+.Fa src
+and
+.Fa dst
+overlap, behavior is undefined.
.Sh SEE ALSO
.Xr bcopy 3 ,
.Xr memcpy 3 ,
.Xr memmove 3 ,
.Xr strcpy 3
+.Sh STANDARDS
+The
+.Fn memccpy
+function conforms to
+.St -p1003.1-2004
+and
+.\" St -isoC-2024 .
+ISO/IEC 9899:2024 (\(lqISO\~C23\(rq).
.Sh HISTORY
The
.Fn memccpy
function first appeared in
-.Bx 4.4 .
+.Bx 4.4
+and was first specified in the
+.\" St -svid1 .
+System\~V Interface Definition, First Edition (\(lqSVID1\(rq).
+The
+.Ft restrict
+keyword was added to the prototype in
+.Fx 5.0.0
+in accordance with the updated specification of
+.St -p1003.1-2004 .
diff --git a/lib/libc/string/memccpy.c b/lib/libc/string/memccpy.c
--- a/lib/libc/string/memccpy.c
+++ b/lib/libc/string/memccpy.c
@@ -36,7 +36,7 @@
#include <string.h>
void *
-memccpy(void *t, const void *f, int c, size_t n)
+memccpy(void * restrict t, const void * restrict f, int c, size_t n)
{
if (n) {

File Metadata

Mime Type
text/plain
Expires
Tue, Feb 11, 6:10 AM (11 h, 47 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16589726
Default Alt Text
D42905.diff (2 KB)

Event Timeline