Guardian Procedure Calls Reference Manual
Considerations
• Preventing automatic temporary file purge
ALLOCATESEGMENT opens the swap file for read/write protected access. A process can
prevent the automatic file purge of a temporary swap file by opening the file for read-only
shared access before the segment is deallocated.
• Nonexisting temporary swap file
If a shared segment is being allocated (pin-and-flags bits <2:3> not equal to 0) and
only a volume name is supplied in the file-name parameter, then the complete file name
of the temporary file created by ALLOCATESEGMENT is returned.
• Swap file extent allocation
If a shared extensible segment is being created, then only one extent of the swap file is
allocated when ALLOCATESEGMENT returns. If a nonsharable extensible segment is being
created, no extents are allocated until the user accesses the segment.
Note that if ALLOCATESEGMENT creates the swap file, it configures the extent sizes based
on a maximum of 64 extents.
• Segment sharing
Subject to security requirements, a process can share a segment with another process running
on the same processor. For example, process $X can share a segment with any of these
processes on the same processor:
◦ Any process that has the same process access ID (PAID)
◦ Any process that has the same group ID, if $X is the group manager (that is, if $X has a
PAID of group-id,255)
◦ Any process, if $X has a PAID of the super ID (255,255)
If processes are running in different processors, they can share a segment only if the security
requirements are met and the segment is a read-only segment.
Callers of ALLOCATESEGMENT can share segments with callers of SEGMENT_ALLOCATE_.
High-PIN callers can share segments with low-PIN callers.
• Sharing flat segments
A process cannot share a flat segment with a process that allocated a selectable segment,
because the segments reside in different parts of memory. (Similarly, a process cannot share
a selectable segment with a process that allocated a flat segment.)
For shared flat segments, the call to ALLOCATESEGMENT can be followed by a call to
USESEGMENT, but calling USESEGMENT is unnecessary because all of the flat segments
allocated by a process are always accessible to the process.
Examples
STATUS := ALLOCATESEGMENT (SEGMENT^ID, SEG^SIZE, SWAP^FILE);
! standard call to create a user segment;
! "swap^file" parameter can be omitted
STATUS := ALLOCATESEGMENT (SEGMENT^ID, , FILENAME, %60000);
! allocates a read-only segment whose
! segment size is taken from the size of the
! swap file
STATUS := ALLOCATESEGMENT (SEGMENT^ID, SEGMENT^SIZE,
FILENAME, %44000);
! allocates an extensible segment whose swap file
! disk extents will be allocated as needed
STATUS := ALLOCATESEGMENT (SEGMENT^ID, , , PIN);
62 Guardian Procedure Calls (A-B)