The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
memory.c File Reference
#include "memory.h"

Functions

void * memcpy (void *dest, const void *src, size_t count)
 copies n bytes from memory area src to memory area dst.
void * memmove (void *dest, const void *src, size_t count)
 copies n bytes from memory area src to memory area dst.
void * memset (void *dest, int value, size_t count)
 fills the first n bytes of the memory area pointed to by dst with the constant byte c.
int memcmp (const void *lhs, const void *rhs, size_t count)
 compares the first n bytes of the memory areas s1 and s2.

Function Documentation

◆ memcpy()

void * memcpy ( void * dst,
const void * src,
size_t n )

copies n bytes from memory area src to memory area dst.

The memory areas must not overlap.

Parameters
dstthe destination memory area.
srcthe source memory area.
nthe number of bytes to copy.
Returns
a pointer to the destination memory area dst.

◆ memmove()

void * memmove ( void * dst,
const void * src,
size_t n )

copies n bytes from memory area src to memory area dst.

The memory areas may overlap.

Parameters
dstthe destination memory area.
srcthe source memory area.
nthe number of bytes to copy.
Returns
a pointer to the destination memory area dst.

◆ memset()

void * memset ( void * dst,
int c,
size_t n )

fills the first n bytes of the memory area pointed to by dst with the constant byte c.

Parameters
dstthe memory area to fill.
cthe byte to fill the memory area with.
nthe number of bytes to fill.
Returns
a pointer to the memory area dst.

◆ memcmp()

int memcmp ( const void * s1,
const void * s2,
size_t n )

compares the first n bytes of the memory areas s1 and s2.

Parameters
s1the first memory area to compare.
s2the second memory area to compare.
nthe number of bytes to compare.
Returns
an integer less than, equal to, or greater than zero if the first n bytes of s1 are found, respectively, to be less than, to match, or be greater than the first n bytes of s2.