| Current File : //usr/man/man3c/end.3c |
'\" te
.\" Copyright 1989 AT&T.
.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
.TH end 3C "31 Mar 2006" "SunOS 5.11" "Standard C Library Functions"
.SH NAME
end, _end, etext, _etext, edata, _edata \- last locations in program
.SH SYNOPSIS
.LP
.nf
\fBextern int \fR\fI_etext\fR\fB;\fR
.fi
.LP
.nf
\fBextern int \fR\fI_edata\fR\fB;\fR
.fi
.LP
.nf
\fBextern int \fR\fI_end\fR\fB;\fR
.fi
.SH DESCRIPTION
.sp
.LP
These names refer neither to routines nor to locations with interesting contents; only their addresses are meaningful.
.sp
.ne 2
.mk
.na
\fB\fB_etext\fR\fR
.ad
.RS 10n
.rt
The address of \fB_etext\fR is the first location after the last read-only loadable segment.
.RE
.sp
.ne 2
.mk
.na
\fB\fB_edata\fR\fR
.ad
.RS 10n
.rt
The address of \fB_edata\fR is the first location after the last read-write loadable segment.
.RE
.sp
.ne 2
.mk
.na
\fB\fB_end\fR\fR
.ad
.RS 10n
.rt
If the address of \fB_edata\fR is greater than the address of \fB_etext\fR, the address of _end is same as the address of \fB_edata\fR.
.sp
If the address of \fB_etext\fR is greater than the address of \fB_edata\fR, the address of \fB_end\fR is set to the page boundary after the address pointed to by \fB_etext\fR.
.RE
.SH USAGE
.sp
.LP
When execution begins, the program break (the first location beyond the data) coincides with \fB_end\fR, but the program break can be reset by the \fBbrk\fR(2), \fBmalloc\fR(3C), and the standard input/output library (see \fBstdio\fR(3C)), functions by the profile (\fB-p\fR) option of \fBcc\fR, and so on. Thus, the current value of the program break should be determined by \fBsbrk ((char *)0)\fR.
.sp
.LP
References to \fBend\fR, \fBetext\fR, and \fBedata\fR, without a preceding underscore will be aliased to the associated symbol that begins with the underscore.
.SH SEE ALSO
.sp
.LP
\fBbrk\fR(2), \fBmalloc\fR(3C), \fBstdio\fR(3C)