more sticky explanations.

This commit is contained in:
christos 2004-01-30 16:06:20 +00:00
parent 9af86fc6f2
commit 976cdb2b5d
1 changed files with 25 additions and 18 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: sticky.7,v 1.2 2004/01/30 15:38:18 wiz Exp $
.\" $NetBSD: sticky.7,v 1.3 2004/01/30 16:06:20 christos Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -29,7 +29,7 @@
.\"
.\" @(#)sticky.8 8.1 (Berkeley) 6/5/93
.\"
.Dd May 25, 1998
.Dd January 30, 2004
.Dt STICKY 7
.Os
.Sh NAME
@ -49,6 +49,9 @@ or the file
The use of mode
.Dv S_ISVTX
is reserved and can be set only by the super-user.
.Nx
does not currently treat plain files that have the sticky bit set specially,
but this behavior might change in the future.
.Sh STICKY DIRECTORIES
A directory whose
.Dq sticky bit
@ -68,20 +71,28 @@ See
.Xr chmod 1
for details about modifying file modes.
.Sh HISTORY
The sticky bit first appeared in
.Bx 4.1 .
Its initial use was to mark executables that were frequently used
so that their text would stay in virtual memory after the process
exited.
The sticky bit first appeared in V7, and this manual page appeared
in section 8. It's initial use was to mark sharable executables
that were frequently used so that they would stay in swap after
the process exited. Sharable executables were compiled in a special
way so their text and read-only data could be shared amongst
processes.
.Xr vi 1
and
.Xr sh 1
were such executables.
This is where the term
.Dq sticky
comes from - the text of the program would stick around in virtual
memory.
Such executables were compiled in a way that they would have their
read-only data loaded in the text segment to minimize the amount of
work needed to load the executable.
.Xr vi 1
was one such executable.
comes from - the program would stick around stick around in swap,
and it would not have to be fetched again from the file system. Of
course as long as there was a copy in the swap area, the file was
marked busy so it could not be overwritten. On V7 this meant that
the file could not be removed either, because busy executables
could not be removed but this restriction was lifted on BSD releases.
.Pp
To replace such executables was a cumbersome process. One had first to
remove the sticky bit, then execute the binary so that the copy from swap
was flushed, overwrite the executable, and finally reset the sticky bit.
.Pp
Later, on SunOS 4, the sticky bit got an additional meaning for
files that had the bit set and were not executable: read and write
@ -90,10 +101,6 @@ and bypass the buffer cache.
This was typically used on swap files for NFS clients on an NFS
server, so that swap I/O generated by the clients on the servers
would not evict useful data from the server's buffer cache.
.Pp
.Nx
currently does not treat plain files that have the sticky bit
specially, but this behavior might change in the future.
.Sh BUGS
Neither
.Xr open 2