end(3) CLIX end(3)
NAME
end, etext, edata - The last locations in a program
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
extern end ;
extern etext ;
extern edata ;
DESCRIPTION
These names refer neither to functions nor to locations with interesting
contents. The address of etext is the first address above the program
text, the address of edata above the initialized data region, and the
address of end above the uninitialized data region.
When execution begins, the program break (the first location beyond the
data) coincides with end, but the program break may be reset by the
functions of brk(), malloc(), standard input/output stdio(), the profile
(-p) flag of the cc command, and in other ways. Thus, the current value
of the program break should be determined by sbrk (char *)(0). See brk().
EXAMPLES
This example shows a code fragment which gets the program break and
assumes that the break has not been reset by brk(), malloc(), or by any
other means:
.
.
.
extern end;
unsigned int break;
/* get the program break - assumes the break has not been reset */
/* by brk(), malloc(), etc. */
break = &end;
.
.
.
RETURN VALUES
2/94 - Intergraph Corporation 1
end(3) CLIX end(3)
Not valid.
RELATED INFORMATION
Commands: cc(1)
Functions: brk(2), malloc(3), stdio(3)
2 Intergraph Corporation - 2/94