  PROCEDURE [INLINE] osp$verify_system_privilege;

{ This inline procedure utilizes the system privilege bit map
{ to verify that the caller has system privilege, defined as: if
{ segment(caller) is a system segment, then proceed.  Otherwise,
{ force the task to abort via an access violation.

?? PUSH (LISTEXT := ON) ??
*copyc osv$system_privilege_map
*copyc ost$caller_identifier
?? POP ??
  CONST
    bad_offset = 0bad0ca0(16);

  VAR
    id : ost$caller_identifier,
    p : ^integer;

{ Begin executable statements.

{ Get the caller's segment number.

  #caller_id(id);

{ Check the bit map.

  IF NOT osv$system_privilege_map[id.segnum] THEN

{ Form an illegal address.

    p := #address( 1, 0, bad_offset );

{ Cause an access violation by dereferencing the pointer.

    p^ := 0;

  IFEND;

  PROCEND osp$verify_system_privilege;
