SEGFLUSH(2) System Calls Manual SEGFLUSH(2)NAME
segflush - flush instruction and data caches
SYNOPSIS
#include <u.h>
#include <libc.h>
int segflush(void *va, ulong len)
DESCRIPTION
Segflush invalidates any instruction cache and writes back any data cache associated with pages contained in a segment. All subsequent new
pages in the segment will also be flushed when first referenced.
Va is an address within the segment to be flushed; it is rounded down to the nearest page boundary. Len specifies the length in bytes of
the memory to flush; va+len is rounded up to the nearest page boundary. Segflush works correctly when the memory straddles multiple seg-
ments.
Correct use of segflush depends on an understanding of the cache architecture of the specific machine.
SOURCE
/sys/src/libc/9syscall
SEE ALSO segattach(2), segbrk(2)
/proc/*/segment
DIAGNOSTICS
Sets errstr.
SEGFLUSH(2)
Check Out this Related Man Page
BRK(2) System Calls Manual BRK(2)NAME
brk, sbrk - change memory allocation
SYNOPSIS
#include <u.h>
#include <libc.h>
int brk(void *addr)
void* sbrk(ulong incr)
DESCRIPTION
Brk sets the system's idea of the lowest bss location not used by the program (called the break) to addr rounded up to the next multiple of
8 bytes. Locations not less than addr and below the stack pointer may cause a memory violation if accessed.
In the alternate function sbrk, incr more bytes are added to the program's data space and a pointer to the start of the new area is
returned. Rounding occurs as with brk.
When a program begins execution via exec the break is set at the highest location defined by the program and data storage areas. Ordinar-
ily, therefore, only programs with growing data areas need to use brk. A call to sbrk with a zero argument returns the lowest address in
the dynamic segment.
SOURCE
/sys/src/libc/9sys/sbrk.c
SEE ALSO intro(2), malloc(2), segattach(2), segbrk(2)DIAGNOSTICS
These functions set errstr.
The error return from sbrk is (void*)-1.
BRK(2)
What is the point of this? Whenever I close my shell it appends to the history file without adding this. I have never seen it overwrite my history file.
# When the shell exits, append to the history file instead of overwriting it
shopt -s histappend (3 Replies)