1plock(3C)                Standard C Library Functions                plock(3C)
2
3
4

NAME

6       plock - lock or unlock into memory process, text, or data
7

SYNOPSIS

9       #include <sys/lock.h>
10
11       int plock(int op);
12
13

DESCRIPTION

15       The  plock() function allows the calling process to lock or unlock into
16       memory its text segment (text lock), its data segment (data  lock),  or
17       both  its  text  and  data segments (process lock). Locked segments are
18       immune to all routine swapping. The effective user ID  of  the  calling
19       process must be super-user to use this call.
20
21
22       The plock() function performs the function specified by op:
23
24       PROCLOCK    Lock text and data segments into memory (process lock).
25
26
27       TXTLOCK     Lock text segment into memory (text lock).
28
29
30       DATLOCK     Lock data segment into memory (data lock).
31
32
33       UNLOCK      Remove locks.
34
35

RETURN VALUES

37       Upon  successful  completion,  0 is returned. Otherwise, −1 is returned
38       and errno is set to indicate the error.
39

ERRORS

41       The plock() function fails and does not perform the requested operation
42       if:
43
44       EAGAIN    Not enough memory.
45
46
47       EINVAL    The  op  argument  is equal to PROCLOCK and a process lock, a
48                 text lock, or a data  lock  already  exists  on  the  calling
49                 process;  the op argument is equal to TXTLOCK and a text lock
50                 or a process lock already exists on the calling process;  the
51                 op  argument is equal to DATLOCK and a data lock or a process
52                 lock already exists on the calling process; or the  op  argu‐
53                 ment  is  equal  to  UNLOCK and no lock exists on the calling
54                 process.
55
56
57       EPERM     The {PRIV_PROC_LOCK_MEMORY} privilege is not asserted in  the
58                 effective set of the calling process.
59
60

USAGE

62       The  mlock(3C)  and mlockall(3C) functions are the preferred interfaces
63       for process locking.
64

ATTRIBUTES

66       See attributes(5) for descriptions of the following attributes:
67
68
69
70
71       ┌─────────────────────────────┬─────────────────────────────┐
72       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
73       ├─────────────────────────────┼─────────────────────────────┤
74       │MT-Level                     │MT-Safe                      │
75       └─────────────────────────────┴─────────────────────────────┘
76

SEE ALSO

78       exec(2),  exit(2),  fork(2),   memcntl(2),   mlock(3C),   mlockall(3C),
79       attributes(5)
80
81
82
83SunOS 5.11                        22 Mar 2004                        plock(3C)
Impressum