memfill(3pub)

memfill3pub

Fill memory area with pattern

Usage

#include <publib.h>
void *memfill(void *buf, size_t size, const void *pat, size_t patsize);

Overview

memfill copies consecutive bytes from the pattern pat to consecutive bytes in the memory area buf, wrapping around in pat when its end is reached. patsize is the size of the pattern, size is the size of the memory area. The pattern and the memory area must not be overlapping.

Return value

memfill returns its first argument.

Examples

To initialize an integer array one might do the following.

int temp, array[1024];
temp = 1234;
memfill(array, sizeof(array), &temp, sizeof(temp));

Releases

16 releases since Debian 1.2 (Rex); the text changed 4 times.

  1. 1.2–1.3
  2. 2.0–2.2
  3. 3.0
  4. 3.1–6.0
  5. 7–13

Author

Lars Wirzenius ([email protected])

From publib-dev 0.40-4 in Debian 13 (Trixie). Parsed by carta from the page's man source.