.th K_release_segment II 4/21/86
.sh NAME
K_release_segment - release a memory segment from address space
.sh "MODULA SYNOPSIS"
.nh
.na
 CONST seg: seg_des;
.br
 VAR stat: K_err_num;
.br
 . . .
.br
 stat := NK_release_segment(seg);
.br
.hy
.ad
.sp
.sh "C SYNOPSIS"
.nh
.na
 seg_des seg;
.br
 int stat;
.br
 . . .
.br
 stat = K_release_segment (seg);
.br
.hy
.ad
.sh DESCRIPTION
The primitive K_release_segment releases the Kernel level resources
associated with the specified segment.  The segment is not deleted if
other processes are still using it or if its swap_lock (sticky) bit is
set.  If the segment is currently locked by K_lock (II), it is released
from exclusive access (see K_unlock (II)).
.sh EXCEPTIONS
.lp 22 15
XbSgDes        Bad segment descriptor:  segSeid is not the descriptor of an existing segment
or process does not have mandatory (security) access to the segment.
.lp 22 15
XnSgDes        Not a segment descriptor:  This number is outside the set of segment
descriptors.
.i0
.sh "SEE ALSO"
K_unlock(II), seg_stat_block(IIa)
