Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/stat.2
Show All 22 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)stat.2 8.4 (Berkeley) 5/1/95 | .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd February 23, 2021 | .Dd March 30, 2021 | ||||
.Dt STAT 2 | .Dt STAT 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm stat , | .Nm stat , | ||||
.Nm lstat , | .Nm lstat , | ||||
.Nm fstat , | .Nm fstat , | ||||
.Nm fstatat | .Nm fstatat | ||||
.Nd get file status | .Nd get file status | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
names a symbolic link, the status of the symbolic link is returned. | names a symbolic link, the status of the symbolic link is returned. | ||||
.It Dv AT_RESOLVE_BENEATH | .It Dv AT_RESOLVE_BENEATH | ||||
Only walk paths below the starting directory. | Only walk paths below the starting directory. | ||||
See the description of the | See the description of the | ||||
.Dv O_RESOLVE_BENEATH | .Dv O_RESOLVE_BENEATH | ||||
flag in the | flag in the | ||||
.Xr open 2 | .Xr open 2 | ||||
manual page. | manual page. | ||||
.It Dv AT_EMPTY_PATH | |||||
If the | |||||
.Fa path | |||||
argument is an empty string, operate on the file or directory | |||||
referenced by the descriptor | |||||
.Fa fd . | |||||
If | |||||
emaste: My take:
If the path argument is an empty string, operate on the file or directory referenced… | |||||
.Fa fd | |||||
is equal to | |||||
.Dv AT_FDCWD , | |||||
operate on the current working directory. | |||||
Done Inline ActionsSome mention of the required privileges seems useful. markj: Some mention of the required privileges seems useful. | |||||
Done Inline ActionsThere is no required privilege for fstat(). For linkat() I will mention PRIV_VFS_FHOPEN kib: There is no required privilege for fstat(). For linkat() I will mention PRIV_VFS_FHOPEN | |||||
.El | .El | ||||
.Pp | .Pp | ||||
If | If | ||||
.Fn fstatat | .Fn fstatat | ||||
is passed the special value | is passed the special value | ||||
.Dv AT_FDCWD | .Dv AT_FDCWD | ||||
in the | in the | ||||
.Fa fd | .Fa fd | ||||
▲ Show 20 Lines • Show All 360 Lines • Show Last 20 Lines |
My take:
If the path argument is an empty string, operate on the file or directory referenced by the descriptor fd. If fd is equal to AT_FDCWD, operate on the current working directory.
"operate on" could be "return information about" if that's more clear.
To me it seems that "file or directory referenced..." is sufficiently clear that the "does not need to be a directory" sentence could be omitted, but I'm not certain - you could also leave it.