1 // SPDX-License-Identifier: GPL-2.0+
3 * Library for freestanding binary
5 * Copyright 2019, Heinrich Schuchardt <xypron.glpk@gmx.de>
7 * GCC requires that freestanding programs provide memcpy(), memmove(),
8 * memset(), and memcmp().
14 * memcmp() - compare memory areas
16 * @s1: pointer to first area
17 * @s2: pointer to second area
18 * @n: number of bytes to compare
19 * Return: 0 if both memory areas are the same, otherwise the sign of the
20 * result value is the same as the sign of the difference between
21 * the first differing pair of bytes taken as u8.
23 int memcmp(const void *s1, const void *s2, size_t n)
38 * memcpy() - copy memory area
40 * @dest: destination buffer
42 * @n: number of bytes to copy
43 * Return: pointer to destination buffer
45 void *memmove(void *dest, const void *src, size_t n)
63 * memcpy() - copy memory area
65 * @dest: destination buffer
67 * @n: number of bytes to copy
68 * Return: pointer to destination buffer
70 void *memcpy(void *dest, const void *src, size_t n)
72 return memmove(dest, src, n);
76 * memset() - fill memory with a constant byte
78 * @s: destination buffer
80 * @n: number of bytes to set
81 * Return: pointer to destination buffer
83 void *memset(void *s, int c, size_t n)