BSD 4_2 development
[unix-history] / usr / man / man8 / sticky.8
CommitLineData
b56edb6d
C
1.TH STICKY 8 "4 February 1983"
2.UC 4
3.SH NAME
4sticky \- executable files with persistent text
5.SH DESCRIPTION
6While the `sticky bit', mode 01000 (see
7.IR chmod (2)),
8is set on a sharable executable file,
9the text of that file will not be removed from the system swap area.
10Thus the file does not have to be fetched from the file system
11upon each execution.
12As long as a copy remains in the swap area, the
13original text cannot be overwritten in the file system,
14nor can the file be deleted.
15(Directory entries can be removed so long as one link remains.)
16.PP
17Sharable files are made by the
18.B \-n
19and
20.B \-z
21options of
22.IR ld (1).
23.PP
24To replace a sticky file that has been used do:
25(1) Clear the sticky bit with
26.IR chmod (1).
27(2) Execute the old program to flush the swapped copy.
28This can be done safely even if others are using it.
29(3) Overwrite the sticky file.
30If the file is being executed by any process,
31writing will be prevented; it suffices to simply remove the file
32and then rewrite it, being careful to reset the owner and mode with
33.I chmod
34and
35.IR chown (2).
36(4) Set the sticky bit again.
37.PP
38Only the super-user can set the sticky bit.
39.SH BUGS
40Are self-evident.
41.PP
42Is largely unnecessary on the VAX; matters only for large programs that
43will page heavily to start, since text pages are normally cached incore
44as long as possible after all instances of a text image exit.