

lock()                 COHERENT System Call                lock()




Prevent process from swapping

lloocckk(_f_l_a_g)
iinntt _f_l_a_g;

The  COHERENT system  can swap  a process in  and out  of memory.
However, real-time response  sometimes requires that a process be
locked in memory.

When  called  with  a nonzero  flag,  lock  prevents the  calling
process from  swapping (unless  swapping is required  to increase
its memory  size).  Calling lock with a flag  of zero unlocks the
process.

This call  is restricted to  the superuser.  Processes  doing raw
I/O are automatically locked  into memory for the duration of the
I/O operation.

***** See Also *****

COHERENT system calls, ps, swap

***** Diagnostics *****

lock  returns zero  if it  performs the  indicated action  and -1
otherwise.  An error occurs if the caller is not the superuser.

***** Notes *****

The existence of  several locked processes may cause memory frag-
mentation.   Therefore, all  locked processes  should  be created
just after  the system is booted, if  possible.  In general, lock
should be avoided if any alternative exists.























COHERENT Lexicon                                           Page 1


