Page MenuHomeFreeBSD

stat(2): Send to sticky(7) in the S_ISVTX description
ClosedPublic

Authored by arrowd on Mar 21 2026, 11:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 30, 4:09 AM
Unknown Object (File)
Mon, Apr 27, 1:54 PM
Unknown Object (File)
Mon, Apr 27, 1:01 PM
Unknown Object (File)
Mon, Apr 20, 5:42 AM
Unknown Object (File)
Mon, Apr 20, 1:57 AM
Unknown Object (File)
Sun, Apr 19, 12:20 AM
Unknown Object (File)
Thu, Apr 16, 12:05 PM
Unknown Object (File)
Wed, Apr 15, 12:17 AM
Subscribers

Details

Summary

The current description feels unclear to me. It took me a while to find
the sticky(7) manpage, which explains how the sticky bit works on files and
directories. chmod(2) already refers sticky(7) and also gives a good
explanation on how S_ISVTX works.

This change allows for going to sticky(7) from the stat(2) manpage and
the header file.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

The comment currently in place dates back to FreeBSD 1.0,
and I had assumed it was kept as a historical artifact.
However, the same wording was also present in the chmod(2) man page
in FreeBSD 1.0, and in FreeBSD 3.0 it was updated to match what
this patch proposes. The existing description referencing
"save swapped text even after use" is difficult to understand
without knowing the historical context, which is now largely obsolete.

Since this bit is part of the POSIX specification, I also checked
the documentation of other Unix distributions. In all of them,
the current behavior (restricting file deletion) is described,
rather than any reference to a text segment of an application.

I support this change, especially since it aligns with
the explanation already found in chmod(2).

This revision is now accepted and ready to land.Mar 30 2026, 6:00 AM

Stat.2 should have a .Xr sticky 7 somewhere, like SEE ALSO?

In D56015#1284481, @imp wrote:

Stat.2 should have a .Xr sticky 7 somewhere, like SEE ALSO?

I thought the same thing, but it's on line 459 already.