View Issue Details

IDProjectCategoryView StatusLast Update
00020171003.1(2024)/Issue8System Interfacespublic2026-12-02 00:36
Reporterromanzilka Assigned To 
PrioritynormalSeverityEditorialTypeEnhancement Request
Status NewResolutionOpen 
NameRoman Žilka
Organization
User Reference
Sectionstring.h
Page Number0
Line Number0
Interp Status
Final Accepted Text
Summary0002017: string.h: Add mempcpy(), analog of stpncpy()
DescriptionI propose adding the function mempcpy() into string.h, as known from the GNU C Library. See:
https://man7.org/linux/man-pages/man3/mempcpy.3.html

It will complement well the recently added stpcpy() and stpncpy() (or, rather, the other way around).

Desired Action doesn't include the obligatory function prototype in the section on string.h.
Desired ActionNAME
mempcpy — copy bytes in memory, returning a pointer just behind target area

SYNOPSIS
[CX]
#include <string.h>

void *mempcpy(void *restrict s1, const void *restrict s2, size_t n);
[/CX]

DESCRIPTION
The mempcpy() function shall copy n bytes from the object pointed to by s2 into the object pointed to by s1. If copying takes place between objects that overlap, the behavior is undefined. The function shall behave as if the copying were performed by memcpy().

The mempcpy() function shall not change the setting of errno on valid input.

RETURN VALUE
The mempcpy() function shall return a pointer one past the last element of the array (unsigned char *)s1 of size n, i.e., (unsigned char *)s1 + n. No return value is reserved to indicate an error.

ERRORS
No errors are defined.
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-12-02 00:36 romanzilka New Issue