SEGMENT_DESTROY

Purpose

segment_destroy destroys a memory segment. 

Synopsis

#include <types.h> 
#include <stub.h> 

int segment_destroy(Capability *segment); 

Parameters

Description

segment_destroy destroys the memory segment designated by segment. Destroying a segment includes releasing the memory used to map it as well as it capability. 

Return Values

On success, segment_destroy returns 0 and the capability segment is no longer valid. 

On fail, segment_destroy returns a negative value indicating one of the following errors: 

See Also

segment_create, segment_status, segment_attach, segment_detach, segment_resize 

Notes

What happens if a segment is destroyed while it is still attached to some task address space is not predictable in this version, since the kernel does not maintain information about who is using the segment.