csync(2) — SYSTEM CALLS
NAME
csync − designate portions of memory safe for execution
SYNOPSIS
#include <sys/types.h>
int csync(caddr_t base, unsigned length);
DESCRIPTION
csync designates portions of memory as safe for execution in all executable mappings of the memory. On systems with hardware caches, this notification has the effect of synchronizing the contents of memory with that of the caches.
The values of base and length designate an area of the calling process’s address space: if length is zero, all addresses ( locations 0x0000 0000 through 0xffff ffff, inclusive ) are designated; otherwise, base gives the base address and length the length (in bytes) of the area. If length is not zero, the sum of base and length shall exceed the value of base. The memory associated with the designated area of the calling process’s address space is made safe for execution in all executable mappings of the memory.
Under the following conditions, the function csync fails and sets errno to:
EINVAL base plus length does not exceed base.
DIAGNOSTICS
Upon successful completion a value of 0 is returned. Otherwise, a value of −1 is returned and errno is set to indicate the error.