| Current File : //usr/share/man/man3c/stack_setbounds.3c |
'\" te
.\" Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved.
.TH stack_setbounds 3C "18 Jul 2002" "SunOS 5.11" "Standard C Library Functions"
.SH NAME
stack_setbounds \- update stack boundaries
.SH SYNOPSIS
.LP
.nf
#include <ucontext.h>
\fBint\fR \fBstack_setbounds\fR(\fBconst stack_t *\fR\fIsp\fR);
.fi
.SH DESCRIPTION
.sp
.LP
The \fBstack_setbounds()\fR function updates the current base and bounds of the stack for the current thread to the bounds specified by the \fBstack_t\fR structure pointed to by \fIsp\fR. The \fBss_sp\fR member refers to the virtual address of the base of the stack memory. The \fBss_size\fR member refers to the size of the stack in bytes. The \fBss_flags\fR member must be set to 0.
.SH RETURN VALUES
.sp
.LP
Upon successful completion, \fBstack_setbounds()\fR returns 0. Otherwise, \(mi1 is returned and \fBerrno\fR is set to indicate the error.
.SH ERRORS
.sp
.LP
The \fBstack_setbounds()\fR function will fail if:
.sp
.ne 2
.mk
.na
\fB\fBEFAULT\fR\fR
.ad
.RS 10n
.rt
The \fIsp\fR argument does not refer to a valid address or the \fBss_sp\fR member of the \fBstack_t\fR structure pointed to by \fIsp\fR points to an illegal address.
.RE
.sp
.ne 2
.mk
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
.rt
The \fBss_sp\fR member of the \fBstack_t\fR structure pointed to by sp is not properly aligned, the \fBss_size\fR member is too small or is not properly aligned, or the \fBss_flags\fR member is non-zero.
.RE
.SH USAGE
.sp
.LP
The \fBstack_setbounds()\fR function is intended for use by applications that are managing their own alternate stacks.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i)
lw(2.75i) |lw(2.75i)
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Interface StabilityCommitted
_
MT-LevelAsync-Signal-Safe
.TE
.SH SEE ALSO
.sp
.LP
\fBgetustack\fR(2), \fB_stack_grow\fR(3C), \fBstack_getbounds\fR(3C), \fBstack_inbounds\fR(3C), \fBstack_violation\fR(3C), \fBattributes\fR(5)