Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ plock(2) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                                 plock(2)



        _________________________________________________________________
        plock                                                 System Call
        Lock data, text, or both into memory.
        _________________________________________________________________


        SYNTAX

        int               plock    (command)
        int               command;


        PARAMETERS

        command        Denotes the specific operation.


        DESCRIPTION

        The semantics of this call are inherently implementation
        dependent.  Its only effects are on performance, both of the
        process and of the system.

        Plock allows the calling process to lock its text segment, its
        data segment, or both into memory.  The locking of a segment has
        no effect in this implementation but may have the effect of
        either making pages in the segment less likely to be thrown out
        of memory than the pages of unlocked segments or the pages could
        actually be wired.  [Locked segments (sometimes referred to as
        "wired" into memory) are immune from all routine paging.  The
        issues are:  Under what circumstances, if any, will a locked page
        ever be paged out?  Under what circumstances will a locked page
        ever be paged in; i.e., are pages of locked segments faulted in
        when the plock call is made, or merely locked in if they are
        faulted on sometime after the plock call?  It is likely this call
        may fail in some circumstances due to oversubscription of memory.
        It is not clear if the data segment includes the stack in other
        implementations, or whether the stack will be included in the
        data segment for purposes of plock in the DG/UX system.] Plock
        also allows these segments to be unlocked.  The effective user id
        of the calling process must be super-user.

        The semantics of plock depend upon <command> as follows:


        TXTLOCK
             Lock text segment into memory.  An error is returned and no
             change is made if the text segment is already locked.


        DATLOCK



        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                                 plock(2)



             Lock data segment into memory.  An error is returned and no
             change is made if the data segment is already locked.


        PROCLOCK
             Lock text and data segments into memory.  An error is
             returned and no change is made if either the text or data
             segments are already locked.


        UNLOCK
             Remove locks.  This single operation unlocks all currently
             locked segments -- text, data, or both.  An error is
             returned and no change is made if neither text nor data is
             locked.

        Note that a TXTLOCK and a DATLOCK operation, in either order, are
        equivalent to a PROCLOCK operation.

        Locks are not inherited across a fork or vfork.


        ACCESS CONTROL

        The effective user id of the calling process must be super-user.


        RETURN VALUE

        0              The plock operation was successful.


        -1             An error occurred.  Errno is set to indicate the
                       error.


        EXCEPTIONS

        Plock will fail and not perform the requested operation if an
        error occurs.  Errno may be set to one of the following error
        codes regardless of the value of <command>:


        EPERM          The effective user id of the calling process is
                       not super-user.


        EINVAL         <Command> is not a valid command.

        The TXTLOCK command may return the following errors:




        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)





                                                                 plock(2)



        EINVAL         A text lock or a process lock already exists on
                       the calling process.

        The DATLOCK command may return the following errors:


        EINVAL         A data lock or a process lock already exists on
                       the calling process.

        The PROCLOCK command may return the following errors:


        EINVAL         A text lock or a data lock already exists on the
                       calling process.

        The UNLOCK command may return the following errors:


        EINVAL         Neither a text nor a data lock exists on the
                       calling process.


        SEE ALSO

        The related system calls:  exec, exit, fork.





























        DG/UX 4.00                                                 Page 3
               Licensed material--property of copyright holder(s)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026