What does the “sticky bit” mean in NFS

executablefilesnfspermissions

I'm trying to figure how is the sticky bit used in NFS v3.
RFC 1813 says on page 22:

0x00200 Save swapped text (not defined in POSIX).

What do they mean by "swapped text"?
In "NFS Illustrated", the author, Brent Callaghan, says it means not to cache. However, I haven't seen this explanation in other places.

Best Answer

The text section of an executable is the actual executable code, this is what it refers to. On Linux this request is ignored, it is just an optimisation, made by the admin. The kernel can do this for it self, without the prompt.

It is saying that if the executable text gets swapped out, and the process ends, then keep it for next time. On linux (local)executables are not swapped out, as it is as quick to reload from file. Maybe it is a bit different for NFS.

The sticky bit has other meanings for other file types: You described for executables. For directories, it stops non owners from deleting files.

I assume that nfs is the same, when I used it 20 years ago it was.


from: http://netbsd.gw.com/cgi-bin/man-cgi?sticky+7+NetBSD-current

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 operations from and to those files would go directly to the disk 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.